Browse Source

取大的功率来显示在电量数据接口上,功率范围为0~60W,显示范围0~100%,按比例转换

robbin 1 month ago
parent
commit
774f441e62

+ 17 - 1
thirdparty/lib/aem/adapter/peripheral/aem_adapter_dev.c

@@ -105,11 +105,27 @@ static int get_bt_mac_addr(uint8_t *mac, uint8_t len)
     return ret;
 }
 
+#ifndef CONFIG_SIMULATOR
+extern float f_Power[2];
+#endif
 static uint8_t get_battery_percentage(void)
 {
     int percentage = 0;
 #ifndef CONFIG_SIMULATOR
-    percentage = power_manager_get_battery_capacity();
+    //取大的功率来显示,功率范围为0~60W,显示范围0~100%,按比例转换
+    if (f_Power[0] >= f_Power[1])  
+    {
+        percentage = (int)(f_Power[0] * 100.0 / 60.0);
+    }
+    else
+    {
+        percentage = (int)(f_Power[1] * 100.0 / 60.0);
+    }
+
+    if (percentage > 100)
+    {
+        percentage = 100;
+    }
 
     if (percentage < 0)
     {

+ 1 - 1
thirdparty/lib/aem/config/aem_project.h

@@ -4,7 +4,7 @@
 #pragma warning(error : 4013)
 #endif
 #define AEM_VERSION "BL_Develop_NOR"
-#define BUILD_TIME "202502192050"
+#define BUILD_TIME "202502251700"
 #define AEM_GUI_FWK_LIB_VER "2.0.0.0"
 #define APP_DOWNLOAD_URL "https://customer.com"
 #define AEM_APP_TRANS_ANIMATION 1