关闭放腕灭屏,修改屏幕亮度为百分之80,增加func键点亮屏幕功能。 499/target/2 508/1 508/head
authorpenglei <1624952103@qq.com>
Thu, 11 Jul 2024 13:03:04 +0000 (21:03 +0800)
committerpenglei <1624952103@qq.com>
Thu, 11 Jul 2024 13:03:04 +0000 (21:03 +0800)
code/sdk/drivers/peripheral/config/include/ConfigModel.h
code/sdk/drivers/peripheral/cywee/src/main_dml.c
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index cbc68b6..5432824 100644 (file)
@@ -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,
index 11efc91..e5814b9 100644 (file)
@@ -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;
index ae59e87..85c6042 100644 (file)
@@ -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
index 27f9a39..588f101 100644 (file)
@@ -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"