Added a condition for enabling OSD task
This commit is contained in:
parent
0115ff15b2
commit
65bff6b7d7
|
@ -265,7 +265,7 @@ void fcTasksInit(void)
|
|||
#endif
|
||||
|
||||
#ifdef USE_OSD_SLAVE
|
||||
setTaskEnabled(TASK_OSD_SLAVE, true);
|
||||
setTaskEnabled(TASK_OSD_SLAVE, osdSlaveInitialized());
|
||||
#else
|
||||
if (sensors(SENSOR_GYRO)) {
|
||||
rescheduleTask(TASK_GYROPID, gyro.targetLooptime);
|
||||
|
@ -319,7 +319,7 @@ void fcTasksInit(void)
|
|||
setTaskEnabled(TASK_TRANSPONDER, feature(FEATURE_TRANSPONDER));
|
||||
#endif
|
||||
#ifdef USE_OSD
|
||||
setTaskEnabled(TASK_OSD, feature(FEATURE_OSD));
|
||||
setTaskEnabled(TASK_OSD, feature(FEATURE_OSD) && osdInitialized());
|
||||
#endif
|
||||
#ifdef USE_BST
|
||||
setTaskEnabled(TASK_BST_MASTER_PROCESS, true);
|
||||
|
|
|
@ -166,12 +166,13 @@ static const displayPortVTable_t max7456VTable = {
|
|||
|
||||
displayPort_t *max7456DisplayPortInit(const vcdProfile_t *vcdProfile)
|
||||
{
|
||||
if (
|
||||
#ifdef USE_OSD_SLAVE
|
||||
if (!max7456Init(max7456Config(), vcdProfile, false))
|
||||
!max7456Init(max7456Config(), vcdProfile, false)
|
||||
#else
|
||||
if (!max7456Init(max7456Config(), vcdProfile, systemConfig()->cpu_overclock))
|
||||
!max7456Init(max7456Config(), vcdProfile, systemConfig()->cpu_overclock)
|
||||
#endif
|
||||
{
|
||||
) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1131,6 +1131,11 @@ void osdInit(displayPort_t *osdDisplayPortToUse)
|
|||
resumeRefreshAt = micros() + (4 * REFRESH_1S);
|
||||
}
|
||||
|
||||
bool osdInitialized(void)
|
||||
{
|
||||
return osdDisplayPort;
|
||||
}
|
||||
|
||||
void osdUpdateAlarms(void)
|
||||
{
|
||||
// This is overdone?
|
||||
|
|
|
@ -201,6 +201,7 @@ extern timeUs_t resumeRefreshAt;
|
|||
|
||||
struct displayPort_s;
|
||||
void osdInit(struct displayPort_s *osdDisplayPort);
|
||||
bool osdInitialized(void);
|
||||
void osdResetAlarms(void);
|
||||
void osdUpdate(timeUs_t currentTimeUs);
|
||||
void osdStatSetState(uint8_t statIndex, bool enabled);
|
||||
|
|
|
@ -120,6 +120,11 @@ void osdSlaveInit(displayPort_t *osdDisplayPortToUse)
|
|||
displayResync(osdDisplayPort);
|
||||
}
|
||||
|
||||
bool osdSlaveInitialized(void)
|
||||
{
|
||||
return osdDisplayPort;
|
||||
}
|
||||
|
||||
bool osdSlaveCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTimeUs)
|
||||
{
|
||||
UNUSED(currentTimeUs);
|
||||
|
|
|
@ -29,6 +29,7 @@ extern bool osdSlaveIsLocked;
|
|||
|
||||
// init
|
||||
void osdSlaveInit(struct displayPort_s *osdDisplayPort);
|
||||
bool osdSlaveInitialized(void);
|
||||
|
||||
// task api
|
||||
bool osdSlaveCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTimeUs);
|
||||
|
|
Loading…
Reference in New Issue