Skip to content

PreArm allow Re-Arm (without resetting PreArm AUX)#1090

Merged
nerdCopter merged 2 commits intoemuflight:masterfrom
nerdCopter:20241112_prearm_allow_rearm
Jun 30, 2025
Merged

PreArm allow Re-Arm (without resetting PreArm AUX)#1090
nerdCopter merged 2 commits intoemuflight:masterfrom
nerdCopter:20241112_prearm_allow_rearm

Conversation

@nerdCopter
Copy link
Member

  • Arming still requires PreArm switch.
  • set prearm_allow_rearm = ON, default is OFF.
  • This allows re-arming mid-air, still requiring preArm, but without need for PreArm AUX resetting.
  • TESTED SUCCESSFUL
  • Required for mid-air rearm: set small_angle = 180 (when using ACC)
  • WARNING - it is very hard to coordinate 0 throttle (required for arming) in mid-air.

originally on Betaflight PR betaflight/betaflight#14013

@nerdCopter

This comment was marked as outdated.

@nerdCopter nerdCopter marked this pull request as ready for review June 30, 2025 16:06
@nerdCopter
Copy link
Member Author

$ grep -Iirn prearm_allow_rearm src/
src/main/interface/settings.c:829:    { "prearm_allow_rearm",         VAR_UINT8  | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_ARMING_CONFIG, offsetof(armingConfig_t, prearm_allow_rearm) },
src/main/fc/rc_controls.h:152:    uint8_t prearm_allow_rearm;             // allow re-arming without need to reset the preArm AUX channel
src/main/fc/rc_controls.c:90:                  .prearm_allow_rearm = 0,
src/main/fc/fc_core.c:228:            if (IS_RC_MODE_ACTIVE(BOXPREARM) && (!ARMING_FLAG(WAS_ARMED_WITH_PREARM) || armingConfig()->prearm_allow_rearm)) {

Codacy reported: struct member 'armingConfig_s::prearm_allow_rearm' is never used.

The Codacy report is incorrect.

  • if (IS_RC_MODE_ACTIVE(BOXPREARM) && (!ARMING_FLAG(WAS_ARMED_WITH_PREARM) || armingConfig()->prearm_allow_rearm)) {

    In this line, armingConfig()->prearm_allow_rearm is read and evaluated as part of a boolean expression, which constitutes a direct use of the struct member.

@nerdCopter
Copy link
Member Author

Checked by two different AI's as good. merging.

@nerdCopter nerdCopter merged commit 26ec827 into emuflight:master Jun 30, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants