diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index 1635f2848a..9487930a7a 100644 --- a/libraries/RC_Channel/RC_Channel.cpp +++ b/libraries/RC_Channel/RC_Channel.cpp @@ -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)