8000 Switch to SysTick_Config · adafruit/circuitpython@93481ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 93481ae

Browse files
committed
Switch to SysTick_Config
1 parent cab12b1 commit 93481ae

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

atmel-samd/tick.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@ void SysTick_Handler(void) {
4646

4747
void tick_init() {
4848
uint32_t ticks_per_ms = common_hal_mcu_processor_get_frequency() / 1000;
49-
SysTick->LOAD = ((ticks_per_ms - 1) << SysTick_LOAD_RELOAD_Pos);
49+
SysTick_Config(ticks_per_ms);
5050
NVIC_EnableIRQ(SysTick_IRQn);
51-
SysTick->CTRL = (1 << SysTick_CTRL_ENABLE_Pos) |
52-
(1 << SysTick_CTRL_TICKINT_Pos)|
53-
(1 << SysTick_CTRL_CLKSOURCE_Pos);
5451
}
5552

5653
void tick_delay(uint32_t us) {

0 commit comments

Comments
 (0)
0