diff --git a/Tools/AP_Periph/AP_Periph.cpp b/Tools/AP_Periph/AP_Periph.cpp index 965a59edaa..6298e5c635 100644 --- a/Tools/AP_Periph/AP_Periph.cpp +++ b/Tools/AP_Periph/AP_Periph.cpp @@ -223,7 +223,7 @@ void AP_Periph_FW::init() } #endif -#ifdef HAL_PERIPH_ENABLE_PRX +#if HAL_PROXIMITY_ENABLED if (proximity.get_type(0) != AP_Proximity::Type::None && g.proximity_port >= 0) { auto *uart = hal.serial(g.proximity_port); if (uart != nullptr) { @@ -564,4 +564,4 @@ AP_Periph_FW& AP::periph() return *AP_Periph_FW::get_singleton(); } -AP_HAL_MAIN(); \ No newline at end of file +AP_HAL_MAIN(); diff --git a/Tools/AP_Periph/AP_Periph.h b/Tools/AP_Periph/AP_Periph.h index 76b78f4797..807459482f 100644 --- a/Tools/AP_Periph/AP_Periph.h +++ b/Tools/AP_Periph/AP_Periph.h @@ -209,7 +209,7 @@ public: uint32_t last_sample_ms; #endif -#ifdef HAL_PERIPH_ENABLE_PRX +#if HAL_PROXIMITY_ENABLED AP_Proximity proximity; #endif diff --git a/Tools/AP_Periph/Parameters.cpp b/Tools/AP_Periph/Parameters.cpp index 57156a3645..755be6c67c 100644 --- a/Tools/AP_Periph/Parameters.cpp +++ b/Tools/AP_Periph/Parameters.cpp @@ -475,7 +475,7 @@ const AP_Param::Info AP_Periph_FW::var_info[] = { GOBJECT(efi, "EFI", AP_EFI), #endif -#ifdef HAL_PERIPH_ENABLE_PRX +#if HAL_PROXIMITY_ENABLED // @Param: PRX_BAUDRATE // @DisplayName: Proximity Sensor serial baudrate // @Description: Proximity Sensor serial baudrate. @@ -507,7 +507,7 @@ const AP_Param::Info AP_Periph_FW::var_info[] = { // @Group: PRX // @Path: ../libraries/AP_Proximity/AP_Proximity.cpp GOBJECT(proximity, "PRX", AP_Proximity), -#endif +#endif // HAL_PROXIMITY_ENABLED #if HAL_NMEA_OUTPUT_ENABLED // @Group: NMEA_ diff --git a/Tools/AP_Periph/Parameters.h b/Tools/AP_Periph/Parameters.h index c2ad8e678c..fb86ada1b8 100644 --- a/Tools/AP_Periph/Parameters.h +++ b/Tools/AP_Periph/Parameters.h @@ -109,7 +109,7 @@ public: AP_Int16 rangefinder_max_rate; #endif -#ifdef HAL_PERIPH_ENABLE_PRX +#if HAL_PROXIMITY_ENABLED AP_Int32 proximity_baud; AP_Int8 proximity_port; AP_Int16 proximity_max_rate; @@ -191,4 +191,4 @@ public: Parameters() {} }; -extern const AP_Param::Info var_info[]; \ No newline at end of file +extern const AP_Param::Info var_info[]; diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index 43972a15d0..2c7fb6e8d3 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -2392,7 +2392,7 @@ void AP_Periph_FW::can_rangefinder_update(void) void AP_Periph_FW::can_proximity_update() { -#ifdef HAL_PERIPH_ENABLE_PRX +#if HAL_PROXIMITY_ENABLED if (proximity.get_type(0) == AP_Proximity::Type::None) { return; } diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index e107c325f3..69b4b9f02f 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -833,6 +833,7 @@ class sitl_periph_gps(sitl): AP_STATS_ENABLED = 0, HAL_SUPPORT_RCOUT_SERIAL = 0, AP_CAN_SLCAN_ENABLED = 0, + HAL_PROXIMITY_ENABLED = 0, )