diff --git a/Tools/AP_Periph/AP_Periph.cpp b/Tools/AP_Periph/AP_Periph.cpp index 3091751f0a154..4175c4d3deec1 100644 --- a/Tools/AP_Periph/AP_Periph.cpp +++ b/Tools/AP_Periph/AP_Periph.cpp @@ -164,7 +164,7 @@ void AP_Periph_FW::init() compass.init(); #endif -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED baro.init(); #endif @@ -429,7 +429,7 @@ void AP_Periph_FW::update() const Vector3f &field = compass.get_field(); hal.serial(0)->printf("MAG (%d,%d,%d)\n", int(field.x), int(field.y), int(field.z)); #endif -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED hal.serial(0)->printf("BARO H=%u P=%.2f T=%.2f\n", baro.healthy(), baro.get_pressure(), baro.get_temperature()); #endif #ifdef HAL_PERIPH_ENABLE_RANGEFINDER diff --git a/Tools/AP_Periph/AP_Periph.h b/Tools/AP_Periph/AP_Periph.h index 4faed8e5bf18d..9ae4ed478e192 100644 --- a/Tools/AP_Periph/AP_Periph.h +++ b/Tools/AP_Periph/AP_Periph.h @@ -231,7 +231,7 @@ class AP_Periph_FW { Compass compass; #endif -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED AP_Baro baro; #endif @@ -457,7 +457,7 @@ class AP_Periph_FW { uint32_t last_gps_yaw_ms; #endif uint32_t last_relposheading_ms; -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED uint32_t last_baro_update_ms; #endif #ifdef HAL_PERIPH_ENABLE_AIRSPEED diff --git a/Tools/AP_Periph/Parameters.cpp b/Tools/AP_Periph/Parameters.cpp index e9f9b54f26994..f9d51fd1f9481 100644 --- a/Tools/AP_Periph/Parameters.cpp +++ b/Tools/AP_Periph/Parameters.cpp @@ -269,7 +269,7 @@ const AP_Param::Info AP_Periph_FW::var_info[] = { GOBJECT(compass, "COMPASS_", Compass), #endif -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED // Baro driver // @Group: BARO // @Path: ../libraries/AP_Baro/AP_Baro.cpp diff --git a/Tools/AP_Periph/Parameters.h b/Tools/AP_Periph/Parameters.h index 56340380345bd..6bafab4b1e901 100644 --- a/Tools/AP_Periph/Parameters.h +++ b/Tools/AP_Periph/Parameters.h @@ -119,7 +119,7 @@ class Parameters { #ifdef AP_PERIPH_HAVE_LED_WITHOUT_NOTIFY AP_Int8 led_brightness; #endif -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED AP_Int8 baro_enable; #endif #if !defined(HAL_NO_FLASH_SUPPORT) && !defined(HAL_NO_ROMFS_SUPPORT) diff --git a/Tools/AP_Periph/baro.cpp b/Tools/AP_Periph/baro.cpp index 61c296cd137fd..a4f089d633597 100644 --- a/Tools/AP_Periph/baro.cpp +++ b/Tools/AP_Periph/baro.cpp @@ -1,6 +1,6 @@ #include "AP_Periph.h" -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED /* barometer support @@ -60,4 +60,4 @@ void AP_Periph_FW::can_baro_update(void) } } -#endif // HAL_PERIPH_ENABLE_BARO +#endif // AP_PERIPH_BARO_ENABLED diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index 5705b4e2b0200..4537eb87db936 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -355,7 +355,7 @@ void AP_Periph_FW::handle_param_executeopcode(CanardInstance* canard_instance, C #if AP_PERIPH_MAG_ENABLED AP_Param::setup_object_defaults(&compass, compass.var_info); #endif -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED AP_Param::setup_object_defaults(&baro, baro.var_info); #endif #ifdef HAL_PERIPH_ENABLE_AIRSPEED @@ -1894,7 +1894,7 @@ void AP_Periph_FW::can_update() #if AP_PERIPH_BATTERY_ENABLED can_battery_update(); #endif -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED can_baro_update(); #endif #ifdef HAL_PERIPH_ENABLE_AIRSPEED diff --git a/Tools/AP_Periph/msp.cpp b/Tools/AP_Periph/msp.cpp index 3d89eedc55ada..e2a1a00e75fa6 100644 --- a/Tools/AP_Periph/msp.cpp +++ b/Tools/AP_Periph/msp.cpp @@ -48,7 +48,7 @@ void AP_Periph_FW::msp_sensor_update(void) #if AP_PERIPH_GPS_ENABLED send_msp_GPS(); #endif -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED send_msp_baro(); #endif #if AP_PERIPH_MAG_ENABLED @@ -125,7 +125,7 @@ void AP_Periph_FW::send_msp_GPS(void) #endif // AP_PERIPH_GPS_ENABLED -#ifdef HAL_PERIPH_ENABLE_BARO +#if AP_PERIPH_BARO_ENABLED /* send MSP baro packet */ @@ -149,7 +149,7 @@ void AP_Periph_FW::send_msp_baro(void) send_msp_packet(MSP2_SENSOR_BAROMETER, &p, sizeof(p)); } -#endif // HAL_PERIPH_ENABLE_BARO +#endif // AP_PERIPH_BARO_ENABLED #if AP_PERIPH_MAG_ENABLED /* diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 79d8d4aa05ac3..1d1100f759b63 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -955,7 +955,7 @@ def configure_env(self, cfg, env): AP_PERIPH_GPS_ENABLED = 1, HAL_PERIPH_ENABLE_AIRSPEED = 1, AP_PERIPH_MAG_ENABLED = 1, - HAL_PERIPH_ENABLE_BARO = 1, + AP_PERIPH_BARO_ENABLED = 1, HAL_PERIPH_ENABLE_IMU = 1, HAL_PERIPH_ENABLE_RANGEFINDER = 1, AP_PERIPH_BATTERY_ENABLED = 1,