diff --git a/sw/include/std.h b/sw/include/std.h index 4a5644b156a..a8b86408e98 100644 --- a/sw/include/std.h +++ b/sw/include/std.h @@ -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; @@ -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; \