ERROR macro: get rid of the many 'oddly, ERROR is not defined for c++', use PX4_ERROR

This commit is contained in:
Beat Küng
2016-09-30 13:50:51 +02:00
committed by Julian Oes
parent c606554da3
commit 241fd629ce
42 changed files with 207 additions and 504 deletions
+3 -14
View File
@@ -38,6 +38,7 @@
*/
#include <px4_config.h>
#include <px4_defines.h>
#include <drivers/device/i2c.h>
@@ -123,12 +124,6 @@ enum HMC5883_BUS {
HMC5883_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
@@ -416,7 +411,7 @@ HMC5883::~HMC5883()
int
HMC5883::init()
{
int ret = ERROR;
int ret = PX4_ERROR;
ret = CDev::init();
@@ -1236,7 +1231,7 @@ out:
if (check_scale()) {
/* failed */
warnx("FAILED: SCALE");
ret = ERROR;
ret = PX4_ERROR;
}
}
@@ -1439,12 +1434,6 @@ HMC5883::print_info()
namespace hmc5883
{
/* oddly, ERROR is not defined for c++ */
#ifdef ERROR
# undef ERROR
#endif
const int ERROR = -1;
/*
list of supported bus configurations
*/