Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heli Swashplate: Make motor numbers const #27012

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions libraries/AP_Motors/AP_MotorsHeli_Swash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,9 @@ const AP_Param::GroupInfo AP_MotorsHeli_Swash::var_info[] = {
};

AP_MotorsHeli_Swash::AP_MotorsHeli_Swash(uint8_t mot_0, uint8_t mot_1, uint8_t mot_2, uint8_t mot_3, uint8_t instance) :
_instance(instance)
_instance(instance),
_motor_num{mot_0, mot_1, mot_2, mot_3}
{
_motor_num[0] = mot_0;
_motor_num[1] = mot_1;
_motor_num[2] = mot_2;
_motor_num[3] = mot_3;

AP_Param::setup_object_defaults(this, var_info);
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_Motors/AP_MotorsHeli_Swash.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class AP_MotorsHeli_Swash {
float _pitchFactor[_max_num_servos]; // Pitch axis scaling of servo output based on servo position
float _collectiveFactor[_max_num_servos]; // Collective axis scaling of servo output based on servo position
float _output[_max_num_servos]; // Servo output value
uint8_t _motor_num[_max_num_servos]; // Motor function to use for output
const uint8_t _motor_num[_max_num_servos]; // Motor function to use for output
const uint8_t _instance; // Swashplate instance. Used for logging.

// Variables stored for logging
Expand Down
Loading