mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Add core (MCU) temperature to OSD
This commit is contained in:
parent
d14cd23761
commit
f8e4d02c99
5 changed files with 47 additions and 1 deletions
|
@ -160,7 +160,8 @@ osd_unittest_SRC := \
|
|||
|
||||
osd_unittest_DEFINES := \
|
||||
USE_OSD \
|
||||
USE_RTC_TIME
|
||||
USE_RTC_TIME \
|
||||
USE_ADC_INTERNAL
|
||||
|
||||
|
||||
pg_unittest_SRC := \
|
||||
|
|
|
@ -77,6 +77,7 @@ extern "C" {
|
|||
uint32_t simulationMahDrawn;
|
||||
int32_t simulationAltitude;
|
||||
int32_t simulationVerticalSpeed;
|
||||
uint16_t simulationCoreTemperature;
|
||||
}
|
||||
|
||||
/* #define DEBUG_OSD */
|
||||
|
@ -96,6 +97,7 @@ void setDefualtSimulationState()
|
|||
simulationMahDrawn = 0;
|
||||
simulationAltitude = 0;
|
||||
simulationVerticalSpeed = 0;
|
||||
simulationCoreTemperature = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -743,6 +745,35 @@ TEST(OsdTest, TestElementAltitude)
|
|||
displayPortTestBufferSubstring(23, 7, " -2.4%c", SYM_M);
|
||||
}
|
||||
|
||||
/*
|
||||
* Tests the core temperature OSD element.
|
||||
*/
|
||||
TEST(OsdTest, TestElementCoreTemperature)
|
||||
{
|
||||
// given
|
||||
osdConfigMutable()->item_pos[OSD_CORE_TEMPERATURE] = OSD_POS(1, 8) | VISIBLE_FLAG;
|
||||
|
||||
// and
|
||||
simulationCoreTemperature = 0;
|
||||
|
||||
// when
|
||||
displayClearScreen(&testDisplayPort);
|
||||
osdRefresh(simulationTime);
|
||||
|
||||
// then
|
||||
displayPortTestBufferSubstring(1, 8, "00C");
|
||||
|
||||
// given
|
||||
simulationCoreTemperature = 33;
|
||||
|
||||
// when
|
||||
displayClearScreen(&testDisplayPort);
|
||||
osdRefresh(simulationTime);
|
||||
|
||||
// then
|
||||
displayPortTestBufferSubstring(1, 8, "33C");
|
||||
}
|
||||
|
||||
/*
|
||||
* Tests the battery notifications shown on the warnings OSD element.
|
||||
*/
|
||||
|
@ -958,4 +989,6 @@ extern "C" {
|
|||
}
|
||||
|
||||
uint16_t getRssi(void) { return rssi; }
|
||||
|
||||
uint16_t getCoreTemperatureCelsius(void) { return simulationCoreTemperature; }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue