From: SnickerSun Date: Tue, 26 Mar 2024 16:38:56 +0000 (+0800) Subject: 添加抬手亮屏功能 X-Git-Tag: release_V1.2.70_20241020_135402~1257^2~1 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=f45ee98d80b32bb6e62be7d0871624237b11ece7;p=mirrors%2FFD230.git 添加抬手亮屏功能 --- diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 16f1b3686..634d277b4 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -5,6 +5,7 @@ #include #include #include "cywee_hal.h" +#include "power_display_service.h" #define AP_ENABLE_DML_SDO_LISTEN @@ -47,7 +48,25 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { break; case IDX_ALGO_WATCH_HANDUP: CWM_OS_dbgPrintf("HANDUP_DOWN MSG [%d]\n",(int)sensorEVT->fData[1]); - + #if defined(SUPPORT_POWER_MANAGER) + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + #endif + if ((int)sensorEVT->fData[1] == 2) + { + #if defined(SUPPORT_POWER_MANAGER) + display_api->set_screen_set_keepon_timeout(0); + CWM_OS_dbgPrintf("[cwyee] turn_off_screen"); + #endif + }else if ((int)sensorEVT->fData[1] == 1) + { + #if defined(SUPPORT_POWER_MANAGER) + if (display_api->get_screen_state() != SCREEN_ON) { + CWM_OS_dbgPrintf("[cwyee] turn_on_screen"); + display_api->turn_on_screen(); + } + display_api->set_screen_set_keepon_timeout(5000); + #endif + } break; case IDX_ALGO_SLEEP: CWM_OS_dbgPrintf("IDX_ALGO_SLEEP\n");