mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
parent
e7d2e84348
commit
2bb561aa61
4 changed files with 39 additions and 2 deletions
|
@ -155,10 +155,12 @@ osd_unittest_SRC := \
|
|||
$(USER_DIR)/drivers/display.c \
|
||||
$(USER_DIR)/common/maths.c \
|
||||
$(USER_DIR)/common/printf.c \
|
||||
$(USER_DIR)/common/time.c \
|
||||
$(USER_DIR)/fc/runtime_config.c
|
||||
|
||||
osd_unittest_DEFINES := \
|
||||
USE_OSD
|
||||
USE_OSD \
|
||||
USE_RTC_TIME
|
||||
|
||||
|
||||
parameter_groups_unittest_SRC := \
|
||||
|
|
|
@ -29,6 +29,8 @@ extern "C" {
|
|||
|
||||
#include "config/parameter_group_ids.h"
|
||||
|
||||
#include "common/time.h"
|
||||
|
||||
#include "drivers/max7456_symbols.h"
|
||||
|
||||
#include "fc/config.h"
|
||||
|
@ -291,6 +293,7 @@ TEST(OsdTest, TestStatsImperial)
|
|||
osdConfigMutable()->enabled_stats[OSD_STAT_END_BATTERY] = true;
|
||||
osdConfigMutable()->enabled_stats[OSD_STAT_TIMER_1] = true;
|
||||
osdConfigMutable()->enabled_stats[OSD_STAT_TIMER_2] = true;
|
||||
osdConfigMutable()->enabled_stats[OSD_STAT_RTC_DATE_TIME] = true;
|
||||
osdConfigMutable()->enabled_stats[OSD_STAT_MAX_DISTANCE] = true;
|
||||
osdConfigMutable()->enabled_stats[OSD_STAT_BLACKBOX_NUMBER] = false;
|
||||
|
||||
|
@ -310,6 +313,18 @@ TEST(OsdTest, TestStatsImperial)
|
|||
// a GPS fix is present
|
||||
stateFlags |= GPS_FIX | GPS_FIX_HOME;
|
||||
|
||||
// and
|
||||
// this RTC time
|
||||
dateTime_t dateTime;
|
||||
dateTime.year = 2017;
|
||||
dateTime.month = 11;
|
||||
dateTime.day = 19;
|
||||
dateTime.hours = 10;
|
||||
dateTime.minutes = 12;
|
||||
dateTime.seconds = 0;
|
||||
dateTime.millis = 0;
|
||||
rtcSetDateTime(&dateTime);
|
||||
|
||||
// when
|
||||
// the craft is armed
|
||||
doTestArm();
|
||||
|
@ -347,6 +362,7 @@ TEST(OsdTest, TestStatsImperial)
|
|||
// then
|
||||
// statistics screen should display the following
|
||||
int row = 3;
|
||||
displayPortTestBufferSubstring(2, row++, "2017-11-19 10:12:");
|
||||
displayPortTestBufferSubstring(2, row++, "TOTAL ARM : 00:05.00");
|
||||
displayPortTestBufferSubstring(2, row++, "LAST ARM : 00:03");
|
||||
displayPortTestBufferSubstring(2, row++, "MAX SPEED : 28");
|
||||
|
@ -397,6 +413,7 @@ TEST(OsdTest, TestStatsMetric)
|
|||
// then
|
||||
// statistics screen should display the following
|
||||
int row = 3;
|
||||
displayPortTestBufferSubstring(2, row++, "2017-11-19 10:12:");
|
||||
displayPortTestBufferSubstring(2, row++, "TOTAL ARM : 00:07.50");
|
||||
displayPortTestBufferSubstring(2, row++, "LAST ARM : 00:02");
|
||||
displayPortTestBufferSubstring(2, row++, "MAX SPEED : 28");
|
||||
|
@ -873,6 +890,10 @@ extern "C" {
|
|||
return simulationTime;
|
||||
}
|
||||
|
||||
uint32_t millis() {
|
||||
return micros() / 1000;
|
||||
}
|
||||
|
||||
bool isBeeperOn() {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue