From: penglei <1624952103@qq.com> Date: Mon, 8 Dec 2025 06:59:35 +0000 (+0800) Subject: 电池产测UI增加NTC温度显示 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2884%2Ftarget%2F1;p=mirrors%2FFD230.git 电池产测UI增加NTC温度显示 --- diff --git a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp index 20a2ccb33..1f58c022b 100644 --- a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp @@ -212,14 +212,19 @@ namespace OHOS float voltage = 0.0F; + float bat_temp = 0.0F; + float pcb_temp = 0.0F; uint8_t power = 0; +#ifdef SUPPORT_BATTERY_SERVICE power = battery_get_voltage(&voltage); + battery_get_pcb_temp(&pcb_temp); + battery_get_battery_temp(&bat_temp); +#endif + char battery_buf[64]={0}; - char battery_buf[32]={0}; - - sprintf_s(battery_buf,32,"power:%d\nvoltage:%.2f",power,voltage); + sprintf_s(battery_buf,64,"power:%d\nvoltage:%.2f\nbat_temp:%.2f\npcb_temp:%.2f",power,voltage,bat_temp,pcb_temp); - charnge_label= testAboutView::GetInstance()->init_title(100,250,battery_buf); + charnge_label= testAboutView::GetInstance()->init_title(70,250,battery_buf); testCHANINGScrollView->Add(charnge_label); #if ENABLE_TEST_RESULT_BUTTONS