diff --git a/src/main/io/osd.c b/src/main/io/osd.c index a73d1ae7c..f8478aa5c 100755 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -572,7 +572,7 @@ static void osdDrawSingleElement(uint8_t item) } case OSD_POWER: - tfp_sprintf(buff, "%dW", getAmperage() * getBatteryVoltage() / 1000); + tfp_sprintf(buff, "%4dW", getAmperage() * getBatteryVoltage() / 1000); break; case OSD_PIDRATE_PROFILE: diff --git a/src/test/unit/osd_unittest.cc b/src/test/unit/osd_unittest.cc index def9532ea..b995f4c34 100644 --- a/src/test/unit/osd_unittest.cc +++ b/src/test/unit/osd_unittest.cc @@ -616,24 +616,24 @@ TEST(OsdTest, TestElementPower) simulationBatteryVoltage = 100; // 10V // and - simulationBatteryAmperage = 0; + simulationBatteryAmperage = 0; // 0A // when displayClearScreen(&testDisplayPort); osdRefresh(simulationTime); // then - displayPortTestBufferSubstring(1, 10, "0W"); + displayPortTestBufferSubstring(1, 10, " 0W"); // given - simulationBatteryAmperage = 10; // 0.1AA + simulationBatteryAmperage = 10; // 0.1A // when displayClearScreen(&testDisplayPort); osdRefresh(simulationTime); // then - displayPortTestBufferSubstring(1, 10, "1W"); + displayPortTestBufferSubstring(1, 10, " 1W"); // given simulationBatteryAmperage = 120; // 1.2A @@ -643,7 +643,7 @@ TEST(OsdTest, TestElementPower) osdRefresh(simulationTime); // then - displayPortTestBufferSubstring(1, 10, "12W"); + displayPortTestBufferSubstring(1, 10, " 12W"); // given simulationBatteryAmperage = 1230; // 12.3A @@ -653,7 +653,7 @@ TEST(OsdTest, TestElementPower) osdRefresh(simulationTime); // then - displayPortTestBufferSubstring(1, 10, "123W"); + displayPortTestBufferSubstring(1, 10, " 123W"); // given simulationBatteryAmperage = 12340; // 123.4A