From 5aa798686baa3dd4438d6a74a667c73ce359e60d Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Mon, 1 Apr 2024 19:24:01 +0800 Subject: [PATCH] =?utf8?q?=E7=BB=99Cat1=E6=B7=BB=E5=8A=A0=E4=BC=91?= =?utf8?q?=E7=9C=A0=E6=8E=A7=E5=88=B6=E5=87=BD=E6=95=B0=E6=9A=82=E6=97=B6?= =?utf8?q?=E5=87=BD=E6=95=B0=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/actions/display_action.c | 6 +++ .../peripheral/slip/cat1Service/cat1_ctl.cpp | 39 +++++++++++++++++++ .../peripheral/slip/cat1Service/cat1_ctl.h | 3 ++ .../slip/cat1Service/cat1_server.cpp | 2 +- 4 files changed, 49 insertions(+), 1 deletion(-) 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 ) -- 2.17.1