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>
This commit is contained in:
Kevin O'Connor
2019-08-21 18:56:10 -04:00
parent 4990fe814d
commit 6338f6a5f0
7 changed files with 28 additions and 129 deletions

View File

@@ -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();