[feature] adding the quadshot led_driver module

This commit is contained in:
Ewoud Smeur
2012-10-23 20:22:28 -07:00
parent 2b050152ed
commit 098b9a6042
6 changed files with 173 additions and 0 deletions
+14
View File
@@ -117,6 +117,20 @@ typedef uint8_t unit_t;
_code; \
} \
}
#define RunXTimesEvery(_jumpstart, _prescaler, _interval, _xtimes, _code) { \
static uint16_t prescaler = _jumpstart; \
static uint16_t xtimes = 0; \
prescaler++; \
if (prescaler >= _prescaler + _interval*xtimes && xtimes < _xtimes) { \
_code; \
xtimes++; \
} \
if (xtimes >= _xtimes) { \
xtimes = 0; \
prescaler = 0; \
} \
}
#define PeriodicPrescaleBy5( _code_0, _code_1, _code_2, _code_3, _code_4) { \