mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Left pad OSD electrical power readout
This commit is contained in:
parent
8a1ba09ee8
commit
3013229918
2 changed files with 7 additions and 7 deletions
|
@ -572,7 +572,7 @@ static void osdDrawSingleElement(uint8_t item)
|
||||||
}
|
}
|
||||||
|
|
||||||
case OSD_POWER:
|
case OSD_POWER:
|
||||||
tfp_sprintf(buff, "%dW", getAmperage() * getBatteryVoltage() / 1000);
|
tfp_sprintf(buff, "%4dW", getAmperage() * getBatteryVoltage() / 1000);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OSD_PIDRATE_PROFILE:
|
case OSD_PIDRATE_PROFILE:
|
||||||
|
|
|
@ -616,24 +616,24 @@ TEST(OsdTest, TestElementPower)
|
||||||
simulationBatteryVoltage = 100; // 10V
|
simulationBatteryVoltage = 100; // 10V
|
||||||
|
|
||||||
// and
|
// and
|
||||||
simulationBatteryAmperage = 0;
|
simulationBatteryAmperage = 0; // 0A
|
||||||
|
|
||||||
// when
|
// when
|
||||||
displayClearScreen(&testDisplayPort);
|
displayClearScreen(&testDisplayPort);
|
||||||
osdRefresh(simulationTime);
|
osdRefresh(simulationTime);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
displayPortTestBufferSubstring(1, 10, "0W");
|
displayPortTestBufferSubstring(1, 10, " 0W");
|
||||||
|
|
||||||
// given
|
// given
|
||||||
simulationBatteryAmperage = 10; // 0.1AA
|
simulationBatteryAmperage = 10; // 0.1A
|
||||||
|
|
||||||
// when
|
// when
|
||||||
displayClearScreen(&testDisplayPort);
|
displayClearScreen(&testDisplayPort);
|
||||||
osdRefresh(simulationTime);
|
osdRefresh(simulationTime);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
displayPortTestBufferSubstring(1, 10, "1W");
|
displayPortTestBufferSubstring(1, 10, " 1W");
|
||||||
|
|
||||||
// given
|
// given
|
||||||
simulationBatteryAmperage = 120; // 1.2A
|
simulationBatteryAmperage = 120; // 1.2A
|
||||||
|
@ -643,7 +643,7 @@ TEST(OsdTest, TestElementPower)
|
||||||
osdRefresh(simulationTime);
|
osdRefresh(simulationTime);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
displayPortTestBufferSubstring(1, 10, "12W");
|
displayPortTestBufferSubstring(1, 10, " 12W");
|
||||||
|
|
||||||
// given
|
// given
|
||||||
simulationBatteryAmperage = 1230; // 12.3A
|
simulationBatteryAmperage = 1230; // 12.3A
|
||||||
|
@ -653,7 +653,7 @@ TEST(OsdTest, TestElementPower)
|
||||||
osdRefresh(simulationTime);
|
osdRefresh(simulationTime);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
displayPortTestBufferSubstring(1, 10, "123W");
|
displayPortTestBufferSubstring(1, 10, " 123W");
|
||||||
|
|
||||||
// given
|
// given
|
||||||
simulationBatteryAmperage = 12340; // 123.4A
|
simulationBatteryAmperage = 12340; // 123.4A
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue