OLED display fix
Charger states now use 4 letter max to fit display. Minor printf warning fix as well No functional change.
This commit is contained in:
+1
-1
@@ -321,7 +321,7 @@ void init_watchdog(float timeout) {
|
||||
IWDG->RLR = (uint32_t)(timeout * (LSI_FREQ/prescaler));
|
||||
|
||||
calculated_timeout = ((float)(prescaler * IWDG->RLR)) / LSI_FREQ;
|
||||
printf("WATCHDOG set with prescaler:%d reload value: 0x%X - timeout:%f\n",prescaler, IWDG->RLR, calculated_timeout);
|
||||
printf("WATCHDOG set with prescaler:%d reload value: 0x%lX - timeout:%f\n",prescaler, IWDG->RLR, calculated_timeout);
|
||||
|
||||
IWDG->KR = 0xAAAA; // reload
|
||||
IWDG->KR = 0xCCCC; // start
|
||||
|
||||
+5
-5
@@ -172,19 +172,19 @@ void output_oled()
|
||||
oled.printf("T %.1f PWM %.1f%% ", device.internal_temperature, dcdc_get_duty_cycle() * 100.0);
|
||||
switch (charger_get_state()) {
|
||||
case CHG_IDLE:
|
||||
oled.printf("Idle\n");
|
||||
oled.printf("Idle");
|
||||
break;
|
||||
case CHG_CC:
|
||||
oled.printf("CC charge\n");
|
||||
oled.printf("CC");
|
||||
break;
|
||||
case CHG_CV:
|
||||
oled.printf("CV charge\n");
|
||||
oled.printf("CV");
|
||||
break;
|
||||
case CHG_TRICKLE:
|
||||
oled.printf("Trickle chg\n");
|
||||
oled.printf("Trkl");
|
||||
break;
|
||||
default:
|
||||
oled.printf("Error\n");
|
||||
oled.printf("Err.");
|
||||
break;
|
||||
}
|
||||
oled.display();
|
||||
|
||||
Reference in New Issue
Block a user