1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Add OSD Profile feature - issue 4155

This commit is contained in:
Pieter Kruger 2018-11-30 07:37:29 +10:00
parent 8a4ea0785e
commit 8d981df1a9
12 changed files with 227 additions and 66 deletions

View file

@ -463,12 +463,12 @@ TEST(OsdTest, TestAlarms)
// and
// the following OSD elements are visible
osdConfigMutable()->item_pos[OSD_RSSI_VALUE] = OSD_POS(8, 1) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_MAIN_BATT_VOLTAGE] = OSD_POS(12, 1) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_ITEM_TIMER_1] = OSD_POS(20, 1) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_ITEM_TIMER_2] = OSD_POS(1, 1) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_REMAINING_TIME_ESTIMATE] = OSD_POS(1, 2) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_ALTITUDE] = OSD_POS(23, 7) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_RSSI_VALUE] = OSD_POS(8, 1) | OSD_PROFILE_1_FLAG;
osdConfigMutable()->item_pos[OSD_MAIN_BATT_VOLTAGE] = OSD_POS(12, 1) | OSD_PROFILE_1_FLAG;
osdConfigMutable()->item_pos[OSD_ITEM_TIMER_1] = OSD_POS(20, 1) | OSD_PROFILE_1_FLAG;
osdConfigMutable()->item_pos[OSD_ITEM_TIMER_2] = OSD_POS(1, 1) | OSD_PROFILE_1_FLAG;
osdConfigMutable()->item_pos[OSD_REMAINING_TIME_ESTIMATE] = OSD_POS(1, 2) | OSD_PROFILE_1_FLAG;
osdConfigMutable()->item_pos[OSD_ALTITUDE] = OSD_POS(23, 7) | OSD_PROFILE_1_FLAG;
// and
// this set of alarm values
@ -554,7 +554,7 @@ TEST(OsdTest, TestAlarms)
TEST(OsdTest, TestElementRssi)
{
// given
osdConfigMutable()->item_pos[OSD_RSSI_VALUE] = OSD_POS(8, 1) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_RSSI_VALUE] = OSD_POS(8, 1) | OSD_PROFILE_1_FLAG;
osdConfigMutable()->rssi_alarm = 0;
// when
@ -588,7 +588,7 @@ TEST(OsdTest, TestElementRssi)
TEST(OsdTest, TestElementAmperage)
{
// given
osdConfigMutable()->item_pos[OSD_CURRENT_DRAW] = OSD_POS(1, 12) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_CURRENT_DRAW] = OSD_POS(1, 12) | OSD_PROFILE_1_FLAG;
// when
simulationBatteryAmperage = 0;
@ -621,7 +621,7 @@ TEST(OsdTest, TestElementAmperage)
TEST(OsdTest, TestElementMahDrawn)
{
// given
osdConfigMutable()->item_pos[OSD_MAH_DRAWN] = OSD_POS(1, 11) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_MAH_DRAWN] = OSD_POS(1, 11) | OSD_PROFILE_1_FLAG;
// when
simulationMahDrawn = 0;
@ -670,7 +670,7 @@ TEST(OsdTest, TestElementMahDrawn)
TEST(OsdTest, TestElementPower)
{
// given
osdConfigMutable()->item_pos[OSD_POWER] = OSD_POS(1, 10) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_POWER] = OSD_POS(1, 10) | OSD_PROFILE_1_FLAG;
// and
simulationBatteryVoltage = 100; // 10V
@ -732,7 +732,7 @@ TEST(OsdTest, TestElementPower)
TEST(OsdTest, TestElementAltitude)
{
// given
osdConfigMutable()->item_pos[OSD_ALTITUDE] = OSD_POS(23, 7) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_ALTITUDE] = OSD_POS(23, 7) | OSD_PROFILE_1_FLAG;
// and
osdConfigMutable()->units = OSD_UNIT_METRIC;
@ -784,7 +784,7 @@ TEST(OsdTest, TestElementAltitude)
TEST(OsdTest, TestElementCoreTemperature)
{
// given
osdConfigMutable()->item_pos[OSD_CORE_TEMPERATURE] = OSD_POS(1, 8) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_CORE_TEMPERATURE] = OSD_POS(1, 8) | OSD_PROFILE_1_FLAG;
// and
osdConfigMutable()->units = OSD_UNIT_METRIC;
@ -826,7 +826,7 @@ TEST(OsdTest, TestElementCoreTemperature)
TEST(OsdTest, TestElementWarningsBattery)
{
// given
osdConfigMutable()->item_pos[OSD_WARNINGS] = OSD_POS(9, 10) | VISIBLE_FLAG;
osdConfigMutable()->item_pos[OSD_WARNINGS] = OSD_POS(9, 10) | OSD_PROFILE_1_FLAG;
osdConfigMutable()->enabledWarnings = 0; // disable all warnings
osdWarnSetState(OSD_WARNING_BATTERY_WARNING, true);
osdWarnSetState(OSD_WARNING_BATTERY_CRITICAL, true);