1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

cosmetic changes & minor improvements on speed negotiation logic

This commit is contained in:
tbs-fpv 2021-05-20 11:09:35 +08:00
parent 55288dc2e1
commit 761a0d2b1f
3 changed files with 30 additions and 36 deletions

View file

@ -267,13 +267,6 @@ static void taskCameraControl(uint32_t currentTime)
}
#endif
#ifdef USE_CRSF_V3
static void taskSpeedNegotiation(uint32_t currentTime)
{
speedNegotiationProcess(currentTime);
}
#endif
void tasksInit(void)
{
schedulerInit();
@ -419,7 +412,8 @@ void tasksInit(void)
#endif
#ifdef USE_CRSF_V3
setTaskEnabled(TASK_SPEED_NEGOTIATION, true);
const bool useCRSF = rxRuntimeState.serialrxProvider == SERIALRX_CRSF;
setTaskEnabled(TASK_SPEED_NEGOTIATION, useCRSF);
#endif
}
@ -541,7 +535,7 @@ task_t tasks[TASK_COUNT] = {
#endif
#ifdef USE_CRSF_V3
[TASK_SPEED_NEGOTIATION] = DEFINE_TASK("SPEED_NEGOTIATION", NULL, NULL, taskSpeedNegotiation, TASK_PERIOD_HZ(100), TASK_PRIORITY_IDLE),
[TASK_SPEED_NEGOTIATION] = DEFINE_TASK("SPEED_NEGOTIATION", NULL, NULL, speedNegotiationProcess, TASK_PERIOD_HZ(100), TASK_PRIORITY_IDLE),
#endif
};