瀏覽代碼

1、调整功耗显示界面,功耗设置的CALIBRATION_REGISTER计算方式为CALIBRATION_REGISTER = 0.00512/(0.001*0.028),目前用的电阻R是28mΩ左右,然后根据实际电流的大小情况微调CALIBRATION_REGISTER
2、功耗的显示精度调整为3位小数,每500ms更新显示一次
3、蓝牙开关可以控制蓝牙的广播开关(连接新手机的功能待修改完善;连接上蓝牙设备后的提示语待修改完善)
4、在set_time里可以简单设置日期和时间,后续还要继续完善跳转和界面设置
5、系统设置里,只保留蓝牙设置(后续需删除)、系统操作、关于设备这三项功能
6、蓝牙名称修改为Catsights_Mac地址后4位
7、增加CONFIG_BT_FCC_TEST开关,默认关闭,要进行FCC测试时打开此开关
8、更换开机logo和无操作一段时间后跳转界面的Logo

mohliy 3 月之前
父節點
當前提交
c55afdfd48
共有 22 個文件被更改,包括 318 次插入128 次删除
  1. 二進制
      application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.res
  2. 二進制
      application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.sty
  3. 1 0
      application/aem_watch/prj.conf
  4. 7 6
      application/aem_watch/resource/360x360/bt_watch.ui
  5. 二進制
      application/aem_watch/resource/360x360/logo/catsights_logo.png
  6. 二進制
      application/aem_watch/resource/360x360/logo/catsights_white.png
  7. 10 10
      application/aem_watch/resource/360x360/res_style_bitmap.c
  8. 60 26
      application/aem_watch/src/application/in_out_power/aem_in_out_power_screen.c
  9. 1 1
      application/aem_watch/src/application/in_out_power/aem_widget_in_out_power.c
  10. 21 0
      application/aem_watch/src/application/power_onoff/aem_power.c
  11. 23 13
      application/aem_watch/src/application/profile_photo/aem_profile_photo_screen.c
  12. 1 1
      application/aem_watch/src/application/profile_photo/aem_widget_profile_photo.c
  13. 1 0
      application/aem_watch/src/application/quick_settings/aem_quick_setting_alarm.c
  14. 13 0
      application/aem_watch/src/application/settings/aem_bluetooth.c
  15. 13 0
      application/aem_watch/src/application/settings/aem_set_time.c
  16. 29 29
      application/aem_watch/src/application/settings/aem_settings.c
  17. 3 3
      framework/bluetooth/bt_manager/bt_manager.c
  18. 5 5
      framework/bluetooth/bt_manager/bt_manager_check_mac_name.c
  19. 4 4
      framework/bluetooth/bt_manager/bt_manager_connect.c
  20. 4 6
      thirdparty/lib/aem/adapter/def_settings/aem_adapter_def_settings.c
  21. 94 17
      zephyr/drivers/input/sd8563_timer_acts.c
  22. 28 7
      zephyr/drivers/input/sgm832a_acts.c

二進制
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.res


二進制
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.sty


+ 1 - 0
application/aem_watch/prj.conf

@@ -224,6 +224,7 @@ CONFIG_BT_HCI_ACTS=y
 CONFIG_BT_CTRL_DEBUG=n
 CONFIG_BT_CTRL_LOG=y
 CONFIG_BT_CTRL_BQB=y
+CONFIG_BT_FCC_TEST=n
 CONFIG_BT_CTRL_RF_DEBUG=n
 CONFIG_BT_HCI_TX_PRINT=n
 CONFIG_BT_HCI_RX_PRINT=n

+ 7 - 6
application/aem_watch/resource/360x360/bt_watch.ui

@@ -21498,14 +21498,14 @@
                 <property name="id" value="32947" />
                 <property name="x" value="0x0000" />
                 <property name="y" value="0x0000" />
-                <property name="width" value="0x00be" />
-                <property name="height" value="0x0050" />
+                <property name="width" value="0x01d2" />
+                <property name="height" value="0x014a" />
                 <property name="visible" value="0x0011" />
                 <property name="compress" value="0x0000" />
                 <property name="PNG_A8" value="0x0000" />
                 <property name="ARGB" value="0x0000" />
                 <element class="layer">
-                    <property name="0" value=".\logo\logo.png" />
+                    <property name="0" value=".\logo\catsights_logo.png" />
                 </element>
             </element>
         </element>
@@ -21688,13 +21688,13 @@
                 <property name="x" value="0x0000" />
                 <property name="y" value="0x0000" />
                 <property name="width" value="0x0168" />
-                <property name="height" value="0x0168" />
+                <property name="height" value="0x00fd" />
                 <property name="visible" value="0x0011" />
                 <property name="compress" value="0x0000" />
                 <property name="PNG_A8" value="0x0000" />
                 <property name="ARGB" value="0x0000" />
                 <element class="layer">
-                    <property name="0" value=".\logo\app_logo.png" />
+                    <property name="0" value=".\logo\catsights_white.png" />
                 </element>
             </element>
         </element>
@@ -22467,8 +22467,9 @@
         <picture value=".\quick_settings\连接.png" />
         <picture value=".\logo\app_logo.png" />
         <picture value=".\settings\bluetooth\连接新手机.png" />
+        <picture value=".\logo\catsights_white.png" />
+        <picture value=".\logo\catsights_logo.png" />
         <txt value="..\multilang_translate_table.xls" />
-        <txt value="..\multiLang_translate_table.xls" />
         <string value="key_setupwizard_language" />
         <string value="key_setupwizard_download_app" />
         <string value="key_setupwizard_scan_download" />

二進制
application/aem_watch/resource/360x360/logo/catsights_logo.png


二進制
application/aem_watch/resource/360x360/logo/catsights_white.png


+ 10 - 10
application/aem_watch/resource/360x360/res_style_bitmap.c

