From 67e614d008674498971394465f2a5fd0f010e465 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Thu, 11 Jul 2024 21:03:04 +0800 Subject: [PATCH] =?utf8?q?=E5=85=B3=E9=97=AD=E6=94=BE=E8=85=95=E7=81=AD?= =?utf8?q?=E5=B1=8F=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=B1=8F=E5=B9=95=E4=BA=AE?= =?utf8?q?=E5=BA=A6=E4=B8=BA=E7=99=BE=E5=88=86=E4=B9=8B80=EF=BC=8C?= =?utf8?q?=E5=A2=9E=E5=8A=A0func=E9=94=AE=E7=82=B9=E4=BA=AE=E5=B1=8F?= =?utf8?q?=E5=B9=95=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../drivers/peripheral/config/include/ConfigModel.h | 2 +- code/sdk/drivers/peripheral/cywee/src/main_dml.c | 9 ++++++--- code/sdk/drivers/peripheral/utils/custom_utils.c | 12 ++++++++++++ code/sdk/drivers/peripheral/utils/custom_utils.h | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/code/sdk/drivers/peripheral/config/include/ConfigModel.h b/code/sdk/drivers/peripheral/config/include/ConfigModel.h index cbc68b6d2..543282422 100644 --- a/code/sdk/drivers/peripheral/config/include/ConfigModel.h +++ b/code/sdk/drivers/peripheral/config/include/ConfigModel.h @@ -275,7 +275,7 @@ namespace OHOS configmodel_item configmodel_item_key_name[CONFIGMODEL_ITEM_MAX] = { {ConfigDataType::DATATYPE_BOOL, "classicbt_service_on", "true" },// CONFIGMODEL_ITEM_CLASSIC_BT_SERVICE_ON, //关机前经典蓝牙服务状态,启动时仍然恢复其当时状态 - {ConfigDataType::DATATYPE_INT, "screen_brightness", "255" },//CONFIGMODEL_ITEM_SCREEN_BRIGHTNESS_VALUE, //屏幕亮度 + {ConfigDataType::DATATYPE_INT, "screen_brightness", "204" },//CONFIGMODEL_ITEM_SCREEN_BRIGHTNESS_VALUE, //屏幕亮度 {ConfigDataType::DATATYPE_INT, "screenoff_timeout_value", "5000" },//CONFIGMODEL_ITEM_SCREEN_OFF_TIMEOUT_VALUE, //屏幕自动息屏时间 默认 5秒 5000ms {ConfigDataType::DATATYPE_BOOL, "cat1_service_on", "false" },//CONFIGMODEL_ITEM_CAT1_SERVICE_ON, // 关机前Cat1 Service启动着,则重启仍然启动,反之亦然 {ConfigDataType::DATATYPE_STRING, "cat1_imei", "" },//CONFIGMODEL_ITEM_CAT1_IMEI, diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 11efc91e3..e5814b9a9 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -616,17 +616,20 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { if ((int)sensorEVT->fData[1] == 2) { #if defined(SUPPORT_POWER_MANAGER) - display_api->set_screen_set_keepon_timeout(0); + //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) { + 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); + // display_api->set_screen_set_keepon_timeout(0); + // display_api->set_screen_set_keepon_timeout(1000); + // uapi_setScreenDuration(1000); #endif } break; diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index ae59e87ac..85c6042c3 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -312,6 +312,7 @@ void startup_post_init_task(void) power_off_cat1(); } uapi_gei_btmac_and_chipinfo(); + uapi_func_lcd_on(); } void startup_post_init(void) @@ -2335,3 +2336,14 @@ void uapi_gei_btmac_and_chipinfo(void) wstp_print("^^^^ BTMAC=%s ^^^^ CyweeChipInfo=%s\n",btaddr_str,chipinfo); } + +static void func_button_callback_press(void) +{ + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + display_api->turn_on_screen(); +} + +void uapi_func_lcd_on(void) +{ + uapi_button_register_event_cb(func_button_callback_press, 24); +} \ No newline at end of file diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 27f9a39c5..588f10166 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -228,7 +228,7 @@ void uapi_factorytest_hide_test_tp_button(void); void uapi_efuse_test_write(uint8_t *data,uint32_t byte_number,uint8_t len); void uapi_efuse_test_read(uint32_t byte_number,uint8_t len); void uapi_gei_btmac_and_chipinfo(void); - +void uapi_func_lcd_on(void); #include "custom_utilscpp.h" -- 2.17.1