diff --git a/ArduCopter/APM_Config.h b/ArduCopter/APM_Config.h index 58ba9a5c5b..77ec952ac3 100644 --- a/ArduCopter/APM_Config.h +++ b/ArduCopter/APM_Config.h @@ -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 diff --git a/ArduCopter/AP_Arming.cpp b/ArduCopter/AP_Arming.cpp index 44d04810e4..4290d56ef2 100644 --- a/ArduCopter/AP_Arming.cpp +++ b/ArduCopter/AP_Arming.cpp @@ -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 diff --git a/ArduCopter/Copter.cpp b/ArduCopter/Copter.cpp index a68d3ce890..e91d725c21 100644 --- a/ArduCopter/Copter.cpp +++ b/ArduCopter/Copter.cpp @@ -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), diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 809bf946c6..6ba09a709f 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -506,7 +506,7 @@ private: #endif // Crop Sprayer -#if SPRAYER_ENABLED == ENABLED +#if HAL_SPRAYER_ENABLED AC_Sprayer sprayer; #endif diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index ed6004aa25..fef7c40f77 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -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), diff --git a/ArduCopter/config.h b/ArduCopter/config.h index fc074d4014..73911e72a2 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -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 diff --git a/ArduCopter/mode.h b/ArduCopter/mode.h index 89978992da..1bd3307bd3 100644 --- a/ArduCopter/mode.h +++ b/ArduCopter/mode.h @@ -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 diff --git a/ArduCopter/mode_zigzag.cpp b/ArduCopter/mode_zigzag.cpp index 2bc240069d..ff186ff65e 100644 --- a/ArduCopter/mode_zigzag.cpp +++ b/ArduCopter/mode_zigzag.cpp @@ -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); }