@@ -18855,12 +18855,12 @@ const sty_picture_t PIC_SCENE_POWER_PIC_BOOT_LOGO = {
  					.id = 666, 
  					.x = 0, 
  					.y = 0, 
- 					.width = 190, 
- 					.height = 80, 
+ 					.width = 466, 
+ 					.height = 330, 
  					.bytes_per_pixel = 4, 
  					.format = 3, 
  					.bmp_pos = 2918428, 
- 					.compress_size = 1631, 
+ 					.compress_size = 5864, 
  					.magic = (uint32_t)&res_info, 
  				}; 
 resource_bitmap_t BITMAP_SCENE_POWER_PIC_BOOT_LOGO = { 
@@ -18871,8 +18871,8 @@ const lv_img_dsc_t IMG_SCENE_POWER_PIC_BOOT_LOGO = {
  					.data_size = 12, 
  					.data = (uint8_t*)&BITMAP_SCENE_POWER_PIC_BOOT_LOGO, 
  					.header = { 
- 						.w = 190,
- 						.h = 80, 
+ 						.w = 466,
+ 						.h = 330, 
  						.cf = LV_IMG_CF_RAW_ALPHA, 
  						.always_zero = 0,}, 
  				}; 
@@ -18887,7 +18887,7 @@ const sty_picture_t PIC_SCENE_NINI_CHARGER_PIC_MINI_CHAR_BG = {
  					.height = 90, 
  					.bytes_per_pixel = 2, 
  					.format = 0, 
- 					.bmp_pos = 2920064, 
+ 					.bmp_pos = 2924296, 
  					.compress_size = 2085, 
  					.magic = (uint32_t)&res_info, 
  				}; 
@@ -18912,11 +18912,11 @@ const sty_picture_t PIC_SCENE_SHOW_LOGO_PIC_APP_LOGO = {
  					.x = 0, 
  					.y = 0, 
  					.width = 360, 
- 					.height = 360, 
+ 					.height = 253, 
  					.bytes_per_pixel = 4, 
  					.format = 3, 
- 					.bmp_pos = 2922156, 
- 					.compress_size = 118434, 
+ 					.bmp_pos = 2926388, 
+ 					.compress_size = 9565, 
  					.magic = (uint32_t)&res_info, 
  				}; 
 resource_bitmap_t BITMAP_SCENE_SHOW_LOGO_PIC_APP_LOGO = { 
@@ -18928,7 +18928,7 @@ const lv_img_dsc_t IMG_SCENE_SHOW_LOGO_PIC_APP_LOGO = {
  					.data = (uint8_t*)&BITMAP_SCENE_SHOW_LOGO_PIC_APP_LOGO, 
  					.header = { 
  						.w = 360,
- 						.h = 360, 
+ 						.h = 253, 
  						.cf = LV_IMG_CF_RAW_ALPHA, 
  						.always_zero = 0,}, 
  				}; 

+ 60 - 26
application/aem_watch/src/application/in_out_power/aem_in_out_power_screen.c

@@ -169,9 +169,9 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
     if (in_power_unit_label)
     {
         lv_obj_set_style_text_font(in_power_unit_label, aem_font_sub(), 0);
-        text_canvas_set_text(in_power_unit_label, "mW");
+        text_canvas_set_text(in_power_unit_label, "W");
         lv_obj_set_style_text_color(in_power_unit_label, (lv_color_t)LV_COLOR_BLACK, 0);
-        lv_obj_align(in_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(45), AEM_SIZE_VER_FACTOR_466(18));
+        lv_obj_align(in_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(50), AEM_SIZE_VER_FACTOR_466(18));
     }
 
     lv_obj_t *in_voltage_unit_label = text_canvas_create(in_voltage_item);
@@ -180,29 +180,29 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
         lv_obj_set_style_text_font(in_voltage_unit_label, aem_font_small(), 0);
         text_canvas_set_text(in_voltage_unit_label, "V");
         lv_obj_set_style_text_color(in_voltage_unit_label, (lv_color_t)LV_COLOR_BLUE, 0);
-        lv_obj_align(in_voltage_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(10), AEM_SIZE_VER_FACTOR_466(15));
+        lv_obj_align(in_voltage_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(20), AEM_SIZE_VER_FACTOR_466(15));
     }
 
     lv_obj_t *in_current_unit_label = text_canvas_create(in_current_item);
     if (in_current_unit_label)
     {
         lv_obj_set_style_text_font(in_current_unit_label, aem_font_small(), 0);
-        text_canvas_set_text(in_current_unit_label, "mA");
+        text_canvas_set_text(in_current_unit_label, "A");
         lv_obj_set_style_text_color(in_current_unit_label, (lv_color_t)LV_COLOR_BLUE, 0);
-        lv_obj_align(in_current_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(15), AEM_SIZE_VER_FACTOR_466(15));
+        lv_obj_align(in_current_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(20), AEM_SIZE_VER_FACTOR_466(15));
     }
 
     lv_obj_align(out_power_item, LV_ALIGN_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(-10), AEM_SIZE_VER_FACTOR_466(0));
-    lv_obj_align_to(out_voltage_item, out_power_item, LV_ALIGN_OUT_BOTTOM_MID, AEM_SIZE_HOR_FACTOR_466(5), AEM_SIZE_VER_FACTOR_466(0));
+    lv_obj_align_to(out_voltage_item, out_power_item, LV_ALIGN_OUT_BOTTOM_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
     lv_obj_align_to(out_current_item, out_voltage_item, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
 
     lv_obj_t *out_power_unit_label = text_canvas_create(out_power_item);
     if (out_power_unit_label)
     {
         lv_obj_set_style_text_font(out_power_unit_label, aem_font_sub(), 0);
-        text_canvas_set_text(out_power_unit_label, "mW");
+        text_canvas_set_text(out_power_unit_label, "W");
         lv_obj_set_style_text_color(out_power_unit_label, (lv_color_t)LV_COLOR_BLACK, 0);
-        lv_obj_align(out_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(45), AEM_SIZE_VER_FACTOR_466(18));
+        lv_obj_align(out_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(50), AEM_SIZE_VER_FACTOR_466(18));
     }
 
     lv_obj_t *out_voltage_unit_label = text_canvas_create(out_voltage_item);
@@ -211,16 +211,16 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
         lv_obj_set_style_text_font(out_voltage_unit_label, aem_font_small(), 0);
         text_canvas_set_text(out_voltage_unit_label, "V");
         lv_obj_set_style_text_color(out_voltage_unit_label, (lv_color_t)LV_COLOR_GREEN, 0);
-        lv_obj_align(out_voltage_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(10), AEM_SIZE_VER_FACTOR_466(15));
+        lv_obj_align(out_voltage_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(20), AEM_SIZE_VER_FACTOR_466(15));
     }
 
     lv_obj_t *out_current_unit_label = text_canvas_create(out_current_item);
     if (out_current_unit_label)
     {
         lv_obj_set_style_text_font(out_current_unit_label, aem_font_small(), 0);
-        text_canvas_set_text(out_current_unit_label, "mA");
+        text_canvas_set_text(out_current_unit_label, "A");
         lv_obj_set_style_text_color(out_current_unit_label, (lv_color_t)LV_COLOR_GREEN, 0);
-        lv_obj_align(out_current_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(15), AEM_SIZE_VER_FACTOR_466(15));
+        lv_obj_align(out_current_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(20), AEM_SIZE_VER_FACTOR_466(15));
     }
 
     // Arcs
@@ -311,9 +311,8 @@ void aem_in_out_power_screen_del(lv_obj_t *par)
         lv_obj_set_user_data(par, NULL);
     }
 }
