Skip to content

Commit

Permalink
Ignore time taken to update profile with stick commands
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans committed Jan 5, 2022
1 parent bf97183 commit 9d21002
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/main/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,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

0 comments on commit 9d21002

Please sign in to comment.