增加SUPPORT_BATTERY_SERVICE的电量宏
authorCaisking <Casiking@zhihuishixun.com>
Tue, 29 Jul 2025 08:32:33 +0000 (16:32 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Tue, 29 Jul 2025 08:32:33 +0000 (16:32 +0800)
25 files changed:
code/sdk/application/wearable/fd230/nativeapp/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/bloodoxygen/src/BloodOxygenModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/health/CheckAbnormalPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/include/HeartResultPresenter.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartResultPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPower.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerMapper.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStandby.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStr.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/safemodemanager/src/SafeModeManagerModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/saveele/src/SaveBatView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemView.cpp
code/sdk/application/wearable/fd230/service/msg_center/src/notify/charge_notification.cpp
code/sdk/application/wearable/fd230/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp
code/sdk/zhihui/UI/producttest/src/testchanging.cpp
code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c
code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c
code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c
code/sdk/zhihui/services/ble_service/bleservice/bleService.c
code/sdk/zhihui/utils/custom_utils_at_cmd.c

index 7166adc..a0aebb0 100644 (file)
 #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 {
 
index dfcaccc..ec9de2b 100644 (file)
 #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 <custom_utils.h>
index b0fdf85..fade8e5 100644 (file)
 #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 <custom_save_runtime.h>
 
 #define MAX_UNWARE_COUNT 10
index 63c1cae..eefee41 100644 (file)
@@ -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"
 
index 110b972..c7dd5c2 100644 (file)
@@ -51,7 +51,9 @@
 #include <sys/stat.h>\r
 #include <unistd.h>\r
 \r
+#ifdef SUPPORT_BATTERY_SERVICE\r
 #include "battery_hal.h"\r
+#endif\r
 \r
 #include "languagecode/LanguageInit.h"\r
 #include "ui_service.h"\r
index 6b818c0..90709b3 100644 (file)
@@ -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
index 057afe7..0c7a1fc 100644 (file)
@@ -25,8 +25,9 @@
 #include <string>
 #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());
 
index 7a11c7a..d820279 100644 (file)
@@ -6,8 +6,9 @@
 #include "wearable_log.h"
 #include <string>
 
+#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());
index ca53139..3b66709 100644 (file)
@@ -8,8 +8,9 @@
 #include "wearable_log.h"
 #include <string>
 
+#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());
index 93a336f..45a9b52 100644 (file)
@@ -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
 {
index bc7cfd6..5b82d50 100644 (file)
 #include <sstream> 
 #include <string>  
 
+
+#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);
index c8594f1..8801970 100644 (file)
@@ -5,7 +5,12 @@
 #include "NativeAbility.h"\r
 #include "common/key_code.h"\r
 #include "cmsis_os.h"\r
+\r
+#ifdef SUPPORT_BATTERY_SERVICE\r
 #include "battery_hal.h"\r
+#endif\r
+\r
+\r
 #include "custom_utils.h"\r
 #include "saveele/include/SaveBatPresenter.h"\r
 #include "saveele/include/SaveBatView.h"\r
index 63f34ba..0a114c8 100644 (file)
 #include <iostream>\r
 #include <chrono>\r
 #include <thread>\r
+\r
+#ifdef SUPPORT_BATTERY_SERVICE\r
 #include "battery_hal.h"\r
+#endif\r
+\r
+\r
 #include "string"\r
 #include "custom_utils.h"\r
 #include "UiConfig.h"\r
index f808c4f..c3777b6 100644 (file)
 #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"
 
index 9d7780f..0bfe78f 100644 (file)
@@ -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
index dd1a780..918c841 100644 (file)
 #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"
index 7faafd8..830ccfe 100644 (file)
@@ -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"
index 54b4097..a36f362 100644 (file)
@@ -23,7 +23,9 @@ extern "C" {
 #include "stdbool.h"\r
 #include "bts_br_gap.h"\r
 \r
+#ifdef SUPPORT_BATTERY_SERVICE\r
 #include "battery_hal.h"\r
+#endif\r
 \r
 #include "bleService.h"\r
 #include "alipay_feature.h"\r
index a9dc4af..e3e9c03 100644 (file)
@@ -25,7 +25,11 @@ extern "C" {
 \r
 #include "bts_le_gap.h"\r
 #include "bts_br_gap.h"\r
+\r
+#ifdef SUPPORT_BATTERY_SERVICE\r
 #include "battery_hal.h"\r
+#endif\r
+\r
 #include "bleService.h"\r
 #include "alipay_feature.h"\r
 #ifdef AILPAY_SUPPORT\r
index 2d33254..7958ec4 100644 (file)
 // #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"