-#define RELEASE_FW_EN 1
 
-#if RELEASE_FW_EN
+#ifndef CONFIG_SIMULATOR
 extern float f_BusVoltage[2];
 extern float f_Power[2];
 extern float f_Current[2];
@@ -322,7 +321,7 @@ void aem_in_out_power_screen_update(lv_obj_t *par)
 {
     in_out_power_scr_ui_data_t *power_volt_cur_data = lv_obj_get_user_data(par);
 
-#if (RELEASE_FW_EN == 0)
+#ifdef CONFIG_SIMULATOR
     float f_Power[2] = {10.0, 12.0};
     float f_BusVoltage[2] = {5.00, 4.00};
     float f_Current[2] = {2.00, 3.00};
@@ -334,27 +333,62 @@ void aem_in_out_power_screen_update(lv_obj_t *par)
 
         //if (power_volt_cur_data->in_power_value)
         {
-            sprintf(str_data, "%05.2f", f_Power[1]);
-            text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
+            if (f_Power[1] < 0.08)
+            {
+                sprintf(str_data, "%6.3f", f_Power[0]);
+                text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
+            
+                sprintf(str_data, "%6.3f", f_Power[1]);
+                text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
+            }
+            else
+            {
+                sprintf(str_data, "%6.3f", f_Power[1]);
+                text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
+            
+                sprintf(str_data, "%6.3f", f_Power[0]);
+                text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
+            }
             
-            sprintf(str_data, "%05.2f", f_Power[0]);
-            text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
         }
         //if (power_volt_cur_data->in_voltage_value)
         {
-            sprintf(str_data, "%05.2f", f_BusVoltage[1]);
-            text_canvas_set_text(power_volt_cur_data->in_voltage_value, str_data);
+            if (f_BusVoltage[1] < 2.5)
+            {
+                sprintf(str_data, "%6.3f", f_BusVoltage[0]);
+                text_canvas_set_text(power_volt_cur_data->in_voltage_value, str_data);
+            
+                sprintf(str_data, "%6.3f", f_BusVoltage[1]);
+                text_canvas_set_text(power_volt_cur_data->out_voltage_value, str_data);
+            }
+            else
+            {
+                sprintf(str_data, "%6.3f", f_BusVoltage[1]);
+                text_canvas_set_text(power_volt_cur_data->in_voltage_value, str_data);
+            
+                sprintf(str_data, "%6.3f", f_BusVoltage[0]);
+                text_canvas_set_text(power_volt_cur_data->out_voltage_value, str_data);
+            }
             
-            sprintf(str_data, "%05.2f", f_BusVoltage[0]);
-            text_canvas_set_text(power_volt_cur_data->out_voltage_value, str_data);
         }
         //if (power_volt_cur_data->in_current_value)
         {
-            sprintf(str_data, "%05.2f", f_Current[1]);
-            text_canvas_set_text(power_volt_cur_data->in_current_value, str_data);
+            if (f_Current[1] < 0.05)
+            {
+                sprintf(str_data, "%6.3f", f_Current[0]);
+                text_canvas_set_text(power_volt_cur_data->in_current_value, str_data);
+            
+                sprintf(str_data, "%6.3f", f_Current[1]);
+                text_canvas_set_text(power_volt_cur_data->out_current_value, str_data);
+            }
+            else
+            {
+                sprintf(str_data, "%6.3f", f_Current[1]);
+                text_canvas_set_text(power_volt_cur_data->in_current_value, str_data);
             
-            sprintf(str_data, "%05.2f", f_Current[0]);
-            text_canvas_set_text(power_volt_cur_data->out_current_value, str_data);
+                sprintf(str_data, "%6.3f", f_Current[0]);
+                text_canvas_set_text(power_volt_cur_data->out_current_value, str_data);
+            }
         }
     }
 }

+ 1 - 1
application/aem_watch/src/application/in_out_power/aem_widget_in_out_power.c

