修复更新电池获取函数造成的编译问题 1618/1 1618/head 1619/target/1
authorSnickerSun <snickersun@163.com>
Thu, 9 Jan 2025 14:05:27 +0000 (22:05 +0800)
committerSnickerSun <snickersun@163.com>
Thu, 9 Jan 2025 14:05:27 +0000 (22:05 +0800)
16 files changed:
code/sdk/application/wearable/fd230/nativeapp/nativeui/clock/src/MainClockView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/PullUpDownView.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressView.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/system/src/SystemView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp
code/sdk/application/wearable/fd230/service/msg_center/src/notify/charge_notification.cpp
code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp
code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp
code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/MainClockView.cpp
code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/PullUpDownView.cpp

index 1148985..27da2c4 100644 (file)
@@ -31,8 +31,7 @@
 #include <sys/stat.h>
 #include <time.h>
 #include <unistd.h>
-extern uint8_t battery_get_voltage(float *voltage);
-
+#include "battery_hal.h"
 #define TIMEVIEW_UP 0
 #define TIMEVIEW_DOWN 1
 #define SECONDTEST 0
index 61e7199..6cbdb8a 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-04-17 15:26:49
- * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-30 18:27:12
+ * @LastEditors: SnickerSun snickersun@163.com
+ * @LastEditTime: 2025-01-09 21:50:24
  * @FilePath: /FD230/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/PullUpDownView.h
  */
 
@@ -25,8 +25,6 @@
 #include "main/include/dropdown/DropDownCardPage1.h"
 #include "main/include/dropdown/DropDownCardPage2.h"
 
