1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 17:25:18 +03:00

Added timeUs_t and timeMs_t types

This commit is contained in:
Martin Budden 2016-11-29 15:40:31 +00:00
parent 988027b150
commit 769ccf3311
48 changed files with 429 additions and 370 deletions

View file

@ -20,6 +20,8 @@
#include <stddef.h>
#include <stdint.h>
#include "common/time.h"
#define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
#define ARRAYEND(x) (&(x)[ARRAYLEN(x)])
@ -71,6 +73,7 @@ http://resnet.uoregon.edu/~gurney_j/jmpc/bitwise.html
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; }
static inline int32_t cmpTimeUs(timeUs_t a, timeUs_t b) { return a-b; }
// using memcpy_fn will force memcpy function call, instead of inlining it. In most cases function call takes fewer instructions
// than inlined version (inlining is cheaper for very small moves < 8 bytes / 2 store instructions)