Merge pull request #125 from nfi/lollipop

Bug fix: corrected the macro RPL_LOLLIPOP_INCREMENT
This commit is contained in:
Adam Dunkels 2013-03-09 05:49:06 -08:00
commit 80982f97b8

View file

@ -211,10 +211,14 @@
#define RPL_LOLLIPOP_CIRCULAR_REGION 127
#define RPL_LOLLIPOP_SEQUENCE_WINDOWS 16
#define RPL_LOLLIPOP_INIT (RPL_LOLLIPOP_MAX_VALUE - RPL_LOLLIPOP_SEQUENCE_WINDOWS + 1)
#define RPL_LOLLIPOP_INCREMENT(counter) \
((counter) > RPL_LOLLIPOP_CIRCULAR_REGION ? \
++(counter) & RPL_LOLLIPOP_MAX_VALUE : \
++(counter) & RPL_LOLLIPOP_CIRCULAR_REGION)
#define RPL_LOLLIPOP_INCREMENT(counter) \
do { \
if((counter) > RPL_LOLLIPOP_CIRCULAR_REGION) { \
(counter) = ((counter) + 1) & RPL_LOLLIPOP_MAX_VALUE; \
} else { \
(counter) = ((counter) + 1) & RPL_LOLLIPOP_CIRCULAR_REGION; \
} \
} while(0)
#define RPL_LOLLIPOP_IS_INIT(counter) \
((counter) > RPL_LOLLIPOP_CIRCULAR_REGION)