Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore time taken to update EEPROM as otherwise stick commands can ups… #11228

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,9 @@ void ensureEEPROMStructureIsValid(void)

void saveConfigAndNotify(void)
{
// The write to EEPROM will cause a big delay in the current task, so ignore
schedulerIgnoreTaskExecTime();

writeEEPROM();
readEEPROM();
beeperConfirmationBeeps(1);
Expand Down Expand Up @@ -803,6 +806,9 @@ void changePidProfileFromCellCount(uint8_t cellCount)

void changePidProfile(uint8_t pidProfileIndex)
{
// The config switch will cause a big enough delay in the current task to upset the scheduler
schedulerIgnoreTaskExecTime();

if (pidProfileIndex < PID_PROFILE_COUNT) {
systemConfigMutable()->pidProfileIndex = pidProfileIndex;
loadPidProfile();
Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

// taskUpdateRxMain() has occasional peaks in execution time so normal moving average duration estimation doesn't work
// Decay the estimated max task duration by 1/(1 << RX_TASK_DECAY_SHIFT) on every invocation
#define RX_TASK_DECAY_SHIFT 5
#define RX_TASK_DECAY_SHIFT 7
// Add a margin to the task duration estimation
#define RX_TASK_MARGIN 1

Expand Down
6 changes: 3 additions & 3 deletions src/main/rx/expresslrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,15 +840,15 @@ bool expressLrsSpiInit(const struct rxSpiConfig_s *rxConfig, struct rxRuntimeSta
}

rxSpiCommonIOInit(rxConfig);
rxRuntimeState->channelCount = ELRS_MAX_CHANNELS;
extiConfig->ioConfig = IOCFG_IPD;
extiConfig->trigger = BETAFLIGHT_EXTI_TRIGGER_RISING;

if (rxExpressLrsSpiConfig()->resetIoTag) {
receiver.resetPin = IOGetByTag(rxExpressLrsSpiConfig()->resetIoTag);
} else {
} else {
receiver.resetPin = IO_NONE;
}

Expand Down