RC_Channel: use HAL_SPRAYER_ENABLED

This commit is contained in:
Andrew Tridgell 2020-01-18 09:59:20 +11:00
parent ce4120e803
commit 32221e2207

View File

@ -678,6 +678,7 @@ void RC_Channel::do_aux_function_relay(const uint8_t relay, bool val)
void RC_Channel::do_aux_function_sprayer(const aux_switch_pos_t ch_flag)
{
#if HAL_SPRAYER_ENABLED
AC_Sprayer *sprayer = AP::sprayer();
if (sprayer == nullptr) {
return;
@ -686,6 +687,7 @@ void RC_Channel::do_aux_function_sprayer(const aux_switch_pos_t ch_flag)
sprayer->run(ch_flag == HIGH);
// if we are disarmed the pilot must want to test the pump
sprayer->test_pump((ch_flag == HIGH) && !hal.util->get_soft_armed());
#endif // HAL_SPRAYER_ENABLED
}
void RC_Channel::do_aux_function_gripper(const aux_switch_pos_t ch_flag)