5
0
mirror of https://github.com/ArduPilot/ardupilot synced 2025-03-08 14:43:57 -04:00

Copter: integrate sprayer pump test

This commit is contained in:
Randy Mackay 2013-09-11 17:05:25 +09:00
parent 5e7a6b3b98
commit a68966e077
2 changed files with 7 additions and 0 deletions

View File

@ -267,6 +267,8 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag)
#if SPRAYER == ENABLED #if SPRAYER == ENABLED
case AUX_SWITCH_SPRAYER: case AUX_SWITCH_SPRAYER:
sprayer.enable(ch_flag == AUX_SWITCH_HIGH); sprayer.enable(ch_flag == AUX_SWITCH_HIGH);
// if we are disarmed the pilot must want to test the pump
sprayer.test_pump((ch_flag == AUX_SWITCH_HIGH) && !motors.armed());
break; break;
#endif #endif

View File

@ -194,6 +194,11 @@ static void init_arm_motors()
return; return;
} }
#if SPRAYER == ENABLED
// turn off sprayer's test if on
sprayer.test_pump(false);
#endif
// enable output to motors // enable output to motors
output_min(); output_min();