更换串口为USB

This commit is contained in:
不吃油炸鸡
2026-02-07 13:29:07 +08:00
parent d542bdec20
commit b3dc8fc67b
44 changed files with 13221 additions and 7516 deletions

View File

@@ -62,8 +62,7 @@ static void _flush_timer_cb(void) {
char buf[5];
float voltage = 0.0;
float current = 0.0;
current = ui_get_current(); // uA
voltage = ui_get_voltage(); // V
ui_get_vol_cur(&voltage, &current);
sprintf(buf, "%.2f", voltage);
lv_label_set_text(ui_LabelPPSVol, buf);
sprintf(buf, "%.2f", current/1000000.0); // 转换为 A

View File

@@ -130,8 +130,7 @@ static void _flush_timer_cb()
{
float voltage = 0.0;
float current = 0.0;
current = ui_get_current();
voltage = ui_get_voltage();
ui_get_vol_cur(&voltage, &current);
set_val_cur_label(voltage, current);
}
@@ -250,7 +249,7 @@ void ui_main_screen_init(void)
lv_obj_set_style_text_font(ui_LabelTime, &ui_font_HeiTi48, LV_PART_MAIN | LV_STATE_DEFAULT);
_flush_timer_cb(NULL);
// flush timer
_flush_timer = lv_timer_create(_flush_timer_cb, 500, NULL);
_flush_timer = lv_timer_create(_flush_timer_cb, 250, NULL);
}