summaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol/arm_atsam/clks.h
diff options
context:
space:
mode:
authorpatrickmt <40182064+patrickmt@users.noreply.github.com>2018-12-18 21:21:25 +0100
committerDrashna Jaelre <drashna@live.com>2019-01-07 21:44:55 +0100
commit6e984a8b5e34ba181b0893a929af569a1faef2b6 (patch)
tree3648fd159ef02fe3ed7d8ae80c2755c580cd59ff /tmk_core/protocol/arm_atsam/clks.h
parent28986998046b4dbdbc228dbb7889836de2a3ee18 (diff)
downloadqmk_firmware-6e984a8b5e34ba181b0893a929af569a1faef2b6.tar.gz
qmk_firmware-6e984a8b5e34ba181b0893a929af569a1faef2b6.tar.xz
Update to arm_atsam wait and timer routines
Microsecond (us) delays are now handled by a busy wait loop according to MCU frequency. This replaces the system counter method which had an overhead of around 12us. TC5 device and supporting routines removed as it was the old us delay counter. wait_ms is now properly a macro to CLK_delay_ms. wait_us is now properly a macro to CLK_delay_us. Removed CLK_get_us as it has no use. All calls to CLK_get_ms() have been replaced by timer_read64() with corrected typing. All calls to CLK_delay_ms() have been replaced by wait_ms(). All calls to CLK_delay_us() have been replaced by wait_us() and timings verified or updated as needed after review on scope. Corrected typing of variables using 64bit ms timer readings if needed.
Diffstat (limited to 'tmk_core/protocol/arm_atsam/clks.h')
-rw-r--r--tmk_core/protocol/arm_atsam/clks.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/tmk_core/protocol/arm_atsam/clks.h b/tmk_core/protocol/arm_atsam/clks.h
index 96819bfdd..1b01a1764 100644
--- a/tmk_core/protocol/arm_atsam/clks.h
+++ b/tmk_core/protocol/arm_atsam/clks.h
@@ -77,9 +77,8 @@ void CLK_oscctrl_init(void);
void CLK_reset_time(void);
uint32_t CLK_set_gclk_freq(uint8_t gclkn, uint32_t freq);
uint32_t CLK_enable_timebase(void);
-uint32_t CLK_get_ms(void);
-uint64_t CLK_get_us(void);
-void CLK_delay_us(uint16_t usec);
+uint64_t timer_read64(void);
+void CLK_delay_us(uint32_t usec);
void CLK_delay_ms(uint64_t msec);
uint32_t CLK_set_spi_freq(uint8_t sercomn, uint32_t freq);