mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Fix OSD_X macro to correctly load the high bit (#12038)
Resolves #12037
This commit is contained in:
parent
40de3fd4d7
commit
f8bd0b5388
2 changed files with 26 additions and 3 deletions
|
@ -1263,6 +1263,29 @@ TEST_F(OsdTest, TestGpsElements)
|
|||
}
|
||||
}
|
||||
|
||||
TEST_F(OsdTest, TestHdPositioning)
|
||||
{
|
||||
// given
|
||||
// Try to round-trip the OSD_POS macro with an "HD location"
|
||||
osdElementConfigMutable()->item_pos[OSD_RSSI_VALUE] = OSD_POS(53, 0) | OSD_PROFILE_1_FLAG;
|
||||
osdConfigMutable()->rssi_alarm = 0;
|
||||
// Also try to round-trip a raw value matching one generated by the Configurator.
|
||||
osdElementConfigMutable()->item_pos[OSD_CURRENT_DRAW] = 3125 | OSD_PROFILE_1_FLAG;
|
||||
|
||||
osdAnalyzeActiveElements();
|
||||
|
||||
// when
|
||||
simulationBatteryAmperage = 0;
|
||||
rssi = 1024;
|
||||
|
||||
displayClearScreen(&testDisplayPort, DISPLAY_CLEAR_WAIT);
|
||||
osdRefresh();
|
||||
|
||||
// then
|
||||
displayPortTestBufferSubstring(53, 0, "%c99", SYM_RSSI);
|
||||
displayPortTestBufferSubstring(53, 1, " 0.00%c", SYM_AMP);
|
||||
}
|
||||
|
||||
// STUBS
|
||||
extern "C" {
|
||||
bool featureIsEnabled(uint32_t f) { return simulationFeatureFlags & f; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue