atmel-samd: Minor fixes to SysTick handler, enable all interrupts function.

This commit is contained in:
Tony DiCola 2016-10-13 18:36:00 +00:00
parent f77113c04f
commit 2ee52c4fde
1 changed files with 3 additions and 3 deletions

View File

@ -220,7 +220,7 @@ void SysTick_Handler(void) {
systick_ticks_ms += 1;
// Keep the counter within the range of 31 bit uint values since that's the
// max value for micropython 'small' ints.
systick_ticks_ms = systick_ticks_ms > 2147483647L ? 0 : systick_ticks_ms;
systick_ticks_ms = systick_ticks_ms > (0xFFFFFFFF >> 1) ? 0 : systick_ticks_ms;
}
// Interrupt flags that will be saved and restored during disable/Enable
@ -237,8 +237,8 @@ void mp_hal_disable_all_interrupts(void) {
void mp_hal_enable_all_interrupts(void) {
// Enable all interrupt sources after timing critical sections.
// Restore ASF-based interrupts.
cpu_irq_restore(irq_flags);
// Restore SysTick interrupt.
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
// Restore ASF-based interrupts.
cpu_irq_restore(irq_flags);
}