From: Caisking Date: Tue, 29 Jul 2025 08:32:33 +0000 (+0800) Subject: 增加SUPPORT_BATTERY_SERVICE的电量宏 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~207^2~3 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=8e2b7005941c5f7a0cb43b7cdac99db538a14e9e;p=mirrors%2FFD230.git 增加SUPPORT_BATTERY_SERVICE的电量宏 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativelauncher/src/NativeLauncher.cpp index 7166adcec..a0aebb04a 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativelauncher/src/NativeLauncher.cpp @@ -45,12 +45,14 @@ #include "takephotos/include/TakephotosModel.h" #include "message/include/MessageModel.h" #include "assistant/include/AssistantModel.h" -#include "battery_hal.h" #include "main/include/dial/DialModelCharge.h" #include "schedule/include/ScheduleModel.h" #include "sleep/include/SleepModel.h" #include "main/include/MainModel.h" +#ifdef SUPPORT_BATTERY_SERVICE +#include "battery_hal.h" +#endif namespace OHOS { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp index dfcaccc3f..ec9de2b13 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp @@ -14,7 +14,11 @@ #include "NativeRegisterManager.h" #include "health/health_service/health_service.h" + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif + #include "ConfigModelC.h" #include "ConfigModel.h" #include diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/bloodoxygen/src/BloodOxygenModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/bloodoxygen/src/BloodOxygenModel.cpp index b0fdf85aa..fade8e5ca 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/bloodoxygen/src/BloodOxygenModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/bloodoxygen/src/BloodOxygenModel.cpp @@ -18,9 +18,12 @@ #include "ConfigModel.h" #include "MainViewSample.h" #include "NativeAbility.h" + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" -#include "health/BloodCardView.h" +#endif +#include "health/BloodCardView.h" #include #define MAX_UNWARE_COUNT 10 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/health/CheckAbnormalPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/health/CheckAbnormalPresenter.cpp index 63c1caed5..eefee4145 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/health/CheckAbnormalPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/health/CheckAbnormalPresenter.cpp @@ -53,7 +53,9 @@ #include "MainModel.h" #include "health/health_service/health_service.h" +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif #include "NativeRegisterManager.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/include/HeartResultPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/include/HeartResultPresenter.h index a6d87c58b..85a70c3fd 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/include/HeartResultPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/include/HeartResultPresenter.h @@ -16,8 +16,9 @@ #include "KeyInputListener.h" #include "common/key_code.h" +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" - +#endif #include "heartrate/include/HeartResultView.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp index 110b97205..c7dd5c20f 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp @@ -51,7 +51,9 @@ #include #include +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif #include "languagecode/LanguageInit.h" #include "ui_service.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartResultPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartResultPresenter.cpp index 286978346..ae10d7e3b 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartResultPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartResultPresenter.cpp @@ -43,7 +43,9 @@ #include "cywee_service.h" #endif +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif #include "health/health_service/health_service.h" #include "NativeRegisterManager.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp index 355d8adb0..8cc19ea75 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -56,7 +56,6 @@ extern "C" { #ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" -extern uint8_t battery_get_voltage(float *voltage); #endif } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressModel.cpp index 6b818c086..90709b3ef 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressModel.cpp @@ -2,8 +2,9 @@ #include "DialBoxProgressView.h" #include "wearable_log.h" +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" -extern uint8_t battery_get_voltage(float *voltage); +#endif // 定义电量宏 #define BATTERY_LOW_THRESHOLD 10 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPower.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPower.cpp index 057afe7c3..0c7a1fc90 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPower.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPower.cpp @@ -25,8 +25,9 @@ #include #include "wearable_log.h" +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" -extern uint8_t battery_get_voltage(float *voltage); +#endif REGIST_DIAL_MODULE(OHOS::DialDataType::BATTERY, OHOS::DialModelPower::GetInstance()); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerMapper.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerMapper.cpp index 7a11c7aa6..d820279f6 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerMapper.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerMapper.cpp @@ -6,8 +6,9 @@ #include "wearable_log.h" #include +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" -extern uint8_t battery_get_voltage(float *voltage); +#endif REGIST_DIAL_MODULE(OHOS::DialDataType::BATTERY_LEVEL, OHOS::DialModelPowerMapper::GetInstance()); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStandby.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStandby.cpp index ca5313932..3b66709c2 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStandby.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStandby.cpp @@ -8,8 +8,9 @@ #include "wearable_log.h" #include +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" -extern uint8_t battery_get_voltage(float *voltage); +#endif REGIST_DIAL_MODULE(OHOS::DialDataType::POWER_STANDBY, OHOS::DialModelPowerStanby::GetInstance()); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStr.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStr.cpp index 93a336f23..45a9b52a0 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStr.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStr.cpp @@ -1,8 +1,10 @@ #include "main/include/dial/DialModelPowerStr.h" #include "main/include/dial/RegisterDialModel.h" #include "wearable_log.h" + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" -extern uint8_t battery_get_voltage(float *voltage); +#endif namespace OHOS { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/safemodemanager/src/SafeModeManagerModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/safemodemanager/src/SafeModeManagerModel.cpp index bc7cfd691..5b82d5039 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/safemodemanager/src/SafeModeManagerModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/safemodemanager/src/SafeModeManagerModel.cpp @@ -33,13 +33,17 @@ #include #include + +#ifdef SUPPORT_BATTERY_SERVICE +#include "battery_hal.h" +#endif + extern "C" { // #include "build_version.h" // const char *get_version_string(void); -#include "battery_hal.h" + #include "build_version.h" -extern uint8_t battery_get_voltage(float *voltage); // const char *get_version_string(void); bool resfile_checksum_thread(void); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatPresenter.cpp index c8594f125..8801970e5 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatPresenter.cpp @@ -5,7 +5,12 @@ #include "NativeAbility.h" #include "common/key_code.h" #include "cmsis_os.h" + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif + + #include "custom_utils.h" #include "saveele/include/SaveBatPresenter.h" #include "saveele/include/SaveBatView.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatView.cpp index 63f34ba17..0a114c86a 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatView.cpp @@ -10,7 +10,12 @@ #include #include #include + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif + + #include "string" #include "custom_utils.h" #include "UiConfig.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemView.cpp index 9e5796db9..fef71bb39 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemView.cpp @@ -7,7 +7,9 @@ #include "bleService.h" #endif +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif #include "UiConfig.h" diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/charge_notification.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/charge_notification.cpp index f808c4f25..c3777b6d7 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/charge_notification.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/charge_notification.cpp @@ -12,7 +12,11 @@ #include "cmsis_os2.h" #include "linux/delay.h" #include "components/ui_circle_progress.h" + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif + #include "uicomponents/UIComponents.h" #include "charge_notification.h" diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index 5588afcba..7b7e021c6 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -57,8 +57,12 @@ #include "bleInstruct.h" #endif +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" #include "battery_service.h" +#endif + + #ifdef SUPPORT_CAT1_SERVICE #include "cat1_tcpServer.h" diff --git a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp index 9d7780fea..0bfe78f2d 100644 --- a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp @@ -3,7 +3,11 @@ #include "producttest/include/testPresenter.h" #include "producttest/include/testchanging.h" #include "producttest/include/testchangingC.h" + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif + #include "producttest/include/testView.h" #include "cmsis_os2.h" #ifdef __cplusplus diff --git a/code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c b/code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c index dd1a780d9..918c841ce 100644 --- a/code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c +++ b/code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c @@ -16,7 +16,11 @@ #include "sys/time.h" #include "time.h" #include "ConfigModelC.h" + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif + #include "custom_save_runtime.h" #include "cywee_data.h" #include "cywee_dml.h" diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c b/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c index 7faafd8f6..830ccfece 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c @@ -24,7 +24,9 @@ #include "bts_le_gap.h" #include "bts_br_gap.h" +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif #include "bleService.h" #include "alipay_feature.h" diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c index 54b409788..a36f36205 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c @@ -23,7 +23,9 @@ extern "C" { #include "stdbool.h" #include "bts_br_gap.h" +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif #include "bleService.h" #include "alipay_feature.h" diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleService.c b/code/sdk/zhihui/services/ble_service/bleservice/bleService.c index a9dc4afdb..e3e9c03d9 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleService.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleService.c @@ -25,7 +25,11 @@ extern "C" { #include "bts_le_gap.h" #include "bts_br_gap.h" + +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif + #include "bleService.h" #include "alipay_feature.h" #ifdef AILPAY_SUPPORT diff --git a/code/sdk/zhihui/utils/custom_utils_at_cmd.c b/code/sdk/zhihui/utils/custom_utils_at_cmd.c index 2d33254ba..7958ec461 100644 --- a/code/sdk/zhihui/utils/custom_utils_at_cmd.c +++ b/code/sdk/zhihui/utils/custom_utils_at_cmd.c @@ -16,10 +16,14 @@ // #include "message_notification.h" // #include "MessageModel.h" #include "system/include/SystemLogModelC.h" -#ifdef FD230_650 -#include "PhoneServiceC.h" +#ifdef SUPPORT_BATTERY_SERVICE #include "battery_hal.h" +#endif + + +#ifdef FD230_650 +#include "PhoneServiceC.h" #include "Bluetooyhpabpserver.h"