From d8c090dea265cdfc3dcdd52c10b712e901fe78d9 Mon Sep 17 00:00:00 2001 From: Hogthrob Date: Sun, 7 Oct 2018 11:32:00 +0200 Subject: [PATCH] OLED display fix Charger states now use 4 letter max to fit display. Minor printf warning fix as well No functional change. --- src/main.cpp | 2 +- src/output.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 4f11c38..5c29469 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 diff --git a/src/output.cpp b/src/output.cpp index eb93e48..3ae5fa0 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -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();