给Cat1添加休眠控制函数暂时函数为空
authorSnickerSun <snickersun@163.com>
Mon, 1 Apr 2024 11:24:01 +0000 (19:24 +0800)
committerSnickerSun <snickersun@163.com>
Mon, 1 Apr 2024 11:24:01 +0000 (19:24 +0800)
code/sdk/application/wearable/service/power_manager/src/actions/display_action.c
code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp
code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp

index 746856f..85baf1a 100755 (executable)
@@ -149,6 +149,9 @@ static uint32_t action_display_lcd_on()
 #ifdef SUPPORT_BATTERY_SERVICE
     battery_service_resume();
 #endif
+#ifdef SUPPORT_CAT1_SERVICE
+    uapi_cat1_resume();
+#endif
 #ifdef SUPPORT_AT_OHOSFWK
     notify_screen_on_event();
 #endif
@@ -229,6 +232,9 @@ static uint32_t action_display_lcd_off()
     #ifdef SUPPORT_BATTERY_SERVICE
     battery_service_suspend();
     #endif
+    #ifdef SUPPORT_CAT1_SERVICE
+    uapi_cat1_suspend();
+    #endif
     uapi_pm_request_mode(PM_ID_VIDEO, PM_MODE_LP);
     return ERRCODE_SUCC;
 }
index 193e722..0da4579 100644 (file)
@@ -140,6 +140,45 @@ void uapi_cat1_pre_init(void)
     VoiceCallVolteSample(2,(const char**)argv); 
 }
 
+
+void uapi_cat1_suspend(void)
+{
+
+    PRINT("uapi_cat1_suspend\n");
+
+    // //关闭唤醒对方
+    // uapi_cat1_wakeup_cat1(0);
+
+    // //关闭Uart
+
+    // //中断唤醒你对方
+    // // uapi_gpio_set_dir(S_AGPIO_L30, GPIO_DIRECTION_OUTPUT);
+    // // uapi_gpio_set_val(S_AGPIO_L30, GPIO_LEVEL_LOW);
+
+    // //pcm 休眠设置为0 
+    // uapi_pin_set_mode(S_AGPIO_L1, (pin_mode_t)HAL_PIO_FUNC_GPIO);
+    // uapi_gpio_set_dir(S_AGPIO_L1, GPIO_DIRECTION_OUTPUT);
+    // uapi_gpio_set_val(S_AGPIO_L1, GPIO_LEVEL_LOW);
+    // uapi_pin_set_mode(S_AGPIO_L2, (pin_mode_t)HAL_PIO_FUNC_GPIO);
+    // uapi_gpio_set_dir(S_AGPIO_L2, GPIO_DIRECTION_OUTPUT);
+    // uapi_gpio_set_val(S_AGPIO_L2, GPIO_LEVEL_LOW);
+    // uapi_pin_set_mode(S_AGPIO_L3, (pin_mode_t)HAL_PIO_FUNC_GPIO);
+    // uapi_gpio_set_dir(S_AGPIO_L3, GPIO_DIRECTION_OUTPUT);
+    // uapi_gpio_set_val(S_AGPIO_L3, GPIO_LEVEL_LOW);
+    // uapi_pin_set_mode(S_AGPIO_L4, (pin_mode_t)HAL_PIO_FUNC_GPIO);
+    // uapi_gpio_set_dir(S_AGPIO_L4, GPIO_DIRECTION_OUTPUT);
+    // uapi_gpio_set_val(S_AGPIO_L4, GPIO_LEVEL_LOW);
+
+    
+}
+
+
+void uapi_cat1_resume(void)
+{
+    PRINT("uapi_cat1_resume\n");
+
+}
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
\ No newline at end of file
index bb06366..75406a5 100644 (file)
@@ -20,6 +20,9 @@ void uapi_cat1_add_audio_vote(void);
 void uapi_cat1_wakeup_cat1(uint8_t wakeup);\r
 bool uapi_cat1_get_power_stat(void);\r
 \r
+void uapi_cat1_suspend(void);\r
+void uapi_cat1_resume(void);\r
+\r
 #ifdef __cplusplus\r
 #if __cplusplus\r
 }\r
index 14527f8..69c9fd0 100644 (file)
@@ -326,7 +326,7 @@ int cat1_handle_timesync(struct tcp_msg_t *msg)
 
 static void timeout_handler_sleep_cat1(void)
 {
-    printf("sleep cat1\n");
+    printf("sleep mcu\n");
     uapi_cat1_remove_audio_vote(); //接收到指令,让自己可以睡
     // uapi_cat1_wakeup_cat1(0);// 反馈给cat1,它也可以自己睡
     if(osTimerIsRunning(g_timer_cat1_sleep)==1  )