From: xue <2144439972@qq.com> Date: Mon, 25 May 2026 02:49:53 +0000 (+0800) Subject: 增加充电测试界面充电ic显示 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=4ed371a1c1408b7e39f74ac3fa0d61c535b8ed1d;p=mirrors%2FFD230.git 增加充电测试界面充电ic显示 --- diff --git a/code/sdk/zhihui/UI/producttest/include/testchanging.h b/code/sdk/zhihui/UI/producttest/include/testchanging.h index f7a9f2978..2f665f03a 100644 --- a/code/sdk/zhihui/UI/producttest/include/testchanging.h +++ b/code/sdk/zhihui/UI/producttest/include/testchanging.h @@ -49,6 +49,7 @@ namespace OHOS UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); bool testCHANINGScrollViewcrollViewinit(uint8_t); UIScrollView *testCHANINGScrollView{nullptr}; + uint8_t GetChargeId(void); bool initViewStatus{false}; UILabel *Title{nullptr}; // 标题 UILabel *charnge_label{nullptr}; // 标题 diff --git a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp index 26481c618..0833dcc07 100644 --- a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp @@ -20,6 +20,9 @@ extern "C" #endif #include "pm_veto.h" #include "pm.h" +#ifdef ENABLE_HP4570 + #include "hp4570.h" +#endif #ifdef __cplusplus #if __cplusplus } @@ -215,16 +218,21 @@ namespace OHOS float bat_temp = 0.0F; float pcb_temp = 0.0F; uint8_t power = 0; + uint8_t charge_id = 0; #ifdef SUPPORT_BATTERY_SERVICE power = battery_get_voltage(&voltage); battery_get_pcb_temp(&pcb_temp); battery_get_battery_temp(&bat_temp); +#endif +#ifdef ENABLE_HP4570 + + charge_id = GetChargeId(); #endif char battery_buf[64]={0}; - sprintf_s(battery_buf,64,"power:%d\nvoltage:%.2f\nbat_temp:%.2f\npcb_temp:%.2f",power,voltage,bat_temp,pcb_temp); + sprintf_s(battery_buf,64,"power:%d\nvoltage:%.2f\nbat_temp:%.2f\npcb_temp:%.2f\ncharge Ic:%d",power,voltage,bat_temp,pcb_temp,charge_id); - charnge_label= testAboutView::GetInstance()->init_title(70,250,battery_buf); + charnge_label= testAboutView::GetInstance()->init_title(70,240,battery_buf); testCHANINGScrollView->Add(charnge_label); #if ENABLE_TEST_RESULT_BUTTONS @@ -280,6 +288,19 @@ namespace OHOS } return testCHANINGScrollView; } + + uint8_t testCHANINGView::GetChargeId(void) + { + uint8_t charge_id = hp4570n_get_id(); + if(0x2 == charge_id) + { + return 1; + } + else + { + return 0; + } + } } #ifdef __cplusplus