-extern uint8_t battery_get_voltage(float *voltage);
-
 namespace OHOS
 {
     static constexpr int16_t SETTING_INDEX = 0;
index 7fdcceb..073b44c 100644 (file)
@@ -36,6 +36,7 @@
 #include "MainModel.h"
 #include "../../../../../../../zhihui/utils/custom_runtime.h"
 #include "rebootandshutdown/include/RebootAndShutdownModelC.h"
+#include "battery_hal.h"
 
 #if USE_OFFLINE_DIAL
 #include "DialViewGroup.h"
index 746c514..b6a75df 100644 (file)
@@ -2,8 +2,6 @@
 #include "battery_hal.h"
 #include "wearable_log.h"
 
-extern uint8_t battery_get_voltage(float *voltage);
-
 // 定义电量宏
 #define BATTERY_LOW_THRESHOLD 10
 #define BATTERY_MEDIUM_THRESHOLD 20
index c529721..bdc364a 100644 (file)
@@ -25,7 +25,6 @@
 #include <string>
 #include "battery_hal.h"
 #include "wearable_log.h"
-extern uint8_t battery_get_voltage(float *voltage);
 
 REGIST_DIAL_MODULE(DialDataType::DATA_TYPE_POWER, OHOS::DialModelPower::GetInstance());
 
index 8e5ce04..89e4e69 100644 (file)
@@ -6,7 +6,7 @@
 #include "battery_hal.h"
 #include "wearable_log.h"
 #include <string>
-extern uint8_t battery_get_voltage(float *voltage);
+#include "battery_hal.h"
 
 REGIST_DIAL_MODULE(DialDataType::DATA_TYPE_POWER_MAPPER,
                    OHOS::DialModelPowerMapper::GetInstance());
index 346ff9c..05879ff 100644 (file)
@@ -6,8 +6,8 @@
 #include "battery_hal.h"
 #include "wearable_log.h"
 #include <string>
+#include "battery_hal.h"
 
-extern uint8_t battery_get_voltage(float *voltage);
 
 REGIST_DIAL_MODULE(DialDataType::DATA_TYPE_POWER_STANDBY,
                    OHOS::DialModelPowerStanby::GetInstance());
index 2284ccf..cc6823d 100644 (file)
@@ -4,7 +4,7 @@
 #include "bleService.h"\r
 #include "battery_hal.h"\r
 #include "ui_resource_string.h"\r
-extern uint8_t battery_get_voltage(float *voltage);\r
+\r
 #include "systemupdate/include/SystemUpdateModel.h"\r
 namespace OHOS\r
 {\r
index 1d62ee8..61f7880 100644 (file)
@@ -63,8 +63,7 @@ namespace OHOS
     {
 #include "build_version.h"
 #include "battery_hal.h"
-        extern uint8_t battery_get_voltage(float *voltage);
-        const char *get_version_string(void);
+
     }
 
     bool WatchQRCodeView::WatchQRCodeInitViewGroup(void)
index a6b2cb8..a3d1d56 100644 (file)
@@ -12,6 +12,7 @@
 #include "ui_resource_image.h"
 #include "common/image_cache_manager.h"
 #include <ctime>
+#include "battery_hal.h"
 #include "custom_utils.h"
 namespace OHOS {
 static MainClockView *g_pMainClockView = nullptr;
@@ -152,8 +153,8 @@ bool MainClockView::InitLabelView(void)
         return false;
     }
     batteryLabel->SetPosition(BATTERYP_LABEL_X, BATTERYP_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);
-    uint8_t power=90;
-    battery_getvolpower(&power);
+    float voltage = 0.0F;  
+    int power = battery_get_voltage(&voltage);  
     char tmp[16]={0};
     sprintf(tmp,"%d%c",power,'%');
     batteryLabel->SetText(tmp);
index 1a6ed80..5ea317d 100644 (file)
@@ -13,6 +13,7 @@
 #include "ScreenModels.h"
 #include "SettingModel.h"
 #include "ui_resource_image.h"
+#include "battery_hal.h"
 #include "custom_utils.h"
 
 namespace OHOS {
@@ -261,8 +262,8 @@ void PullUpDownView::InitViewInfo(void)
         return;
     }
     batteryLable->SetPosition(BATTERY_LABEL_X, BATTERY_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);
-    uint8_t power=90;
-    battery_getvolpower(&power);
+    float voltage = 0.0F;  
+    int power = battery_get_voltage(&voltage);
     char tmp[16]={0};
     sprintf(tmp,"%d%c",power,'%');
     batteryLable->SetText(tmp);
index 9280d63..1ee54c4 100644 (file)
@@ -17,6 +17,7 @@
 #include "components/ui_label.h"\r
 #include "common/image_cache_manager.h"\r
 #include "MainClockView.h"\r
+#include "battery_hal.h"\r
 #include "custom_utils.h"\r
 \r
 namespace OHOS {\r
@@ -153,8 +154,8 @@ bool MainClockView::InitLabelView(void)
         return false;\r
     }\r
     batteryLabel->SetPosition(BATTERYP_LABEL_X, BATTERYP_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);\r
-    uint8_t power=90;\r
-    battery_getvolpower(&power);\r
+    float voltage = 0.0F;  \r
+    int power = battery_get_voltage(&voltage);  \r
     char tmp[16]={0};\r
     sprintf(tmp,"%d%c",power,'%');\r
     batteryLabel->SetText(tmp);\r
index be9e101..c005c4a 100644 (file)
@@ -19,6 +19,7 @@
 #include "ScreenModel.h"\r
 #include "ui_resource_image.h"\r
 #include "common/image_cache_manager.h"\r
+#include "battery_hal.h"\r
 #include "custom_utils.h"\r
 \r
 namespace OHOS {\r
@@ -209,8 +210,8 @@ void PullUpDownView::InitViewInfo(void)
         return;\r
     }\r
     batteryLable->SetPosition(BATTERY_LABEL_X, BATTERY_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);\r
-    uint8_t power=90;\r
-    battery_getvolpower(&power);\r
+    float voltage = 0.0F;  \r
+    int power = battery_get_voltage(&voltage);  \r
     char tmp[16]={0};\r
     sprintf(tmp,"%d%c",power,'%');\r
     batteryLable->SetText(tmp);\r