更新
authorp15692025051 <846603105@qq.com>
Thu, 21 Aug 2025 07:05:24 +0000 (15:05 +0800)
committerp15692025051 <846603105@qq.com>
Thu, 21 Aug 2025 07:05:24 +0000 (15:05 +0800)
2.code/1.sdk/apps/BK_app/bk_app.c
2.code/1.sdk/apps/BK_app/bk_app.h

index b8a5cdf..5b62d00 100644 (file)
@@ -66,10 +66,15 @@ int bk_key_switch(int key_event,int key_value)
 u16 AI_VC_1S_id = 0;
 u16 AI_VC_sleep_count = 0;
 void AI_VC_1S_cb(void *p)
+{
+    bk_app_send_smg(AI_VC_1S_EVENT,NULL,0);
+}
+void AI_VC_1S_event(void)
 {
     
     int cat1_io = gpio_read(IO_PORTA_10) ;
     printf("AI_VC_1S_cb:%d",cat1_io);
+    #if BK_VAD_KWS 
     if(cat1_io == 0 && AI_start_flag == 1)//cat1退出唤醒,进入休眠
     {
         if(AI_VC_sleep_count<=0)
@@ -89,6 +94,14 @@ void AI_VC_1S_cb(void *p)
             bk_app_send_smg(AI_CLOSE,NULL,0);//会关闭定时器
         }
     }
+    #else
+    if(cat1_io == 0 && AI_start_flag == 1)//cat1退出唤醒,进入休眠
+    {
+        log_info("%s:该休眠了 !!!!!!",__FUNCTION__);
+        gpio_write(IO_PORTB_03,0);
+        bk_app_send_smg(AI_CLOSE,NULL,0);//会关闭定时器
+    }
+    #endif
 }
 //vc开始
 void AI_VC_start(void)
@@ -197,6 +210,8 @@ void bk_app_task(void *p)
             }
                 
             break;    
+        case AI_VC_1S_EVENT:
+            AI_VC_1S_event();
         default:
             break;
         }
@@ -376,6 +391,11 @@ static u8 BK_AI_APP_idle_query()
 {
     //printf("%d",gpio_read(IO_PORTA_10));
     //return 0;
+    if(gpio_read(IO_PORTA_10) == 1 && AI_start_flag == 0)
+    {
+        bk_app_send_smg(WAKEUQ_BT,NULL,0);
+        printf("4g唤醒了,但没打开音频!");
+    }
     if(AI_start_flag == 1)
         return 0;
     else
index 334d32c..63f8edd 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef    __BK_APP_H__
 #define    __BK_APP_H__
-#define BK_VAD_KWS 1
+#define BK_VAD_KWS 0
 typedef enum 
 {
     AI_KEY_PRESS = 0,
@@ -11,6 +11,7 @@ typedef enum
     WAKEUQ_BT,
     VAD_RUN,
     UART_EVENT,
+    AI_VC_1S_EVENT,
 
 }bk_app_msg_event;
 typedef enum