UI同步省电模式接口
authorCaisking <3449750381@qq.com>
Fri, 10 May 2024 03:00:38 +0000 (11:00 +0800)
committerCaisking <3449750381@qq.com>
Fri, 10 May 2024 03:00:38 +0000 (11:00 +0800)
code/sdk/application/wearable/fd230app/CMakeLists.txt
code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index 4af701a..bdf9bf9 100644 (file)
@@ -109,6 +109,7 @@ set(PRIVATE_HEADER
 
     ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include
     ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/cywee/
+    ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/utils/
     ${ROOT_DIR}/open_source/openharmony/foundation/distributedschedule/samgr_lite/interfaces/kits/samgr
 
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/include/dial
index b9ed277..229ca20 100644 (file)
 #include <thread>\r
 #include "battery_hal.h"\r
 #include "string"\r
+#include "custom_utils.h"\r
+\r
+extern "C"\r
+{\r
+    void uapi_exit_power_saving_mode(void);\r
+    void uapi_enter_power_saving_mode(void);\r
+}\r
+\r
 namespace OHOS\r
 {\r
     static SaveBatView *g_pSaveBatView{nullptr};\r
@@ -34,11 +42,15 @@ namespace OHOS
     }\r
     SaveBatView::SaveBatView()\r
     {\r
+        /*开启省电模式*/\r
+        uapi_enter_power_saving_mode();\r
         g_pSaveBatView = this;\r
     }\r
 \r
     SaveBatView::~SaveBatView()\r
     {\r
+        /*关闭省电模式*/\r
+        uapi_exit_power_saving_mode();\r
         DeInit();\r
         g_pSaveBatView = nullptr;\r
     }\r
index 4162387..12219fb 100644 (file)
@@ -1697,6 +1697,7 @@ uint32_t custom_i2c_resume(void)
     return 0;
 }
 
+/*省电模式*/
 void uapi_enter_power_saving_mode(void)
 {
     PRINT("Enter Power Saving Mode !!! \r\n");
index c809038..66d685a 100644 (file)
@@ -166,6 +166,9 @@ void uapi_get_sleeping_data(void);
 void cywee_get_id(void);
 int custom_exit_lpm(void);
 
+void uapi_exit_power_saving_mode(void);
+void uapi_enter_power_saving_mode(void);
+
 
 #ifdef __cplusplus
 }