@@ -65,7 +65,7 @@ static void on_resume()
 
     if (s_wf_in_out_power->timer == NULL)
     {
-        s_wf_in_out_power->timer = lv_timer_create(timer_cb, 1000, NULL);
+        s_wf_in_out_power->timer = lv_timer_create(timer_cb, 500, NULL);
         if (s_wf_in_out_power->timer)
         {
             lv_timer_ready(s_wf_in_out_power->timer);            

+ 21 - 0
application/aem_watch/src/application/power_onoff/aem_power.c

@@ -13,6 +13,9 @@
 #include "aem_ota_service.h"
 
 #ifndef CONFIG_SIMULATOR
+#include "aem_data_share.h"
+#include "bt_manager.h"
+#include "bt_manager_ble.h"
 #include "sdfs.h"
 #endif
 
@@ -183,6 +186,24 @@ static void on_close(void)
     // 开机动画完成后发送完成时间给到app event
     if (s_on_off.state == 1)
     {
+    #ifndef CONFIG_SIMULATOR    
+    #ifdef CONFIG_BT_BR_ACTS
+        //bt
+        bt_manager_set_visible(aem_share_get_bt_earphone());
+        bt_manager_set_connectable(aem_share_get_bt_earphone());
+        //bt_manager_set_visible(false);
+        //bt_manager_set_connectable(false);
+    #endif // CONFIG_BT_BR_ACTS
+        //根据设定,判断是否需要启动蓝牙BLE广播
+        if (aem_share_get_bt_earphone() == 0)
+        {
+            bt_manager_ble_adv_stop();
+        }
+        else
+        {
+            bt_manager_ble_adv_start();
+        }
+    #endif // ! CONFIG_SIMULATOR
         aem_send_app_evt_msg(APP_EVT_POWER_ON_FINISH, NULL, 0);
     }
 }

+ 23 - 13
application/aem_watch/src/application/profile_photo/aem_profile_photo_screen.c

@@ -111,9 +111,9 @@ static lv_obj_t *aem_profile_photo_arc_show_create(lv_obj_t *par)
         if (in_power_unit_label)
         {
             lv_obj_set_style_text_font(in_power_unit_label, aem_font_small(), 0);
-            text_canvas_set_text(in_power_unit_label, "mW");
+            text_canvas_set_text(in_power_unit_label, "W");
             lv_obj_set_style_text_color(in_power_unit_label, (lv_color_t)LV_COLOR_WHITE, 0);
-            lv_obj_align(in_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(34), AEM_SIZE_VER_FACTOR_466(18));
+            lv_obj_align(in_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(45), AEM_SIZE_VER_FACTOR_466(18));
         }
 
         char *out_power_data = aem_auto_release_txt_fmt("%d", day_data.steps);
@@ -127,15 +127,15 @@ static lv_obj_t *aem_profile_photo_arc_show_create(lv_obj_t *par)
             activity_ui_data->out_power_value = lv_obj_get_child(out_power_item, 0);
         }
 
-        lv_obj_align(out_power_item, LV_ALIGN_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(-180), AEM_SIZE_VER_FACTOR_466(185));
+        lv_obj_align(out_power_item, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(195), AEM_SIZE_VER_FACTOR_466(185));
 
         lv_obj_t *out_power_unit_label = text_canvas_create(out_power_item);
         if (out_power_unit_label)
         {
             lv_obj_set_style_text_font(out_power_unit_label, aem_font_small(), 0);
-            text_canvas_set_text(out_power_unit_label, "mW");
+            text_canvas_set_text(out_power_unit_label, "W");
             lv_obj_set_style_text_color(out_power_unit_label, (lv_color_t)LV_COLOR_WHITE, 0);
-            lv_obj_align(out_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(34), AEM_SIZE_VER_FACTOR_466(18));
+            lv_obj_align(out_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(45), AEM_SIZE_VER_FACTOR_466(18));
         }
 
         lv_obj_t *in_icon = lv_img_create(arc_bg);
@@ -151,7 +151,7 @@ static lv_obj_t *aem_profile_photo_arc_show_create(lv_obj_t *par)
         {
             //lv_obj_clear_flag(out_icon, LV_OBJ_FLAG_CLICKABLE);
             lv_img_set_src(out_icon, &IMG_SCENE_PROFILE_PHOTO_PIC_OUT);
-            lv_obj_align(out_icon, LV_ALIGN_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(-150), AEM_SIZE_VER_FACTOR_466(185));
+            lv_obj_align(out_icon, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(150), AEM_SIZE_VER_FACTOR_466(185));
         } 
     }
 
@@ -193,9 +193,8 @@ void aem_profile_photo_screen_del(lv_obj_t *par)
         lv_obj_set_user_data(par, NULL);
     }
 }
-#define RELEASE_FW_EN 1
 
-#if RELEASE_FW_EN
+#ifndef CONFIG_SIMULATOR
 //extern float f_BusVoltage[2];
 extern float f_Power[2];
 //extern float f_Current[2];
