Skip to content

Commit

Permalink
Copter: use HAL_PARACHUTE_ENABLED in place of PARACHUTE_ENABLED
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Aug 7, 2024
1 parent 994e3ed commit 6d480be
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 16 deletions.
1 change: 0 additions & 1 deletion ArduCopter/APM_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//#define LOGGING_ENABLED DISABLED // disable logging to save 11K of flash space
//#define MOUNT DISABLED // disable the camera gimbal to save 8K of flash space
//#define AUTOTUNE_ENABLED DISABLED // disable the auto tune functionality to save 7k of flash
//#define PARACHUTE DISABLED // disable parachute release to save 1k of flash
//#define NAV_GUIDED DISABLED // disable external navigation computer ability to control vehicle through MAV_CMD_NAV_GUIDED mission commands
//#define MODE_ACRO_ENABLED DISABLED // disable acrobatic mode support
//#define MODE_AUTO_ENABLED DISABLED // disable auto mode support
Expand Down
2 changes: 1 addition & 1 deletion ArduCopter/Copter.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ class Copter : public AP_Vehicle {
#endif

// Parachute release
#if PARACHUTE == ENABLED
#if HAL_PARACHUTE_ENABLED
AP_Parachute parachute;
#endif

Expand Down
4 changes: 2 additions & 2 deletions ArduCopter/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ MAV_RESULT GCS_MAVLINK_Copter::handle_command_int_packet(const mavlink_command_i
case MAV_CMD_NAV_VTOL_TAKEOFF:
return handle_MAV_CMD_NAV_TAKEOFF(packet);

#if PARACHUTE == ENABLED
#if HAL_PARACHUTE_ENABLED
case MAV_CMD_DO_PARACHUTE:
return handle_MAV_CMD_DO_PARACHUTE(packet);
#endif
Expand Down Expand Up @@ -973,7 +973,7 @@ MAV_RESULT GCS_MAVLINK_Copter::handle_MAV_CMD_MISSION_START(const mavlink_comman



#if PARACHUTE == ENABLED
#if HAL_PARACHUTE_ENABLED
MAV_RESULT GCS_MAVLINK_Copter::handle_MAV_CMD_DO_PARACHUTE(const mavlink_command_int_t &packet)
{
// configure or release parachute
Expand Down
2 changes: 1 addition & 1 deletion ArduCopter/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ const AP_Param::Info Copter::var_info[] = {
GOBJECT(relay, "RELAY", AP_Relay),
#endif

#if PARACHUTE == ENABLED
#if HAL_PARACHUTE_ENABLED
// @Group: CHUTE_
// @Path: ../libraries/AP_Parachute/AP_Parachute.cpp
GOBJECT(parachute, "CHUTE_", AP_Parachute),
Expand Down
2 changes: 1 addition & 1 deletion ArduCopter/RC_Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ bool RC_Channel_Copter::do_aux_function(const AUX_FUNC ch_option, const AuxSwitc
do_aux_function_change_mode(Mode::Number::FOLLOW, ch_flag);
break;

#if PARACHUTE == ENABLED
#if HAL_PARACHUTE_ENABLED
case AUX_FUNC::PARACHUTE_ENABLE:
// Parachute enable/disable
copter.parachute.enabled(ch_flag == AuxSwitchPos::HIGH);
Expand Down
6 changes: 0 additions & 6 deletions ArduCopter/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@
# define AUTOTUNE_ENABLED ENABLED
#endif

//////////////////////////////////////////////////////////////////////////////
// Parachute release
#ifndef PARACHUTE
# define PARACHUTE HAL_PARACHUTE_ENABLED
#endif

//////////////////////////////////////////////////////////////////////////////
// Nav-Guided - allows external nav computer to control vehicle
#ifndef AC_NAV_GUIDED
Expand Down
4 changes: 2 additions & 2 deletions ArduCopter/crash_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void Copter::yaw_imbalance_check()
}
}

#if PARACHUTE == ENABLED
#if HAL_PARACHUTE_ENABLED

// Code to detect a crash main ArduCopter code
#define PARACHUTE_CHECK_TRIGGER_SEC 1 // 1 second of loss of control triggers the parachute
Expand Down Expand Up @@ -369,4 +369,4 @@ void Copter::parachute_manual_release()
parachute_release();
}

#endif // PARACHUTE == ENABLED
#endif // HAL_PARACHUTE_ENABLED
2 changes: 1 addition & 1 deletion ArduCopter/land_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void Copter::update_land_and_crash_detectors()

update_land_detector();

#if PARACHUTE == ENABLED
#if HAL_PARACHUTE_ENABLED
// check parachute
parachute_check();
#endif
Expand Down
2 changes: 1 addition & 1 deletion ArduCopter/mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ class ModeAuto : public Mode {
void do_set_home(const AP_Mission::Mission_Command& cmd);
void do_roi(const AP_Mission::Mission_Command& cmd);
void do_mount_control(const AP_Mission::Mission_Command& cmd);
#if PARACHUTE == ENABLED
#if HAL_PARACHUTE_ENABLED
void do_parachute(const AP_Mission::Mission_Command& cmd);
#endif
#if AP_WINCH_ENABLED
Expand Down

0 comments on commit 6d480be

Please sign in to comment.