diff options
| author | Joel Challis <git@zvecr.com> | 2025-01-19 17:07:11 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-19 17:07:11 +0000 |
| commit | cedd49c59b5a822b6879485cdd412c7d803ae14a (patch) | |
| tree | 6ccccbaf041fdfb9c101ee719a214a573b877f81 /platforms/timer.c | |
| parent | a62f9a2ffd71376bc72e6c52eeab0798cdb8b52f (diff) | |
Consolidate timer_elapsed implementations (#24830)
Diffstat (limited to 'platforms/timer.c')
| -rw-r--r-- | platforms/timer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platforms/timer.c b/platforms/timer.c index 26038dcda3..ba2cf94d2b 100644 --- a/platforms/timer.c +++ b/platforms/timer.c | |||
| @@ -6,3 +6,11 @@ | |||
| 6 | // Generate out-of-line copies for inline functions defined in timer.h. | 6 | // Generate out-of-line copies for inline functions defined in timer.h. |
| 7 | extern inline fast_timer_t timer_read_fast(void); | 7 | extern inline fast_timer_t timer_read_fast(void); |
| 8 | extern inline fast_timer_t timer_elapsed_fast(fast_timer_t last); | 8 | extern inline fast_timer_t timer_elapsed_fast(fast_timer_t last); |
| 9 | |||
| 10 | uint16_t timer_elapsed(uint16_t last) { | ||
| 11 | return TIMER_DIFF_16(timer_read(), last); | ||
| 12 | } | ||
| 13 | |||
| 14 | uint32_t timer_elapsed32(uint32_t last) { | ||
| 15 | return TIMER_DIFF_32(timer_read32(), last); | ||
| 16 | } | ||
