mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 08:55:51 +08:00
[airborne] std.h: define NULL if not already done
This commit is contained in:
+9
-1
@@ -61,6 +61,14 @@
|
|||||||
#define TRUE (!FALSE)
|
#define TRUE (!FALSE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define NULL 0
|
||||||
|
#else
|
||||||
|
#define NULL ((void *)0)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Boolean values */
|
/* Boolean values */
|
||||||
typedef uint8_t bool_t;
|
typedef uint8_t bool_t;
|
||||||
|
|
||||||
@@ -156,7 +164,7 @@ typedef uint8_t unit_t;
|
|||||||
|
|
||||||
#define RunXTimesEvery(_jumpstart, _prescaler, _interval, _xtimes, _code) { \
|
#define RunXTimesEvery(_jumpstart, _prescaler, _interval, _xtimes, _code) { \
|
||||||
static uint16_t prescaler = _jumpstart; \
|
static uint16_t prescaler = _jumpstart; \
|
||||||
static uint16_t xtimes = 0; \
|
static uint16_t xtimes = 0; \
|
||||||
prescaler++; \
|
prescaler++; \
|
||||||
if (prescaler >= _prescaler + _interval*xtimes && xtimes < _xtimes) { \
|
if (prescaler >= _prescaler + _interval*xtimes && xtimes < _xtimes) { \
|
||||||
_code; \
|
_code; \
|
||||||
|
|||||||
Reference in New Issue
Block a user