mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 07:09:48 +08:00
cleanup sensors_init: remove the static const int ERROR and use PX4_ERROR
This commit is contained in:
@@ -66,12 +66,6 @@ sensors_init(void)
|
||||
|
||||
#else
|
||||
|
||||
/* oddly, ERROR is not defined for c++ */
|
||||
#ifdef ERROR
|
||||
# undef ERROR
|
||||
#endif
|
||||
static const int ERROR = -1;
|
||||
|
||||
/**
|
||||
* Do accel-related initialisation.
|
||||
*/
|
||||
@@ -126,7 +120,7 @@ accel_init()
|
||||
|
||||
if (!h_accel.isValid()) {
|
||||
warnx("FATAL: no accelerometer found: %s (%d)", ACCEL0_DEVICE_PATH, h_accel.getError());
|
||||
return ERROR;
|
||||
return PX4_ERROR;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -148,7 +142,7 @@ gyro_init()
|
||||
|
||||
if (!h_gyro.isValid()) {
|
||||
warnx("FATAL: no gyro found: %s (%d)", GYRO0_DEVICE_PATH, h_gyro.getError());
|
||||
return ERROR;
|
||||
return PX4_ERROR;
|
||||
|
||||
}
|
||||
|
||||
@@ -171,7 +165,7 @@ mag_init()
|
||||
|
||||
if (!h_mag.isValid()) {
|
||||
warnx("FATAL: no magnetometer found: %s (%d)", MAG0_DEVICE_PATH, h_mag.getError());
|
||||
return ERROR;
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
/* try different mag sampling rates */
|
||||
@@ -193,7 +187,7 @@ mag_init()
|
||||
|
||||
} else {
|
||||
warnx("FATAL: mag sampling rate could not be set");
|
||||
return ERROR;
|
||||
return PX4_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +202,7 @@ baro_init()
|
||||
|
||||
if (!h_baro.isValid()) {
|
||||
warnx("FATAL: No barometer found: %s (%d)", BARO0_DEVICE_PATH, h_baro.getError());
|
||||
return ERROR;
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
/* set the driver to poll at 150Hz */
|
||||
|
||||
Reference in New Issue
Block a user