Skip to content

Commit

Permalink
AP_RPM: use AP_PERIPH_RPM_ENABLED and AP_PERIPH_RPM_STREAM_ENABLED
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv-tyagi committed Feb 3, 2025
1 parent ae594cb commit 9ebc2bd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_RPM/AP_RPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void AP_RPM::Log_RPM() const
}
#endif

#ifdef HAL_PERIPH_ENABLE_RPM_STREAM
#if AP_RPM_STREAM_ENABLED
// Return the sensor id to use for streaming over DroneCAN, negative number disables
int8_t AP_RPM::get_dronecan_sensor_id(uint8_t instance) const
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_RPM/AP_RPM.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class AP_RPM
// check settings are valid
bool arming_checks(size_t buflen, char *buffer) const;

#ifdef HAL_PERIPH_ENABLE_RPM_STREAM
#if AP_RPM_STREAM_ENABLED
// Return the sensor id to use for streaming over DroneCAN, negative number disables
int8_t get_dronecan_sensor_id(uint8_t instance) const;
#endif
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_RPM/AP_RPM_Params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const AP_Param::GroupInfo AP_RPM_Params::var_info[] = {
AP_GROUPINFO("ESC_INDEX", 8, AP_RPM_Params, esc_telem_outbound_index, 0),
#endif

#if AP_RPM_DRONECAN_ENABLED || defined(HAL_PERIPH_ENABLE_RPM_STREAM)
#if AP_RPM_DRONECAN_ENABLED || AP_PERIPH_RPM_STREAM_ENABLED
// @Param: DC_ID
// @DisplayName: DroneCAN Sensor ID
// @Description: DroneCAN sensor ID to assign to this backend
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_RPM/AP_RPM_Params.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AP_RPM_Params {
#if AP_RPM_ESC_TELEM_OUTBOUND_ENABLED
AP_Int8 esc_telem_outbound_index;
#endif
#if AP_RPM_DRONECAN_ENABLED || defined(HAL_PERIPH_ENABLE_RPM_STREAM)
#if AP_RPM_DRONECAN_ENABLED || AP_RPM_STREAM_ENABLED
AP_Int8 dronecan_sensor_id;
#endif
static const struct AP_Param::GroupInfo var_info[];
Expand Down
4 changes: 4 additions & 0 deletions libraries/AP_RPM/AP_RPM_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@
#if AP_RPM_DRONECAN_ENABLED && !HAL_ENABLE_DRONECAN_DRIVERS
#error AP_RPM_DRONECAN_ENABLED requires HAL_ENABLE_DRONECAN_DRIVERS
#endif

#ifndef AP_RPM_STREAM_ENABLED
#define AP_RPM_STREAM_ENABLED 0
#endif

0 comments on commit 9ebc2bd

Please sign in to comment.