@@ -204,7 +203,7 @@ void aem_profile_photo_screen_update(lv_obj_t *par)
 {
     profile_photo_scr_ui_data_t *power_volt_cur_data = lv_obj_get_user_data(par);
 
-#if (RELEASE_FW_EN == 0)
+#ifdef CONFIG_SIMULATOR
     float f_Power[2] = {10.0, 12.0};
     //float f_BusVoltage[2] = {5.00, 4.00};
     //float f_Current[2] = {2.00, 3.00};
@@ -216,11 +215,22 @@ void aem_profile_photo_screen_update(lv_obj_t *par)
 
         //if (power_volt_cur_data->in_power_value)
         {
-            sprintf(str_data, "%05.2f", f_Power[1]);
-            text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
+            if (f_Power[1] < 0.08)
+            {
+                sprintf(str_data, "%6.3f", f_Power[0]);
+                text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
             
-            sprintf(str_data, "%05.2f", f_Power[0]);
-            text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
+                sprintf(str_data, "%6.3f", f_Power[1]);
+                text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
+            }
+            else
+            {
+                sprintf(str_data, "%6.3f", f_Power[1]);
+                text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
+            
+                sprintf(str_data, "%6.3f", f_Power[0]);
+                text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
+            }
         }
         //if (power_volt_cur_data->in_voltage_value)
         {

+ 1 - 1
application/aem_watch/src/application/profile_photo/aem_widget_profile_photo.c

@@ -65,7 +65,7 @@ static void on_resume()
 
     if (s_wf_profile_photo->timer == NULL)
     {
-        s_wf_profile_photo->timer = lv_timer_create(timer_cb, 1000, NULL);
+        s_wf_profile_photo->timer = lv_timer_create(timer_cb, 500, NULL);
         if (s_wf_profile_photo->timer)
         {
             lv_timer_ready(s_wf_profile_photo->timer);            

+ 1 - 0
application/aem_watch/src/application/quick_settings/aem_quick_setting_alarm.c

@@ -31,6 +31,7 @@ static void card_event_cb(lv_event_t *e)
     else if (LV_EVENT_CLICKED == e->code)
     {
         aem_app_run(AEM_APP_ID_ALARM);
+        //aem_activity_run(AEM_SET_TIME, (void *)AEM_TIME);
     }
 }
 

+ 13 - 0
application/aem_watch/src/application/settings/aem_bluetooth.c

@@ -42,6 +42,19 @@ static void aem_bluetooth_updata(void)
         return;
 
     s_ui->sw = !s_ui->sw;
+#ifndef CONFIG_SIMULATOR
+    bt_manager_set_visible(s_ui->sw);
+    bt_manager_set_connectable(s_ui->sw);
+    
+    if (s_ui->sw)
+    {
+        bt_manager_ble_adv_start();
+    }
+    else
+    {
+        bt_manager_ble_adv_stop();
+    }
+#endif
     aem_share_set_bt_earphone(s_ui->sw);
     lv_obj_scroll_to_y(s_ui->page, 0, LV_ANIM_OFF); 
 }

+ 13 - 0
application/aem_watch/src/application/settings/aem_set_time.c

@@ -94,6 +94,11 @@ static void get_time_type(void)
     }
 }
 
+uint8_t bySetHour = 255;
+uint8_t bySetMinute = 255;
+uint8_t bySetMonth = 0;
+uint8_t bySetDay = 0;
+
 static void click_event_cb(lv_event_t *event)
 {
     switch (type)
@@ -166,6 +171,10 @@ static void click_event_cb(lv_event_t *event)
         time.min = s_ui->min;
         time.second = 0;
         aem_set_system_time(&time);
+        bySetHour = s_ui->hour;
+        bySetMinute = s_ui->min;
+        bySetMonth = 0;
+        bySetDay = 0;
         break;
     }
     case AEM_DATE:
@@ -176,6 +185,10 @@ static void click_event_cb(lv_event_t *event)
         time.day = s_ui->min;
         time.second = 0;
         aem_set_system_time(&time);
+        bySetMonth = s_ui->hour;
+        bySetDay = s_ui->min;
+        bySetHour = 0xFF;
+        bySetMinute = 0xFF;
         break;
     }
     default:

+ 29 - 29
application/aem_watch/src/application/settings/aem_settings.c

@@ -21,48 +21,48 @@ typedef struct
 static setting_ui_t *s_ui = NULL;
 
 static aem_app_id_e activity_id[] = {
-    AEM_SET_WATCHFACE,
+    //AEM_SET_WATCHFACE,
     AEM_SET_BLUETOOTH,
-    AEM_SET_SOUND_VIBRATION,
-    AEM_SET_DISPLAY,
-    AEM_SET_APP_VIEW,
-    AEM_SET_WAKE_MODE,
-    AEM_SET_NOT_DISTURB,
-    AEM_SET_SHORTCUT,
-    AEM_SET_UNIT,
-    AEM_SET_BATTERY_MANAGER,
+    //AEM_SET_SOUND_VIBRATION,
+    //AEM_SET_DISPLAY,
+    //AEM_SET_APP_VIEW,
+    //AEM_SET_WAKE_MODE,
+    //AEM_SET_NOT_DISTURB,
+    //AEM_SET_SHORTCUT,
+    //AEM_SET_UNIT,
+    //AEM_SET_BATTERY_MANAGER,
     AEM_SET_SYSTEM_OPERATE,
     AEM_SET_ABOUT_WATCH,
 };
 
-static res_string_id_e get_str[12] =
+static res_string_id_e get_str[3] =
     {
-        ID_KEY_SETTINGS_WATCHFACE_HOME,
+        //ID_KEY_SETTINGS_WATCHFACE_HOME,
         ID_KEY_SETTINGS_BT,
-        ID_KEY_SETTINGS_SOUNDS,
-        ID_KEY_SETTINGS_DISPLAY,
-        ID_KEY_APP_VIEW,
-        ID_KEY_SETTINGS_WAKE_MODE,
-        ID_KEY_DO_NOT_DISTURB,
-        ID_KEY_SETTINGS_SHORTCUTS,
-        ID_KEY_SETTINGS_UNIT,
-        ID_KEY_SETTINGS_BATTERY_MANAGER,
+        //ID_KEY_SETTINGS_SOUNDS,
+        //ID_KEY_SETTINGS_DISPLAY,
+        //ID_KEY_APP_VIEW,
+        //ID_KEY_SETTINGS_WAKE_MODE,
+        //ID_KEY_DO_NOT_DISTURB,
+        //ID_KEY_SETTINGS_SHORTCUTS,
+        //ID_KEY_SETTINGS_UNIT,
+        //ID_KEY_SETTINGS_BATTERY_MANAGER,
         ID_KEY_SETTINGS_SYSTEM,
         ID_KEY_SETTINGS_ABOUT,
 };
 
