@@ -313,7 +313,7 @@ void updateLvglMainScreen(
313313 }
314314
315315 // Update battery bar and percentage
316- if (bmsConnected && batteryPercent > 0 ) {
316+ if (bmsConnected && batteryPercent >= 0 ) {
317317 lv_bar_set_value (battery_bar, (int )batteryPercent, LV_ANIM_OFF);
318318
319319 // Set color based on percentage
@@ -365,15 +365,11 @@ void updateLvglMainScreen(
365365 snprintf (buffer, sizeof (buffer), " %2.0fv" , totalVolts);
366366 lv_label_set_text (voltage_right_label, buffer);
367367 // Ensure battery label shows percentage if BMS is connected
368- if (batteryPercent > 0 ) {
368+ if (batteryPercent >= 0 ) {
369369 char batt_buffer[10 ];
370370 snprintf (batt_buffer, sizeof (batt_buffer), " %d%%" , (int )batteryPercent);
371371 lv_label_set_text (battery_label, batt_buffer);
372372 lv_obj_set_style_text_color (battery_label, LVGL_BLACK, 0 );
373- } else {
374- // If SOC is 0, maybe show voltage instead or clear? Let's clear for now.
375- lv_label_set_text (battery_label, " -" );
376- lv_obj_set_style_text_color (battery_label, LVGL_BLACK, 0 );
377373 }
378374
379375 } else if (escConnected) {
0 commit comments