aboutsummaryrefslogtreecommitdiffstats
path: root/src/atsamd/timer.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-08-22 08:52:42 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-08-22 09:58:58 -0400
commit4990fe814d55b5b1f63c405852bb3ae0bcc28708 (patch)
tree978b5a8510f39f2be77b675f31cbcf5302da689e /src/atsamd/timer.c
parent4ef53ab0953ac664a9935b26cd6536aac44eaec7 (diff)
downloadkutter-4990fe814d55b5b1f63c405852bb3ae0bcc28708.tar.gz
kutter-4990fe814d55b5b1f63c405852bb3ae0bcc28708.tar.xz
kutter-4990fe814d55b5b1f63c405852bb3ae0bcc28708.zip
atsamd: Move irq handler code above irq setup
Only code movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/atsamd/timer.c')
-rw-r--r--src/atsamd/timer.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/atsamd/timer.c b/src/atsamd/timer.c
index f6b00ab3..a49192b9 100644
--- a/src/atsamd/timer.c
+++ b/src/atsamd/timer.c
@@ -32,6 +32,16 @@ timer_kick(void)
timer_set(timer_read_time() + 50);
}
+// IRQ handler
+void __visible __aligned(16) // aligning helps stabilize perf benchmarks
+TC4_Handler(void)
+{
+ irq_disable();
+ uint32_t next = timer_dispatch_many();
+ timer_set(next);
+ irq_enable();
+}
+
void
timer_init(void)
{
@@ -53,13 +63,3 @@ timer_init(void)
irq_restore(flag);
}
DECL_INIT(timer_init);
-
-// IRQ handler
-void __visible __aligned(16) // aligning helps stabilize perf benchmarks
-TC4_Handler(void)
-{
- irq_disable();
- uint32_t next = timer_dispatch_many();
- timer_set(next);
- irq_enable();
-}