-static lv_img_dsc_t *get_img[12] =
+static lv_img_dsc_t *get_img[3] =
     {
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_WATCHFACE_LAUNCH,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_WATCHFACE_LAUNCH,
         &IMG_SCENE_SETTINGS_RES_LIST_PIC_BLUETOOTH,
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_SOUND_VIBRATION,
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_DISPLAY,
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_APP_VIEW,
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_SCREEN,
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_DND,
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_SHORTCUT,
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_UNIT_SET,
-        &IMG_SCENE_SETTINGS_RES_LIST_PIC_BATTERY,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_SOUND_VIBRATION,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_DISPLAY,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_APP_VIEW,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_SCREEN,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_DND,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_SHORTCUT,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_UNIT_SET,
+        //&IMG_SCENE_SETTINGS_RES_LIST_PIC_BATTERY,
         &IMG_SCENE_SETTINGS_RES_LIST_PIC_SYSTEM,
         &IMG_SCENE_SETTINGS_RES_LIST_PIC_ABOUT,
 };

+ 3 - 3
framework/bluetooth/bt_manager/bt_manager.c

@@ -282,7 +282,7 @@ static void bt_mgr_start_open_bt(void)
 #endif
 #ifdef CONFIG_BT_BLE
 #ifndef CONFIG_OTA_BLE_MASTER_SUPPORT
-	//bt_manager_ble_adv_start();
+	bt_manager_ble_adv_start();
 #endif
 #endif
 
@@ -291,8 +291,8 @@ static void bt_mgr_start_open_bt(void)
 	bt_manager_set_visible(false);
 	bt_manager_set_connectable(false);
 #else
-	//bt_manager_set_visible(true);
-	//bt_manager_set_connectable(true);
+	bt_manager_set_visible(true);
+	bt_manager_set_connectable(true);
 #endif
 
 	if (!bt_manager_config_pts_test()) {

+ 5 - 5
framework/bluetooth/bt_manager/bt_manager_check_mac_name.c

@@ -179,20 +179,20 @@ static void bt_manager_bt_mac(uint8_t *mac_str)
 #endif
 	SYS_LOG_INF("BT MAC: %s", mac_str);
 }
