Merge pull request #6259 from etracer65/task_rx_frequency_change
Change TASK_RX frequency from 50hz (20ms) to 33hz (30ms)
This commit is contained in:
commit
a324857813
|
@ -486,7 +486,6 @@ FAST_CODE uint8_t processRcSmoothingFilter(void)
|
|||
}
|
||||
} else {
|
||||
// we have either stopped receiving rx samples (failsafe?) or the sample time is unreasonable so reset the accumulation
|
||||
validRxFrameTimeMs = 0;
|
||||
rcSmoothingResetAccumulation(&rcSmoothingData);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
|
|||
}
|
||||
|
||||
static timeUs_t lastRxTimeUs;
|
||||
currentRxRefreshRate = constrain(currentTimeUs - lastRxTimeUs, 1000, 20000);
|
||||
currentRxRefreshRate = constrain(currentTimeUs - lastRxTimeUs, 1000, 30000);
|
||||
lastRxTimeUs = currentTimeUs;
|
||||
isRXDataNew = true;
|
||||
|
||||
|
@ -459,7 +459,7 @@ cfTask_t cfTasks[TASK_COUNT] = {
|
|||
.taskName = "RX",
|
||||
.checkFunc = rxUpdateCheck,
|
||||
.taskFunc = taskUpdateRxMain,
|
||||
.desiredPeriod = TASK_PERIOD_HZ(50), // If event-based scheduling doesn't work, fallback to periodic scheduling
|
||||
.desiredPeriod = TASK_PERIOD_HZ(33), // If event-based scheduling doesn't work, fallback to periodic scheduling
|
||||
.staticPriority = TASK_PRIORITY_HIGH,
|
||||
},
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ uint32_t rcInvalidPulsPeriod[MAX_SUPPORTED_RC_CHANNEL_COUNT];
|
|||
#define PPM_AND_PWM_SAMPLE_COUNT 3
|
||||
|
||||
#define DELAY_50_HZ (1000000 / 50)
|
||||
#define DELAY_33_HZ (1000000 / 33)
|
||||
#define DELAY_10_HZ (1000000 / 10)
|
||||
#define DELAY_5_HZ (1000000 / 5)
|
||||
#define SKIP_RC_ON_SUSPEND_PERIOD 1500000 // 1.5 second period in usec (call frequency independent)
|
||||
|
@ -542,7 +543,7 @@ bool calculateRxChannelsAndUpdateFailsafe(timeUs_t currentTimeUs)
|
|||
}
|
||||
|
||||
rxDataProcessingRequired = false;
|
||||
rxNextUpdateAtUs = currentTimeUs + DELAY_50_HZ;
|
||||
rxNextUpdateAtUs = currentTimeUs + DELAY_33_HZ;
|
||||
|
||||
// only proceed when no more samples to skip and suspend period is over
|
||||
if (skipRxSamples) {
|
||||
|
|
Loading…
Reference in New Issue