From: luozheng <1732036298@qq.com> Date: Wed, 16 Oct 2024 13:33:43 +0000 (+0800) Subject: 1.长亮屏runtime设置优化,只有在设置成功时候才设置 X-Git-Tag: release_V1.2.70_20241020_135402~5^2~22 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=945c3101ecb27fddcc8fc44ab17e9b06fa66a61b;p=mirrors%2FFD230.git 1.长亮屏runtime设置优化,只有在设置成功时候才设置 2.调试界面添加显示runtime值 --- 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; + } } }