1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 04:15:44 +03:00

cpm16 / cmp32 functions

used to compare timestamps with correct wrap. A bit more readable that typecasting in code. Only few uses replaced now
This commit is contained in:
Petr Ledvina 2015-10-09 13:20:35 +02:00 committed by Dominic Clifton
parent 3cdc4a23b5
commit dc5a888633
2 changed files with 5 additions and 2 deletions

View file

@ -46,5 +46,7 @@ http://resnet.uoregon.edu/~gurney_j/jmpc/bitwise.html
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
static inline int16_t cmp16(uint16_t a, uint16_t b) { return a-b; }
static inline int32_t cmp32(uint32_t a, uint32_t b) { return a-b; }
#endif