From 2ee52c4fde36a69f1340af7ad0db2752de99a51a Mon Sep 17 00:00:00 2001 From: Tony DiCola Date: Thu, 13 Oct 2016 18:36:00 +0000 Subject: [PATCH] atmel-samd: Minor fixes to SysTick handler, enable all interrupts function. --- atmel-samd/mphalport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atmel-samd/mphalport.c b/atmel-samd/mphalport.c index 721f3659ef..3b70b3d052 100644 --- a/atmel-samd/mphalport.c +++ b/atmel-samd/mphalport.c @@ -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); }