-
+#define BT_FIRST_NAME_LEN (10)
 void bt_manager_check_mac_name(void)
 {
 	uint8_t mac_str[MAC_STR_LEN];
 	uint32_t seed = 0, i;
-	char bt_name[BT_NAME_LEN] = "WINGCOOL_";
+	char bt_name[BT_NAME_LEN] = "Catsights_";
 
 	memset(mac_str, 0, MAC_STR_LEN);
 	bt_manager_bt_mac(mac_str);  //get mac address
 
-	memcpy(&bt_name[9], mac_str, strlen(mac_str));  //bt_name + mac address
+	memcpy(&bt_name[BT_FIRST_NAME_LEN], &mac_str[MAC_STR_LEN - 5], 4);  //bt_name + mac address  //strlen(mac_str)
 
-	property_set_factory(CFG_BT_NAME, bt_name, 9 + strlen(mac_str));  //set to nvram
-	property_set_factory(CFG_BLE_NAME, bt_name, 9 + strlen(mac_str));  //set to nvram
+	property_set_factory(CFG_BT_NAME, bt_name, BT_FIRST_NAME_LEN + 4);  //set to nvram
+	property_set_factory(CFG_BLE_NAME, bt_name, BT_FIRST_NAME_LEN + 4);  //set to nvram
 
 	//bt_manager_bt_name(mac_str);
 

+ 4 - 4
framework/bluetooth/bt_manager/bt_manager_connect.c

@@ -272,11 +272,11 @@ void bt_manager_halt_phone(void)
 void bt_manager_resume_phone(void)
 {
 	if(halted_phone) {
-		//bt_manager_startup_reconnect_phone();
-		//bt_manager_set_visible(true);
-		//bt_manager_set_connectable(true);
+		bt_manager_startup_reconnect_phone();
+		bt_manager_set_visible(true);
+		bt_manager_set_connectable(true);
 		halted_phone = false;
-		//SYS_LOG_INF("BMC resume phone");
+		SYS_LOG_INF("BMC resume phone");
 	}
 }
 

+ 4 - 6
thirdparty/lib/aem/adapter/def_settings/aem_adapter_def_settings.c

@@ -14,8 +14,6 @@
 
 #define WF_INFO_MAGIC (0x10000000)
 
-#define RELEASE_FW 1 
-
 static aem_lang_all_support_t s_aem_language_support;
 
 const static aem_language_table_t s_aem_language_table[] =
@@ -26,7 +24,7 @@ const static aem_language_table_t s_aem_language_table[] =
 
 // 内置表盘id数组,第一个为默认表盘。跟项目走, 添加视频表盘, 空间调整为2M
 #ifdef CONFIG_BOARD_ATS3085S4_DEV_WATCH_EXT_NOR
-#if RELEASE_FW
+#ifndef CONFIG_SIMULATOR
 // 预置表盘,文件不可删除,默认表盘为此数组第一个表盘
 const static uint32_t s_inside_wf[] = {
     80,
@@ -47,8 +45,8 @@ const static uint32_t s_outside_wf[] = {
     11,
 };
 #endif
-#else
-#if RELEASE_FW
+#else  
+#ifndef CONFIG_SIMULATOR
 // 预置表盘,文件不可删除,默认表盘为此数组第一个表盘
 const static uint32_t s_inside_wf[] = {
     10,
@@ -69,7 +67,7 @@ const static uint32_t s_outside_wf[] = {
     79,
 };
 #endif
-#endif
+#endif  // CONFIG_BOARD_ATS3085S4_DEV_WATCH_EXT_NOR
 
 // 小部件配置
 const static aem_widgets_sort_item_t s_widgets[] = {

+ 94 - 17
zephyr/drivers/input/sd8563_timer_acts.c

@@ -59,19 +59,52 @@ struct acts_timer_data {
 };
 
 uint16_t timer_crc[2] __attribute((used)) = {0};
-
+uint8_t read_time_data[7] = {0};
 static struct acts_timer_data timer_acts_ddata;
 
+static int _sd8563_close_write_protection(const struct device *i2c_dev);
+static void _sd8563_open_write_protection(const struct device *i2c_dev);
 static void _sd8563_read_time(const struct device *i2c_dev);
-
+static void _sd8563_set_time(const struct device *i2c_dev, 
+							 uint8_t set_hour, 
+							 uint8_t set_minute,
+							 uint8_t set_month,
+							 uint8_t set_day);
 extern void uart2_poll_out_ch(int c);
 
+extern uint8_t bySetHour;
+extern uint8_t bySetMinute;
+extern uint8_t bySetMonth;
+extern uint8_t bySetDay;
+
 #include <drivers/hrtimer.h>
 #if 1
 static struct hrtimer g_rtc_ht_read;
 static void timer_acts_handler(struct k_work *work)
 {
 	static struct acts_timer_data *external_rtc = &timer_acts_ddata;
+
+    if ((bySetHour != 0xff) || (bySetMonth != 0))
+	{
+		hrtimer_stop(&g_rtc_ht_read);
+
+		if (_sd8563_close_write_protection(external_rtc->i2c_dev) == 1)
+		{
+			_sd8563_set_time(external_rtc->i2c_dev, bySetHour, bySetMinute, bySetMonth, bySetDay);
+
+			_sd8563_open_write_protection(external_rtc->i2c_dev);
+		}
+
+		bySetHour = 0xff;
+		bySetMinute = 0xff;
+		bySetMonth = 0;
+		bySetDay = 0;
+
+		hrtimer_restart(&g_rtc_ht_read);
+
+		return;
+	}
+
     _sd8563_read_time(external_rtc->i2c_dev);  //不在ISR中完成,防止中断嵌套
 }
 K_WORK_DEFINE(timer_acts, timer_acts_handler);
@@ -281,11 +314,16 @@ static int _sd8563_close_write_protection(const struct device *i2c_dev)
 #endif	
 }
 
-static void _sd8563_set_time(const struct device *i2c_dev)
+static void _sd8563_set_time(const struct device *i2c_dev, 
+							 uint8_t set_hour, 
+							 uint8_t set_minute,
+							 uint8_t set_month,
+							 uint8_t set_day)
 {
 #if 1	
 	static uint8_t write_cmd[8] = {0};
 	static uint8_t read_cmd[7] = {0};
+	bool power_on_set_time_data = false;
 	int ret = 0;
 
 	printk("_sd8563_set_time start\n");
@@ -298,22 +336,61 @@ static void _sd8563_set_time(const struct device *i2c_dev)
 		return;
 	}
 
-    printk("read_cmd[0] = %d\n", read_cmd[0]);
-	if ((read_cmd[0] & 0x80) == 0)  //bit7:0SF/
+    if (set_hour == 0xFF && set_month == 0)  //power on
 	{
-		printk("bit7:0SF is 0,The time has been set\n");
-        return;
+		printk("read_cmd[0] = %d\n", read_cmd[0]);
+		if ((read_cmd[0] & 0x80) == 0)  //bit7:0SF/
+		{
+			printk("bit7:0SF is 0,The time has been set\n");
+			return;
+		}
+
+		power_on_set_time_data = true;
 	}
 
-	//BCD code
-    write_cmd[1] = 0;  //sec
-	write_cmd[2] = 0x35;  //min
-	write_cmd[3] = 0x11;  //hour
-	write_cmd[4] = 0x12;  //day
-	write_cmd[5] = 0x06;  //week
-	write_cmd[6] = 0x10;  //mon
-	write_cmd[7] = 0x24;  //year
+    _sd8563_read_time(i2c_dev);  //read time
 
+    printk("y:20%d, mon:%d, week:%d, d:%d, h:%d, min:%d, sec:%d\n",
+			read_time_data[6], read_time_data[5], read_time_data[4], read_time_data[3], read_time_data[2], read_time_data[1], read_time_data[0]);
+
+	if(set_minute != 0XFF)
+	{
+		read_time_data[1] = set_minute;//(set_minute / 10) * 16  + set_minute % 10;  //DEC TO BCD CODE
+		read_time_data[2] = set_hour;//(set_hour / 10) * 16  + set_hour % 10;  //DEC TO BCD CODE
+	}
+	else if (set_month != 0)
+	{
+		read_time_data[3] = set_day;//(set_day / 10) * 16  + set_day % 10;  //DEC TO BCD CODE
+		read_time_data[5] = set_month;//(set_month / 10) * 16  + set_month % 10;  //DEC TO BCD CODE
+	}
+
+    if (power_on_set_time_data == true)
+	{
+        //BCD code
+		write_cmd[1] = 0;  //sec
+		write_cmd[2] = 0x35;  //min
+		write_cmd[3] = 0x11;  //hour
+		write_cmd[4] = 0x12;  //day
+		write_cmd[5] = 0x06;  //week
+		write_cmd[6] = 0x10;  //mon
+		write_cmd[7] = 0x24;  //year
+	}
+	else
+	{
+		//BCD code
+		for (uint8_t i = 0; i < 7; i++)
+		{
+			write_cmd[i + 1] = (read_time_data[i] / 10) * 16  + read_time_data[i] % 10;
+		}
+		//write_cmd[1] = read_time_data[0];  //sec
+		//write_cmd[2] = read_time_data[1];  //min
+		//write_cmd[3] = read_time_data[2];  //hour
+		//write_cmd[4] = read_time_data[3];  //day
+		//write_cmd[5] = read_time_data[4];  //week
+		//write_cmd[6] = read_time_data[5];  //mon
+		//write_cmd[7] = read_time_data[6];  //year
+	}
+	
     ret = i2c_write(i2c_dev, write_cmd, 8, rtc_slaver_addr);
 	if (ret != 0)
 	{
@@ -336,7 +413,7 @@ static void _sd8563_set_time(const struct device *i2c_dev)
     printk("_sd8563_set_time exit\n");
 #endif	
 }
-uint8_t read_time_data[7] = {0};
+
 static void _sd8563_read_time(const struct device *i2c_dev)
 {
 #if 1	
@@ -392,7 +469,7 @@ static void _sd8563_init_work(struct k_work *work)
 	{
 		//k_msleep(2);
 
-        _sd8563_set_time(external_rtc->i2c_dev);
+        _sd8563_set_time(external_rtc->i2c_dev, 0xFF, 0xFF, 0, 0);
 
         //k_msleep(2);
 

+ 28 - 7
zephyr/drivers/input/sgm832a_acts.c

@@ -7,6 +7,7 @@
 /**
  * @file
  * @brief SGM832A Timer driver for Actions SoC
+ * typec_num: 0 for typec0, input/output; 1 for typec1, input
  */
 
 #include <errno.h>
@@ -72,6 +73,7 @@ struct acts_sgm_data {
 };
 
 uint16_t sgm_crc[2] __attribute((used)) = {0};
+float f_ShuntVoltage[2] = {0.0}, f_BusVoltage[2] = {0.0}, f_Power[2] = {0.0}, f_Current[2] = {0.0};
 
 static struct acts_sgm_data sgm_acts_ddata;
 
@@ -104,7 +106,7 @@ static void htimer_read(unsigned int ms)
 	hrtimer_start(&g_sgm_ht_read, 1000*ms, 1000*ms);
 }
 #endif
-float f_ShuntVoltage[2] = {0.0}, f_BusVoltage[2] = {0.0}, f_Power[2] = {0.0}, f_Current[2] = {0.0};
+
 static void sgm832_typec_get_data(const struct device *i2c_dev, uint16_t sgm832_typec_slaver_addr, uint8_t typec_num)
 {
 #if 1	
@@ -160,7 +162,6 @@ static void sgm832_typec_get_data(const struct device *i2c_dev, uint16_t sgm832_
 
     read_data[0] = ((read_data[0]  & 0xFF00) >> 8) + ((read_data[0] & 0x00FF) << 8);
     f_BusVoltage[typec_num] = (float)read_data[0] * 1.25 * 0.001;
-	
 	//printk("Bus_Voltage: %.3f V\n", f_BusVoltage[typec_num]);
 
     //03H Power Register
@@ -171,7 +172,7 @@ static void sgm832_typec_get_data(const struct device *i2c_dev, uint16_t sgm832_
 	}
 
 	read_data[0] = ((read_data[0]  & 0xFF00) >> 8) + ((read_data[0] & 0x00FF) << 8);
-	f_Power[typec_num] = (float)read_data[0] * 25 * 0.001;
+	f_Power[typec_num] = (float)read_data[0] * 25 * 0.001;  //W
 	//printk("Power: %.3f mW\n", f_Power[typec_num]);
 
 	//04H Current Register
@@ -184,7 +185,7 @@ static void sgm832_typec_get_data(const struct device *i2c_dev, uint16_t sgm832_
             read_data[0] = ~read_data[0] + 1;
         }
 
-		f_Current[typec_num] = read_data[0] * 0.001;
+		f_Current[typec_num] = read_data[0] * 0.001;  //A
 	}
 	else
 	{
@@ -306,10 +307,30 @@ static void sgm832_typec1_get_shuntvoltage(const struct device *i2c_dev)
 
 static void sgm832_typec_calibration(const struct device *i2c_dev, uint16_t sgm832_typec_slaver_addr, uint8_t typec_num)
 {
-    static uint8_t write_data[3] = {CALIBRATION_REGISTER, 0x0A, 0};
+    //static uint8_t configurate_write_data[3] = {CONFIGURATION_REGISTER, 0x47, 0x6F};
+	static uint8_t calibrate_write_data0[3] = {CALIBRATION_REGISTER, 0x00, 0xD0};  //typec0, input/output
+	static uint8_t calibrate_write_data1[3] = {CALIBRATION_REGISTER, 0x00, 0xF2};  //typec1, input
     int ret = 0;
 
-	ret = i2c_write(i2c_dev, write_data, 3, sgm832_typec_slaver_addr);
+	//ret = i2c_write(i2c_dev, configurate_write_data, 3, sgm832_typec_slaver_addr);
+	//if (ret != 0)
+	//{
+	//    printk("i2c write sgm832_typec%d Configuration Register ERR\n", typec_num);
+	//	return;
+	//}
+
+    switch(typec_num)
+    {
+        case 0:
+            ret = i2c_write(i2c_dev, calibrate_write_data0, 3, sgm832_typec_slaver_addr);
+            break;
+        case 1:
+            ret = i2c_write(i2c_dev, calibrate_write_data1, 3, sgm832_typec_slaver_addr);
+            break;
+        default:
+            break;
+    }
+
 	if (ret != 0)
 	{
 	    printk("i2c write sgm832_typec%d Calibration Register ERR\n", typec_num);
@@ -328,7 +349,7 @@ static void _sgm832a_init_work(struct k_work *work)
 	sgm832_typec_calibration(power_consumption->i2c_dev, sgm832_typec0_slaver_addr, 0);
     sgm832_typec_calibration(power_consumption->i2c_dev, sgm832_typec1_slaver_addr, 1);
    
-	htimer_read(1000);  //1000ms = 1s
+	htimer_read(500);  //1000ms = 1s
 }
 
 static int _sgm832a_acts_init(const struct device *dev)