void supervisorArm(void) { if (motorsArm()) { supervisorData.state = STATE_ARMED | (supervisorData.state & (STATE_LOW_BATTERY1 | STATE_LOW_BATTERY2)); AQ_NOTICE("Armed\n"); #ifdef USE_SIGNALING signalingOnetimeEvent(SIG_EVENT_OT_ARMING); #endif } else { motorsDisarm(); AQ_NOTICE("Arm motors failed - disarmed\n"); } }
void supervisorArm(void) { uint8_t rcStat = rcCheckValidController(); if (rcStat) { AQ_NOTICE("Error: Can't arm due to RC error(s):\n"); rcReportAllErrors(rcStat); } else if (rcIsSwitchActive(NAV_CTRL_AH) || rcIsSwitchActive(NAV_CTRL_PH) || rcIsSwitchActive(NAV_CTRL_MISN)) AQ_NOTICE("Error: Can't arm, not in manual flight mode.\n"); else if (rcIsSwitchActive(NAV_CTRL_HOM_SET) || rcIsSwitchActive(NAV_CTRL_HOM_GO)) AQ_NOTICE("Error: Can't arm, home command active.\n"); else if (rcIsSwitchActive(NAV_CTRL_HF_SET) || rcIsSwitchActive(NAV_CTRL_HF_LOCK)) AQ_NOTICE("Error: Can't arm, heading-free mode active.\n"); else if (motorsArm()) { supervisorData.state = STATE_ARMED | (supervisorData.state & (STATE_LOW_BATTERY1 | STATE_LOW_BATTERY2)); AQ_NOTICE("Armed\n"); #ifdef USE_SIGNALING signalingOnetimeEvent(SIG_EVENT_OT_ARMING); #endif } else { motorsDisarm(); AQ_NOTICE("Error: Arm motors failed - disarmed.\n"); } }