Skip to content

Commit

Permalink
[airborne] std.h: define NULL if not already done
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Mar 1, 2013
1 parent 8d22a64 commit b37d956
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sw/include/std.h
Expand Up @@ -61,6 +61,14 @@
#define TRUE (!FALSE)
#endif

#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif

/* Boolean values */
typedef uint8_t bool_t;

Expand Down Expand Up @@ -156,7 +164,7 @@ typedef uint8_t unit_t;

#define RunXTimesEvery(_jumpstart, _prescaler, _interval, _xtimes, _code) { \
static uint16_t prescaler = _jumpstart; \
static uint16_t xtimes = 0; \
static uint16_t xtimes = 0; \
prescaler++; \
if (prescaler >= _prescaler + _interval*xtimes && xtimes < _xtimes) { \
_code; \
Expand Down

0 comments on commit b37d956

Please sign in to comment.