11#include " ../../../inc/sp140/lvgl/lvgl_updates.h"
22#include " ../../../inc/sp140/esp32s3-config.h"
3+ #include " ../../../inc/sp140/monitor_config.h" // For direct threshold access
34#include " ../../../inc/sp140/globals.h"
45#include " ../../../inc/sp140/vibration_pwm.h"
56#include " ../../../inc/sp140/shared-config.h"
@@ -352,9 +353,9 @@ void updateLvglMainScreen(
352353
353354 // Set color based on percentage
354355 lv_color_t batteryColor = LVGL_RED;
355- if (batteryPercent >= BATT_WARNING_SOC_THRESHOLD ) {
356+ if (batteryPercent >= bmsSOCThresholds. warnLow ) {
356357 batteryColor = LVGL_GREEN;
357- } else if (batteryPercent >= BATT_CRITICAL_SOC_THRESHOLD ) {
358+ } else if (batteryPercent >= bmsSOCThresholds. critLow ) {
358359 batteryColor = LVGL_YELLOW;
359360 }
360361
@@ -654,10 +655,10 @@ void updateLvglMainScreen(
654655 if (bmsTelemetry.bmsState == TelemetryState::CONNECTED) {
655656 lv_label_set_text_fmt (batt_temp_label, " %d" , static_cast <int >(batteryTemp));
656657
657- if (batteryTemp >= BATT_TEMP_CRITICAL ) {
658+ if (batteryTemp >= bmsTempThresholds. critHigh ) {
658659 lv_obj_add_style (batt_temp_bg, &style_critical, 0 );
659660 lv_obj_clear_flag (batt_temp_bg, LV_OBJ_FLAG_HIDDEN);
660- } else if (batteryTemp >= BATT_TEMP_WARNING ) {
661+ } else if (batteryTemp >= bmsTempThresholds. warnHigh ) {
661662 lv_obj_add_style (batt_temp_bg, &style_warning, 0 );
662663 lv_obj_clear_flag (batt_temp_bg, LV_OBJ_FLAG_HIDDEN);
663664 } else {
@@ -677,10 +678,10 @@ void updateLvglMainScreen(
677678 if (escTelemetry.escState == TelemetryState::CONNECTED) {
678679 lv_label_set_text_fmt (esc_temp_label, " %d" , static_cast <int >(escTemp));
679680
680- if (escTemp >= ESC_TEMP_CRITICAL ) {
681+ if (escTemp >= escMosTempThresholds. critHigh ) {
681682 lv_obj_add_style (esc_temp_bg, &style_critical, 0 );
682683 lv_obj_clear_flag (esc_temp_bg, LV_OBJ_FLAG_HIDDEN);
683- } else if (escTemp >= ESC_TEMP_WARNING ) {
684+ } else if (escTemp >= escMosTempThresholds. warnHigh ) {
684685 lv_obj_add_style (esc_temp_bg, &style_warning, 0 );
685686 lv_obj_clear_flag (esc_temp_bg, LV_OBJ_FLAG_HIDDEN);
686687 } else {
@@ -700,10 +701,10 @@ void updateLvglMainScreen(
700701 if (escTelemetry.escState == TelemetryState::CONNECTED && motorTemp > -20 .0f ) {
701702 lv_label_set_text_fmt (motor_temp_label, " %d" , static_cast <int >(motorTemp));
702703
703- if (motorTemp >= MOTOR_TEMP_CRITICAL ) {
704+ if (motorTemp >= motorTempThresholds. critHigh ) {
704705 lv_obj_add_style (motor_temp_bg, &style_critical, 0 );
705706 lv_obj_clear_flag (motor_temp_bg, LV_OBJ_FLAG_HIDDEN);
706- } else if (motorTemp >= MOTOR_TEMP_WARNING ) {
707+ } else if (motorTemp >= motorTempThresholds. warnHigh ) {
707708 lv_obj_add_style (motor_temp_bg, &style_warning, 0 );
708709 lv_obj_clear_flag (motor_temp_bg, LV_OBJ_FLAG_HIDDEN);
709710 } else {
0 commit comments