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
+2 -13
View File
@@ -40,6 +40,7 @@
*/
#include <px4_config.h>
#include <px4_defines.h>
#include <drivers/device/i2c.h>
@@ -90,12 +91,6 @@
#define PX4FLOW_MAX_DISTANCE 5.0f
#define PX4FLOW_MIN_DISTANCE 0.3f
/* 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
@@ -226,7 +221,7 @@ PX4FLOW::~PX4FLOW()
int
PX4FLOW::init()
{
int ret = ERROR;
int ret = PX4_ERROR;
/* do I2C init (and probe) first */
if (I2C::init() != OK) {
@@ -663,12 +658,6 @@ PX4FLOW::print_info()
namespace px4flow
{
/* oddly, ERROR is not defined for c++ */
#ifdef ERROR
# undef ERROR
#endif
const int ERROR = -1;
PX4FLOW *g_dev = nullptr;
bool start_in_progress = false;