aboutsummaryrefslogtreecommitdiffstats
path: root/src/atsamd/timer.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-08-21 18:56:10 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-08-22 09:58:58 -0400
commit6338f6a5f0894da236f3b3929d7cc8b13b754d83 (patch)
tree61c871dbcc1ed1dd2bdeb4e1d9d0f923b3b34bfa /src/atsamd/timer.c
parent4990fe814d55b5b1f63c405852bb3ae0bcc28708 (diff)
downloadkutter-6338f6a5f0894da236f3b3929d7cc8b13b754d83.tar.gz
kutter-6338f6a5f0894da236f3b3929d7cc8b13b754d83.tar.xz
kutter-6338f6a5f0894da236f3b3929d7cc8b13b754d83.zip
atsamd: Update code to use armcm_boot mechanism
Replace the custom linker scripts with the src/generic/armcm_boot.c mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/atsamd/timer.c')
-rw-r--r--src/atsamd/timer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/atsamd/timer.c b/src/atsamd/timer.c
index a49192b9..dc728055 100644
--- a/src/atsamd/timer.c
+++ b/src/atsamd/timer.c
@@ -4,6 +4,7 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
+#include "board/armcm_boot.h" // armcm_enable_irq
#include "board/irq.h" // irq_disable
#include "board/misc.h" // timer_read_time
#include "board/timer_irq.h" // timer_dispatch_many
@@ -33,7 +34,7 @@ timer_kick(void)
}
// IRQ handler
-void __visible __aligned(16) // aligning helps stabilize perf benchmarks
+void __aligned(16) // aligning helps stabilize perf benchmarks
TC4_Handler(void)
{
irq_disable();
@@ -54,8 +55,7 @@ timer_init(void)
irqstatus_t flag = irq_save();
tc->CTRLA.reg = 0;
tc->CTRLA.reg = TC_CTRLA_MODE_COUNT32;
- NVIC_SetPriority(TC4_IRQn, 2);
- NVIC_EnableIRQ(TC4_IRQn);
+ armcm_enable_irq(TC4_Handler, TC4_IRQn, 2);
tc->INTENSET.reg = TC_INTENSET_MC0;
tc->COUNT.reg = 0;
timer_kick();