Skip to content

Commit

Permalink
AP_Mount: Conditionally define serial_instance to fix unused variab…
Browse files Browse the repository at this point in the history
…le compile error

- Wrapped the definition of `serial_instance` with preprocessor directives to ensure it is only defined when necessary.
- This resolves the compile error caused by the unused variable when no features requiring `serial_instance` are enabled.
  • Loading branch information
mduclehcm authored and peterbarker committed Jul 24, 2024
1 parent 4904c71 commit 25a406e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/AP_Mount/AP_Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ AP_Mount::AP_Mount()
}
_singleton = this;

AP_Param::setup_object_defaults(this, var_info);
AP_Param::setup_object_defaults(this, var_info);
}

// init - detect and initialise all mounts
Expand Down Expand Up @@ -184,6 +184,8 @@ void AP_Mount::init()
set_mode_to_default(instance);
}
}

(void)serial_instance;
}

// update - give mount opportunity to update servos. should be called at 10hz or higher
Expand Down

0 comments on commit 25a406e

Please sign in to comment.