0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 22:58:04 +03:00

Removed floating point stuff

This commit is contained in:
OneOfEleven
2023-09-13 02:01:35 +01:00
parent 21d5d1ee15
commit 2f907f82f8
24 changed files with 146 additions and 117 deletions

View File

@ -49,9 +49,10 @@ void UI_DisplayWelcome(void)
(gBatteryVoltageAverage > gMax_bat_v) ? gMax_bat_v :
gBatteryVoltageAverage;
sprintf(WelcomeString0, "VOLTAGE");
sprintf(WelcomeString1, "%.2fV %u%%",
gBatteryVoltageAverage * 0.01, // argh, floating point :(
strcpy(WelcomeString0, "VOLTAGE");
sprintf(WelcomeString1, "%u.%02uV %u%%",
gBatteryVoltageAverage / 100,
gBatteryVoltageAverage % 100,
(100 * (volts - gMin_bat_v)) / (gMax_bat_v - gMin_bat_v));
}
else