From: Caisking <3449750381@qq.com> Date: Wed, 17 Jan 2024 12:41:43 +0000 (+0800) Subject: 同步电量服务 X-Git-Tag: release_V1.2.70_20241020_135402~1369 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=4b7d8d1b9496fd129310a213bed4cd1d6f8fe36e;p=mirrors%2FFD230.git 同步电量服务 --- 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; }