summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platforms/timer.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/platforms/timer.h b/platforms/timer.h
index fb8ff6bc54..8a2ffd476b 100644
--- a/platforms/timer.h
+++ b/platforms/timer.h
@@ -24,10 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24 24
25#include <stdint.h> 25#include <stdint.h>
26 26
27#define TIMER_DIFF(a, b, max) ((max == UINT8_MAX) ? ((uint8_t)((a) - (b))) : ((max == UINT16_MAX) ? ((uint16_t)((a) - (b))) : ((max == UINT32_MAX) ? ((uint32_t)((a) - (b))) : ((a) >= (b) ? (a) - (b) : (max) + 1 - (b) + (a))))) 27#define TIMER_DIFF_8(a, b) (uint8_t)((a) - (b))
28#define TIMER_DIFF_8(a, b) TIMER_DIFF(a, b, UINT8_MAX) 28#define TIMER_DIFF_16(a, b) (uint16_t)((a) - (b))
29#define TIMER_DIFF_16(a, b) TIMER_DIFF(a, b, UINT16_MAX) 29#define TIMER_DIFF_32(a, b) (uint32_t)((a) - (b))
30#define TIMER_DIFF_32(a, b) TIMER_DIFF(a, b, UINT32_MAX)
31#define TIMER_DIFF_RAW(a, b) TIMER_DIFF_8(a, b) 30#define TIMER_DIFF_RAW(a, b) TIMER_DIFF_8(a, b)
32 31
33#ifdef __cplusplus 32#ifdef __cplusplus