mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
更新分层API
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
// Project name: PowerPico
|
||||
|
||||
#include "../ui.h"
|
||||
#include "data_queue.h" // bsp/data_queue.h for voltage/current queues
|
||||
|
||||
lv_obj_t * ui_PPSPage = NULL;
|
||||
static lv_obj_t * ui_PanelPPSVol = NULL;
|
||||
@@ -56,8 +55,8 @@ static void _flush_timer_cb(void) {
|
||||
char buf[5];
|
||||
float voltage = 0.0;
|
||||
float current = 0.0;
|
||||
current = queue_average(global_current_queue); // uA
|
||||
voltage = queue_average(global_voltage_queue); // V
|
||||
current = ui_get_current(); // uA
|
||||
voltage = ui_get_voltage(); // V
|
||||
sprintf(buf, "%.2f", voltage);
|
||||
lv_label_set_text(ui_LabelPPSVol, buf);
|
||||
sprintf(buf, "%.2f", current/1000000.0); // 转换为 A
|
||||
|
||||
Reference in New Issue
Block a user