Skip to content

Commit b6b5a98

Browse files
committed
fix delayed save + exclude manual mode
1 parent 013de45 commit b6b5a98

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/fc/fc_core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,10 @@ void taskMainPidLoop(timeUs_t currentTimeUs)
873873
if (!ARMING_FLAG(ARMED)) {
874874
armTime = 0;
875875

876-
processDelayedSave();
876+
// Delay saving for 0.5s to allow other functions to process save actions on disarm
877+
if (currentTimeUs - lastDisarmTimeUs > USECS_PER_SEC / 2) {
878+
processDelayedSave();
879+
}
877880
}
878881

879882
#if defined(SITL_BUILD)

src/main/flight/pid.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,8 @@ pidBank_t * pidBankMutable(void) {
12631263
bool isFixedWingLevelTrimActive(void)
12641264
{
12651265
return IS_RC_MODE_ACTIVE(BOXAUTOLEVEL) && !areSticksDeflected() &&
1266-
(FLIGHT_MODE(ANGLE_MODE) || FLIGHT_MODE(HORIZON_MODE)) && !FLIGHT_MODE(SOARING_MODE) &&
1266+
(FLIGHT_MODE(ANGLE_MODE) || FLIGHT_MODE(HORIZON_MODE)) &&
1267+
!FLIGHT_MODE(SOARING_MODE) && !FLIGHT_MODE(MANUAL_MODE) &&
12671268
!navigationIsControllingAltitude();
12681269
}
12691270

0 commit comments

Comments
 (0)