Copter: remove SPRAYER_ENABLED define in favor of just HAL_SPRAYER_ENABLED

This commit is contained in:
Peter Barker 2022-11-01 14:11:31 +11:00 committed by Randy Mackay
parent af02cef68d
commit 15673f2aa7
8 changed files with 8 additions and 15 deletions

View File

@ -11,7 +11,6 @@
//#define NAV_GUIDED DISABLED // disable external navigation computer ability to control vehicle through MAV_CMD_NAV_GUIDED mission commands
//#define PRECISION_LANDING DISABLED // disable precision landing using companion computer or IRLock sensor
//#define BEACON_ENABLED DISABLED // disable beacon support
//#define SPRAYER_ENABLED DISABLED // disable the crop sprayer feature (two ESC controlled pumps the speed of which depends upon the vehicle's horizontal velocity)
//#define WINCH_ENABLED DISABLED // disable winch support
//#define STATS_ENABLED DISABLED // disable statistics support
//#define MODE_ACRO_ENABLED DISABLED // disable acrobatic mode support

View File

@ -745,7 +745,7 @@ bool AP_Arming_Copter::arm(const AP_Arming::Method method, const bool do_arming_
hal.util->set_soft_armed(true);
#if SPRAYER_ENABLED == ENABLED
#if HAL_SPRAYER_ENABLED
// turn off sprayer's test if on
copter.sprayer.test_pump(false);
#endif

View File

@ -172,7 +172,7 @@ const AP_Scheduler::Task Copter::scheduler_tasks[] = {
#if MODE_SMARTRTL_ENABLED == ENABLED
SCHED_TASK_CLASS(ModeSmartRTL, &copter.mode_smartrtl, save_position, 3, 100, 51),
#endif
#if SPRAYER_ENABLED == ENABLED
#if HAL_SPRAYER_ENABLED
SCHED_TASK_CLASS(AC_Sprayer, &copter.sprayer, update, 3, 90, 54),
#endif
SCHED_TASK(three_hz_loop, 3, 75, 57),

View File

@ -506,7 +506,7 @@ private:
#endif
// Crop Sprayer
#if SPRAYER_ENABLED == ENABLED
#if HAL_SPRAYER_ENABLED
AC_Sprayer sprayer;
#endif

View File

@ -586,7 +586,7 @@ const AP_Param::Info Copter::var_info[] = {
GOBJECT(can_mgr, "CAN_", AP_CANManager),
#endif
#if SPRAYER_ENABLED == ENABLED
#if HAL_SPRAYER_ENABLED
// @Group: SPRAY_
// @Path: ../libraries/AC_Sprayer/AC_Sprayer.cpp
GOBJECT(sprayer, "SPRAY_", AC_Sprayer),

View File

@ -169,12 +169,6 @@
# define AUTOTUNE_ENABLED ENABLED
#endif
//////////////////////////////////////////////////////////////////////////////
// Crop Sprayer - enabled only on larger firmwares
#ifndef SPRAYER_ENABLED
# define SPRAYER_ENABLED HAL_SPRAYER_ENABLED
#endif
//////////////////////////////////////////////////////////////////////////////
// Precision Landing with companion computer or IRLock sensor
#ifndef PRECISION_LANDING

View File

@ -1791,7 +1791,7 @@ private:
// parameters
AP_Int8 _auto_enabled; // top level enable/disable control
#if SPRAYER_ENABLED == ENABLED
#if HAL_SPRAYER_ENABLED
AP_Int8 _spray_enabled; // auto spray enable/disable
#endif
AP_Int8 _wp_delay; // delay for zigzag waypoint

View File

@ -17,14 +17,14 @@ const AP_Param::GroupInfo ModeZigZag::var_info[] = {
// @User: Advanced
AP_GROUPINFO_FLAGS("AUTO_ENABLE", 1, ModeZigZag, _auto_enabled, 0, AP_PARAM_FLAG_ENABLE),
#if SPRAYER_ENABLED == ENABLED
#if HAL_SPRAYER_ENABLED
// @Param: SPRAYER
// @DisplayName: Auto sprayer in ZigZag
// @Description: Enable the auto sprayer in ZigZag mode. SPRAY_ENABLE = 1 and SERVOx_FUNCTION = 22(SprayerPump) / 23(SprayerSpinner) also must be set. This makes the sprayer on while moving to destination A or B. The sprayer will stop if the vehicle reaches destination or the flight mode is changed from ZigZag to other.
// @Values: 0:Disabled,1:Enabled
// @User: Advanced
AP_GROUPINFO("SPRAYER", 2, ModeZigZag, _spray_enabled, 0),
#endif // SPRAYER_ENABLED == ENABLED
#endif // HAL_SPRAYER_ENABLED
// @Param: WP_DELAY
// @DisplayName: The delay for zigzag waypoint
@ -576,7 +576,7 @@ void ModeZigZag::init_auto()
// spray on / off
void ModeZigZag::spray(bool b)
{
#if SPRAYER_ENABLED == ENABLED
#if HAL_SPRAYER_ENABLED
if (_spray_enabled) {
copter.sprayer.run(b);
}