mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 05:13:34 +08:00
ERROR macro: get rid of the many 'oddly, ERROR is not defined for c++', use PX4_ERROR
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_config.h>
|
||||
#include <px4_defines.h>
|
||||
|
||||
#include <drivers/device/i2c.h>
|
||||
|
||||
@@ -115,12 +116,6 @@ enum LIS3MDL_BUS {
|
||||
LIS3MDL_BUS_SPI
|
||||
};
|
||||
|
||||
/* oddly, ERROR is not defined for c++ */
|
||||
#ifdef ERROR
|
||||
# undef ERROR
|
||||
#endif
|
||||
static const int ERROR = -1;
|
||||
|
||||
#ifndef CONFIG_SCHED_WORKQUEUE
|
||||
# error This requires CONFIG_SCHED_WORKQUEUE.
|
||||
#endif
|
||||
@@ -406,7 +401,7 @@ LIS3MDL::~LIS3MDL()
|
||||
int
|
||||
LIS3MDL::init()
|
||||
{
|
||||
int ret = ERROR;
|
||||
int ret = PX4_ERROR;
|
||||
|
||||
ret = CDev::init();
|
||||
|
||||
@@ -1179,7 +1174,7 @@ out:
|
||||
if (check_scale()) {
|
||||
/* failed */
|
||||
warnx("FAILED: SCALE");
|
||||
ret = ERROR;
|
||||
ret = PX4_ERROR;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1325,12 +1320,6 @@ LIS3MDL::print_info()
|
||||
namespace lis3mdl
|
||||
{
|
||||
|
||||
/* oddly, ERROR is not defined for c++ */
|
||||
#ifdef ERROR
|
||||
# undef ERROR
|
||||
#endif
|
||||
const int ERROR = -1;
|
||||
|
||||
/*
|
||||
list of supported bus configurations
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user