From: SnickerSun Date: Mon, 1 Apr 2024 11:24:01 +0000 (+0800) Subject: 给Cat1添加休眠控制函数暂时函数为空 X-Git-Tag: release_V1.2.70_20241020_135402~1237^2~5 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=5aa798686baa3dd4438d6a74a667c73ce359e60d;p=mirrors%2FFD230.git 给Cat1添加休眠控制函数暂时函数为空 --- diff --git a/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c b/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c index 746856f56..85baf1ab3 100755 --- a/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c +++ b/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c @@ -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; } diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp index 193e7229a..0da45797b 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp @@ -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 diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h index bb06366b6..75406a5be 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h @@ -20,6 +20,9 @@ void uapi_cat1_add_audio_vote(void); void uapi_cat1_wakeup_cat1(uint8_t wakeup); bool uapi_cat1_get_power_stat(void); +void uapi_cat1_suspend(void); +void uapi_cat1_resume(void); + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index 14527f8ce..69c9fd0a8 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -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 )