qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

timer.c (479B)


      1 // Copyright 2023 Sergey Vlasov (@sigprof)
      2 // SPDX-License-Identifier: GPL-2.0-or-later
      3 
      4 #include "timer.h"
      5 
      6 // Generate out-of-line copies for inline functions defined in timer.h.
      7 extern inline fast_timer_t timer_read_fast(void);
      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 }