Skip to content

Commit dba4136

Browse files
shiv-tyagipeterbarker
authored andcommitted
Tools: create and use AP_PERIPH_BARO_ENABLED
1 parent 4fca0cc commit dba4136

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

Tools/AP_Periph/AP_Periph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void AP_Periph_FW::init()
164164
compass.init();
165165
#endif
166166

167-
#ifdef HAL_PERIPH_ENABLE_BARO
167+
#if AP_PERIPH_BARO_ENABLED
168168
baro.init();
169169
#endif
170170

@@ -429,7 +429,7 @@ void AP_Periph_FW::update()
429429
const Vector3f &field = compass.get_field();
430430
hal.serial(0)->printf("MAG (%d,%d,%d)\n", int(field.x), int(field.y), int(field.z));
431431
#endif
432-
#ifdef HAL_PERIPH_ENABLE_BARO
432+
#if AP_PERIPH_BARO_ENABLED
433433
hal.serial(0)->printf("BARO H=%u P=%.2f T=%.2f\n", baro.healthy(), baro.get_pressure(), baro.get_temperature());
434434
#endif
435435
#ifdef HAL_PERIPH_ENABLE_RANGEFINDER

Tools/AP_Periph/AP_Periph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class AP_Periph_FW {
231231
Compass compass;
232232
#endif
233233

234-
#ifdef HAL_PERIPH_ENABLE_BARO
234+
#if AP_PERIPH_BARO_ENABLED
235235
AP_Baro baro;
236236
#endif
237237

@@ -457,7 +457,7 @@ class AP_Periph_FW {
457457
uint32_t last_gps_yaw_ms;
458458
#endif
459459
uint32_t last_relposheading_ms;
460-
#ifdef HAL_PERIPH_ENABLE_BARO
460+
#if AP_PERIPH_BARO_ENABLED
461461
uint32_t last_baro_update_ms;
462462
#endif
463463
#ifdef HAL_PERIPH_ENABLE_AIRSPEED

Tools/AP_Periph/Parameters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ const AP_Param::Info AP_Periph_FW::var_info[] = {
269269
GOBJECT(compass, "COMPASS_", Compass),
270270
#endif
271271

272-
#ifdef HAL_PERIPH_ENABLE_BARO
272+
#if AP_PERIPH_BARO_ENABLED
273273
// Baro driver
274274
// @Group: BARO
275275
// @Path: ../libraries/AP_Baro/AP_Baro.cpp

Tools/AP_Periph/Parameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class Parameters {
119119
#ifdef AP_PERIPH_HAVE_LED_WITHOUT_NOTIFY
120120
AP_Int8 led_brightness;
121121
#endif
122-
#ifdef HAL_PERIPH_ENABLE_BARO
122+
#if AP_PERIPH_BARO_ENABLED
123123
AP_Int8 baro_enable;
124124
#endif
125125
#if !defined(HAL_NO_FLASH_SUPPORT) && !defined(HAL_NO_ROMFS_SUPPORT)

Tools/AP_Periph/baro.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "AP_Periph.h"
22

3-
#ifdef HAL_PERIPH_ENABLE_BARO
3+
#if AP_PERIPH_BARO_ENABLED
44

55
/*
66
barometer support
@@ -60,4 +60,4 @@ void AP_Periph_FW::can_baro_update(void)
6060
}
6161
}
6262

63-
#endif // HAL_PERIPH_ENABLE_BARO
63+
#endif // AP_PERIPH_BARO_ENABLED

Tools/AP_Periph/can.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ void AP_Periph_FW::handle_param_executeopcode(CanardInstance* canard_instance, C
355355
#if AP_PERIPH_MAG_ENABLED
356356
AP_Param::setup_object_defaults(&compass, compass.var_info);
357357
#endif
358-
#ifdef HAL_PERIPH_ENABLE_BARO
358+
#if AP_PERIPH_BARO_ENABLED
359359
AP_Param::setup_object_defaults(&baro, baro.var_info);
360360
#endif
361361
#ifdef HAL_PERIPH_ENABLE_AIRSPEED
@@ -1894,7 +1894,7 @@ void AP_Periph_FW::can_update()
18941894
#if AP_PERIPH_BATTERY_ENABLED
18951895
can_battery_update();
18961896
#endif
1897-
#ifdef HAL_PERIPH_ENABLE_BARO
1897+
#if AP_PERIPH_BARO_ENABLED
18981898
can_baro_update();
18991899
#endif
19001900
#ifdef HAL_PERIPH_ENABLE_AIRSPEED

Tools/AP_Periph/msp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void AP_Periph_FW::msp_sensor_update(void)
4848
#if AP_PERIPH_GPS_ENABLED
4949
send_msp_GPS();
5050
#endif
51-
#ifdef HAL_PERIPH_ENABLE_BARO
51+
#if AP_PERIPH_BARO_ENABLED
5252
send_msp_baro();
5353
#endif
5454
#if AP_PERIPH_MAG_ENABLED
@@ -125,7 +125,7 @@ void AP_Periph_FW::send_msp_GPS(void)
125125
#endif // AP_PERIPH_GPS_ENABLED
126126

127127

128-
#ifdef HAL_PERIPH_ENABLE_BARO
128+
#if AP_PERIPH_BARO_ENABLED
129129
/*
130130
send MSP baro packet
131131
*/
@@ -149,7 +149,7 @@ void AP_Periph_FW::send_msp_baro(void)
149149

150150
send_msp_packet(MSP2_SENSOR_BAROMETER, &p, sizeof(p));
151151
}
152-
#endif // HAL_PERIPH_ENABLE_BARO
152+
#endif // AP_PERIPH_BARO_ENABLED
153153

154154
#if AP_PERIPH_MAG_ENABLED
155155
/*

Tools/ardupilotwaf/boards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ def configure_env(self, cfg, env):
955955
AP_PERIPH_GPS_ENABLED = 1,
956956
HAL_PERIPH_ENABLE_AIRSPEED = 1,
957957
AP_PERIPH_MAG_ENABLED = 1,
958-
HAL_PERIPH_ENABLE_BARO = 1,
958+
AP_PERIPH_BARO_ENABLED = 1,
959959
HAL_PERIPH_ENABLE_IMU = 1,
960960
HAL_PERIPH_ENABLE_RANGEFINDER = 1,
961961
AP_PERIPH_BATTERY_ENABLED = 1,

0 commit comments

Comments
 (0)