mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Updated the sleep function to ensure it left interrupts disabled when returning.
This commit is contained in:
parent
2cf9f1ac8c
commit
af623460a6
|
@ -132,14 +132,14 @@
|
|||
<com_atmel_avrdbg_tool_samice>
|
||||
<ToolType>com.atmel.avrdbg.tool.samice</ToolType>
|
||||
<ToolName>J-Link-OB-SAM3U128</ToolName>
|
||||
<ToolNumber>000480008423</ToolNumber>
|
||||
<ToolNumber>000480008435</ToolNumber>
|
||||
<KeepTimersRunning>true</KeepTimersRunning>
|
||||
<OverrideVtor>false</OverrideVtor>
|
||||
<OverrideVtorValue>
|
||||
</OverrideVtorValue>
|
||||
<Channel>
|
||||
<host>127.0.0.1</host>
|
||||
<port>4788</port>
|
||||
<port>1882</port>
|
||||
<ssl>False</ssl>
|
||||
</Channel>
|
||||
<ToolOptions>
|
||||
|
|
|
@ -263,6 +263,7 @@ void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime )
|
|||
uint32_t ulAlarmValue, ulCompleteTickPeriods;
|
||||
eSleepModeStatus eSleepAction;
|
||||
portTickType xModifiableIdleTime;
|
||||
enum sleepmgr_mode xSleepMode;
|
||||
|
||||
/* THIS FUNCTION IS CALLED WITH THE SCHEDULER SUSPENDED. */
|
||||
|
||||
|
@ -331,9 +332,15 @@ portTickType xModifiableIdleTime;
|
|||
means the application defined code has already executed the WAIT
|
||||
instruction. */
|
||||
if( xModifiableIdleTime > 0 )
|
||||
{
|
||||
/* Find the deepest allowable sleep mode. */
|
||||
xSleepMode = sleepmgr_get_sleep_mode();
|
||||
|
||||
if( xSleepMode != SLEEPMGR_ACTIVE )
|
||||
{
|
||||
/* Sleep until something happens. */
|
||||
sleepmgr_enter_sleep();
|
||||
bpm_sleep( BPM, xSleepMode );
|
||||
}
|
||||
}
|
||||
|
||||
/* Allow the application to define some post sleep processing. */
|
||||
|
@ -347,7 +354,6 @@ portTickType xModifiableIdleTime;
|
|||
|
||||
/* Re-enable interrupts - see comments above the cpsid instruction()
|
||||
above. */
|
||||
#warning The sleep manager will have re-enabled interrupts already, does this matter?
|
||||
__asm volatile( "cpsie i" );
|
||||
|
||||
if( ulTickFlag != pdFALSE )
|
||||
|
|
|
@ -294,5 +294,7 @@ void bpm_sleep(Bpm *bpm, uint32_t sleep_mode)
|
|||
* Please note that we should probably use something like
|
||||
* cpu_leave_critical(), using set_pri_mask(0)
|
||||
*/
|
||||
cpu_irq_enable();
|
||||
/* In this demo interrupts are managed by the FreeRTOS kernel and must not
|
||||
be altered here so the following line has been removed _RB_
|
||||
cpu_irq_enable(); */
|
||||
}
|
||||
|
|
|
@ -127,7 +127,9 @@ static inline void bpm_sleep(Bpm *bpm, uint32_t sleep_mode)
|
|||
* Please note that we should probably use something like
|
||||
* cpu_leave_critical(), using set_pri_mask(0)
|
||||
*/
|
||||
cpu_irq_enable();
|
||||
/* In this demo interrupts are managed by the FreeRTOS kernel and must not
|
||||
be altered here so the following line has been removed _RB_
|
||||
cpu_irq_enable(); */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -140,19 +140,6 @@ to exclude the API function. */
|
|||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
|
||||
/* FreeRTOS+CLI definitions. */
|
||||
|
||||
/* Dimensions a buffer into which command outputs can be written. The buffer
|
||||
can be declared in the CLI code itself, to allow multiple command consoles to
|
||||
share the same buffer. For example, an application may allow access to the
|
||||
command interpreter by UART and by Ethernet. Sharing a buffer is done purely
|
||||
to save RAM. Note, however, that the command console itself is not re-entrant,
|
||||
so only one command interpreter interface can be used at any one time. For
|
||||
that reason, no attempt at providing mutual exclusion to the buffer is
|
||||
attempted. */
|
||||
#define configCOMMAND_INT_MAX_OUTPUT_SIZE 400
|
||||
|
||||
|
||||
/* Cortex-M specific definitions. */
|
||||
|
||||
#ifdef __NVIC_PRIO_BITS
|
||||
|
@ -192,5 +179,11 @@ void vPostSleepProcessing( unsigned long xExpectedIdleTime );
|
|||
#define configPRE_SLEEP_PROCESSING( xExpectedIdleTime ) vPreSleepProcessing( xExpectedIdleTime );
|
||||
#define configPOST_SLEEP_PROCESSING( xExpectedIdleTime ) vPostSleepProcessing( xExpectedIdleTime );
|
||||
|
||||
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
|
||||
standard names. */
|
||||
#define vPortSVCHandler SVC_Handler
|
||||
#define xPortPendSVHandler PendSV_Handler
|
||||
#define xPortSysTickHandler SysTick_Handler
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
|
||||
|
|
Loading…
Reference in a new issue