Skip to content

Commit

Permalink
Blimp: Simplify motors allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleRos committed Nov 6, 2023
1 parent a110c19 commit c489841
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Blimp/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,7 @@ const char* Blimp::get_frame_string()
*/
void Blimp::allocate_motors(void)
{
switch ((Fins::motor_frame_class)g2.frame_class.get()) {
case Fins::MOTOR_FRAME_FOUR_MOTOR:
motors = new Fins(blimp.scheduler.get_loop_rate_hz(), Fins::MOTOR_FRAME_FOUR_MOTOR);
break;
case Fins::MOTOR_FRAME_FISHBLIMP:
default:
motors = new Fins(blimp.scheduler.get_loop_rate_hz(), Fins::MOTOR_FRAME_FISHBLIMP);
break;
}
motors = new Fins(blimp.scheduler.get_loop_rate_hz(), (Fins::motor_frame_class)g2.frame_class.get());
if (motors == nullptr) {
AP_BoardConfig::allocation_error("FRAME_CLASS=%u", (unsigned)g2.frame_class.get());
}
Expand Down

0 comments on commit c489841

Please sign in to comment.