From f45ee98d80b32bb6e62be7d0871624237b11ece7 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Wed, 27 Mar 2024 00:38:56 +0800 Subject: [PATCH] =?utf8?q?=E6=B7=BB=E5=8A=A0=E6=8A=AC=E6=89=8B=E4=BA=AE?= =?utf8?q?=E5=B1=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../drivers/peripheral/cywee/src/main_dml.c | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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"); -- 2.17.1