From b8c1195c40c5f4314b958e82d182235c82ad6e99 Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Sun, 13 Nov 2011 21:13:26 +0000 Subject: [PATCH] Added: /* This is called from the context switch, so will be called from a critical section. xTaskGetTickCountFromISR() contains its own critical section, and the ISR safe critical sections are not designed to nest, so reset the critical section. */ portSET_INTERRUPT_MASK_FROM_ISR(); in main.c. --- Demo/CORTEX_Kinetis_K60_Tower_IAR/main-full.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Demo/CORTEX_Kinetis_K60_Tower_IAR/main-full.c b/Demo/CORTEX_Kinetis_K60_Tower_IAR/main-full.c index c71065e3c..19cfa685b 100644 --- a/Demo/CORTEX_Kinetis_K60_Tower_IAR/main-full.c +++ b/Demo/CORTEX_Kinetis_K60_Tower_IAR/main-full.c @@ -624,6 +624,12 @@ const unsigned long ulSysTickPendingBit = 0x04000000UL; /* How many times has it overflowed? */ ulTickCount = xTaskGetTickCountFromISR(); + + /* This is called from the context switch, so will be called from a + critical section. xTaskGetTickCountFromISR() contains its own critical + section, and the ISR safe critical sections are not designed to nest, + so reset the critical section. */ + portSET_INTERRUPT_MASK_FROM_ISR(); /* Is there a SysTick interrupt pending? */ if( ( *pulInterruptCTRLState & ulSysTickPendingBit ) != 0UL )