mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Fix > 25V input
This commit is contained in:
@@ -132,14 +132,14 @@ static bool checkVoltageForExit() {
|
|||||||
static void gui_drawBatteryIcon() {
|
static void gui_drawBatteryIcon() {
|
||||||
#if defined(POW_PD) || defined(POW_QC)
|
#if defined(POW_PD) || defined(POW_QC)
|
||||||
if (!getIsPoweredByDCIN()) {
|
if (!getIsPoweredByDCIN()) {
|
||||||
// On TS80 we replace this symbol with the voltage we are operating on
|
// On non-DC inputs we replace this symbol with the voltage we are operating on
|
||||||
// If <9V then show single digit, if not show dual small ones vertically stacked
|
// If <9V then show single digit, if not show dual small ones vertically stacked
|
||||||
uint8_t V = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0);
|
uint16_t V = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0);
|
||||||
if (V % 10 >= 5)
|
if (V % 10 >= 5)
|
||||||
V = V / 10 + 1; // round up
|
V = (V / 10) + 1; // round up
|
||||||
else
|
else
|
||||||
V = V / 10;
|
V = V / 10;
|
||||||
if (V >= 10) {
|
if (V > 9) {
|
||||||
int16_t xPos = OLED::getCursorX();
|
int16_t xPos = OLED::getCursorX();
|
||||||
OLED::printNumber(V / 10, 1, FontStyle::SMALL);
|
OLED::printNumber(V / 10, 1, FontStyle::SMALL);
|
||||||
OLED::setCursor(xPos, 8);
|
OLED::setCursor(xPos, 8);
|
||||||
|
|||||||
Reference in New Issue
Block a user