mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 00:53: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:
@@ -39,8 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_config.h>
|
||||
|
||||
//#include <drivers/device/i2c.h>
|
||||
#include <px4_defines.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
@@ -55,10 +54,6 @@
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
|
||||
//#include <nuttx/arch.h>
|
||||
//#include <nuttx/wqueue.h>
|
||||
//#include <nuttx/clock.h>
|
||||
|
||||
#include <px4_workqueue.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
@@ -79,12 +74,6 @@
|
||||
/* Default I2C bus */
|
||||
#define PX4_I2C_BUS_DEFAULT PX4_I2C_BUS_EXPANSION
|
||||
|
||||
/* 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
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <px4_defines.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
@@ -72,12 +73,6 @@ using namespace DriverFramework;
|
||||
#define TIMEOUT_5HZ 500
|
||||
#define RATE_MEASUREMENT_PERIOD 5000000
|
||||
|
||||
/* oddly, ERROR is not defined for c++ */
|
||||
#ifdef ERROR
|
||||
# undef ERROR
|
||||
#endif
|
||||
static const int ERROR = -1;
|
||||
|
||||
/* class for dynamic allocation of satellite info data */
|
||||
class GPS_Sat_Info
|
||||
{
|
||||
@@ -220,7 +215,7 @@ GPSSIM::~GPSSIM()
|
||||
int
|
||||
GPSSIM::init()
|
||||
{
|
||||
int ret = ERROR;
|
||||
int ret = PX4_ERROR;
|
||||
|
||||
/* do regular cdev init */
|
||||
if (VirtDevObj::init() != OK) {
|
||||
|
||||
Reference in New Issue
Block a user