1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 17:55:30 +03:00

Add expediting of OSD task

This commit is contained in:
Steve Evans 2022-01-14 03:42:10 +00:00
parent e7b61a928f
commit db904b4a75
6 changed files with 27 additions and 0 deletions

View file

@ -278,6 +278,8 @@ scheduler_unittest_SRC := \
$(USER_DIR)/common/crc.c \
$(USER_DIR)/common/streambuf.c
scheduler_unittest_DEFINES := \
USE_OSD=
sensor_gyro_unittest_SRC := \
$(USER_DIR)/sensors/gyro.c \

View file

@ -512,6 +512,7 @@ extern "C" {
bool taskUpdateRxMainInProgress() { return true; }
void schedulerIgnoreTaskStateTime(void) { }
void schedulerIgnoreTaskExecRate(void) { }
bool schedulerGetIgnoreTaskExecTime() { return false; }
void schedulerIgnoreTaskExecTime(void) { }
void schedulerSetNextStateTime(timeDelta_t) {}

View file

@ -1377,5 +1377,6 @@ extern "C" {
void schedulerIgnoreTaskStateTime(void) { }
void schedulerIgnoreTaskExecRate(void) { }
void schedulerIgnoreTaskExecTime(void) { }
bool schedulerGetIgnoreTaskExecTime() { return false; }
void schedulerSetNextStateTime(timeDelta_t) {}
}

View file

@ -37,6 +37,8 @@ const int TEST_UPDATE_RX_CHECK_TIME = 34;
const int TEST_UPDATE_RX_MAIN_TIME = 1;
const int TEST_IMU_UPDATE_TIME = 5;
const int TEST_DISPATCH_TIME = 1;
const int TEST_UPDATE_OSD_CHECK_TIME = 5;
const int TEST_UPDATE_OSD_TIME = 30;
#define TASK_COUNT_UNITTEST (TASK_BATTERY_VOLTAGE + 1)
#define TASK_PERIOD_HZ(hz) (1000000 / (hz))
@ -76,6 +78,8 @@ extern "C" {
void taskUpdateRxMain(timeUs_t) { simulatedTime += TEST_UPDATE_RX_MAIN_TIME; }
void imuUpdateAttitude(timeUs_t) { simulatedTime += TEST_IMU_UPDATE_TIME; }
void dispatchProcess(timeUs_t) { simulatedTime += TEST_DISPATCH_TIME; }
bool osdUpdateCheck(timeUs_t, timeDelta_t) { simulatedTime += TEST_UPDATE_OSD_CHECK_TIME; return false; }
void osdUpdate(timeUs_t) { simulatedTime += TEST_UPDATE_OSD_TIME; }
void resetGyroTaskTestFlags(void) {
taskGyroRan = false;
@ -156,6 +160,13 @@ extern "C" {
.taskFunc = taskUpdateBatteryVoltage,
.desiredPeriodUs = TASK_PERIOD_HZ(50),
.staticPriority = TASK_PRIORITY_MEDIUM,
},
[TASK_OSD] = {
.taskName = "OSD",
.checkFunc = osdUpdateCheck,
.taskFunc = osdUpdate,
.desiredPeriodUs = TASK_PERIOD_HZ(12),
.staticPriority = TASK_PRIORITY_LOW,
}
};