From 4b7d8d1b9496fd129310a213bed4cd1d6f8fe36e Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Wed, 17 Jan 2024 20:41:43 +0800 Subject: [PATCH] =?utf8?q?=E5=90=8C=E6=AD=A5=E7=94=B5=E9=87=8F=E6=9C=8D?= =?utf8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../brandy/brandy_standard/thread_pri_init.c | 11 +++++++++++ .../power_manager/src/actions/display_action.c | 11 ++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/code/sdk/application/brandy/brandy_standard/thread_pri_init.c b/code/sdk/application/brandy/brandy_standard/thread_pri_init.c index db20da269..df411ad5d 100755 --- a/code/sdk/application/brandy/brandy_standard/thread_pri_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_pri_init.c @@ -52,6 +52,10 @@ #include "ohosfwk_startup.h" #endif +#ifdef SUPPORT_BATTERY_SERVICE +#include "battery_service.h" +#endif + #define EMMC_BASE_ADDR 0x52062000 #define TASK_PRIORITY_APP (osPriority_t)(17) #define TICK_TEN_MS (10U) @@ -242,6 +246,8 @@ static void thread_main(const void *unused) uapi_pm_control(PM_DISPLAY_POWER_OFF); #endif + + #if DSP_EXIST == YES audio_init(); #endif @@ -261,6 +267,11 @@ static void thread_main(const void *unused) ohos_startup(); #endif uapi_pm_remove_sleep_veto(PM_ID_DEBUG); + + +#ifdef SUPPORT_BATTERY_SERVICE + uapi_battery_init(); +#endif set_startup_finish_flag(); } diff --git a/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c b/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c index d23e4c4c4..a47b18d6b 100755 --- a/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c +++ b/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c @@ -20,7 +20,9 @@ #include "pm_lp_stub.h" #include "hal_pmu_ldo.h" #include "cmsis_os2.h" - +#ifdef SUPPORT_BATTERY_SERVICE +#include "battery_service.h" +#endif #ifdef CONFIG_LOW_POWER_TEST static bool g_pms_dpu_ready = false; #else @@ -105,6 +107,9 @@ static uint32_t action_display_lcd_on() return ERRCODE_FAIL; } } +#ifdef SUPPORT_BATTERY_SERVICE + battery_service_resume(); +#endif #if defined(ENABLE_UIKIT) || defined(ENABLE_LVGL) NotifyScreenOn(); // Instruct the uikit to start the display operation. #endif @@ -158,6 +163,10 @@ static uint32_t action_display_lcd_off() lcd_set_status(false); g_pms_dpu_ready = false; display_suspend_power_off(); + + #ifdef SUPPORT_BATTERY_SERVICE + battery_service_suspend(); + #endif uapi_pm_request_mode(PM_ID_VIDEO, PM_MODE_LP); return ERRCODE_SUCC; } -- 2.17.1