From 178b925c1eb4dad187c6ddb3e1d5789152de22f3 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Thu, 6 Jun 2013 11:26:15 +0000 Subject: [PATCH] Update SAM4L_low_power_tick_management.c to use xTaskIncrementTick() in place of vTaskIncrementTick(). git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1911 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../src/SAM4L_low_power_tick_management.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c index 230f7ae58..5f34553d2 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c @@ -116,7 +116,7 @@ within the Cortex-M core itself. */ */ void AST_ALARM_Handler(void); -/* +/* * Functions that disable and enable the AST respectively, not returning until * the operation is known to have taken effect. */ @@ -150,18 +150,13 @@ clears the interrupt, which is specific to the clock being used to generate the tick. */ void AST_ALARM_Handler(void) { - /* If using preemption, also force a context switch by pending the PendSV - interrupt. */ - #if configUSE_PREEMPTION == 1 - { - portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; - } - #endif - /* Protect incrementing the tick with an interrupt safe critical section. */ ( void ) portSET_INTERRUPT_MASK_FROM_ISR(); { - vTaskIncrementTick(); + if( xTaskIncrementTick() != pdFALSE ) + { + portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; + } /* Just completely clear the interrupt mask on exit by passing 0 because it is known that this interrupt will only ever execute with the lowest @@ -262,8 +257,8 @@ static void prvEnableAST( void ) /*-----------------------------------------------------------*/ /* Override the default definition of vPortSuppressTicksAndSleep() that is weakly -defined in the FreeRTOS Cortex-M3 port layet with a version that manages the -asynchronous timer (AST), as the tick is generated from the low power AST and +defined in the FreeRTOS Cortex-M3 port layet with a version that manages the +asynchronous timer (AST), as the tick is generated from the low power AST and not the SysTick as would normally be the case on a Cortex-M. */ void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ) { -- 2.39.5