From 945c3101ecb27fddcc8fc44ab17e9b06fa66a61b Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 16 Oct 2024 21:33:43 +0800 Subject: [PATCH] =?utf8?q?1.=E9=95=BF=E4=BA=AE=E5=B1=8Fruntime=E8=AE=BE?= =?utf8?q?=E7=BD=AE=E4=BC=98=E5=8C=96=EF=BC=8C=E5=8F=AA=E6=9C=89=E5=9C=A8?= =?utf8?q?=E8=AE=BE=E7=BD=AE=E6=88=90=E5=8A=9F=E6=97=B6=E5=80=99=E6=89=8D?= =?utf8?q?=E8=AE=BE=E7=BD=AE=202.=E8=B0=83=E8=AF=95=E7=95=8C=E9=9D=A2?= =?utf8?q?=E6=B7=BB=E5=8A=A0=E6=98=BE=E7=A4=BAruntime=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../debug_output_notification.cpp | 5 ++++ .../drivers/peripheral/utils/custom_utils.c | 23 ++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index e13b3f421..62a3ae994 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -215,6 +215,11 @@ result += "advdata:" + (getCurrentWatchadvdata()) + " "; result += "nap_status:" + std::to_string(uapi_dev_runtime_get_nap_status()) + " ";; result += "sleep_monitoring_status:" + std::to_string(uapi_dev_runtime_get_sleep_monitoring_status()) + " ";; result += "sleep_status:" + std::to_string(uapi_dev_runtime_get_sleep_status()) + " ";; + result += "lock_flag_goal:" + std::to_string(uapi_dev_runtime_get_goal_storage_status()) + " ";; + result += "respiratory_training_status:" + std::to_string(uapi_dev_runtime_get_respiratory_training_status()) + " ";; + result += "heartrate_detect_status:" + std::to_string(uapi_dev_runtime_get_heartrate_detect_status()) + " ";; + result += "factory_test_status:" + std::to_string(uapi_dev_runtime_get_factory_test_status_flag()) + " ";; + result += "screen_always_on_status:" + std::to_string(uapi_dev_runtime_get_screen_always_on_status()) + " ";; return result; } diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index d0f2fdf51..eacf76aab 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -1093,6 +1093,7 @@ static bool s_screen_always_on = false; void ScreenAlwaysOnCtr(uint8_t turnOnFlag) { const power_display_svr_api_t *display_api = power_display_svr_get_api(); + errcode_t ret; if(turnOnFlag) { // display_api->set_screen_set_keepon_timeout(0); @@ -1102,19 +1103,25 @@ void ScreenAlwaysOnCtr(uint8_t turnOnFlag) display_api->turn_on_screen(); } - uapi_dev_runtime_set_screen_always_on_status(1); //当设置的值是-1 的时候,设置屏幕常亮 - display_api->set_screen_set_keepon_timeout(-1); - s_screen_always_on = true; + ret = display_api->set_screen_set_keepon_timeout(-1); + printf("set_screen_set_keepon_timeout: %d\r\n",ret); + if(ret == ERRCODE_SUCC) // 操作成功,设置屏幕常亮runtime值 + { + uapi_dev_runtime_set_screen_always_on_status(1); + s_screen_always_on = true; + } } else { - - uapi_dev_runtime_set_screen_always_on_status(0); - - display_api->set_screen_set_keepon_timeout(0); - s_screen_always_on = false; + ret = display_api->set_screen_set_keepon_timeout(0); + printf("set_screen_set_keepon_timeout: %d\r\n",ret); + if(ret == ERRCODE_SUCC) // 操作成功,设置屏幕常亮runtime值 + { + uapi_dev_runtime_set_screen_always_on_status(0); + s_screen_always_on = false; + } } } -- 2.17.1