mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-01 11:53:53 -04:00
Changes to the AVR demo's. IAR demo updated with new critical section method.
This commit is contained in:
parent
41b142bae4
commit
97a570fa10
17 changed files with 866 additions and 318 deletions
|
@ -52,6 +52,12 @@
|
|||
#define portBYTES_USED_BY_RETURN_ADDRESS ( 2 )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Stores the critical section nesting. This must not be initialised to 0.
|
||||
It will be initialised when a task starts. */
|
||||
#define portNO_CRITICAL_NESTING ( ( unsigned portBASE_TYPE ) 0 )
|
||||
unsigned portBASE_TYPE uxCriticalNesting = 0x50;
|
||||
|
||||
|
||||
/*
|
||||
* Perform hardware setup to enable ticks from timer 1, compare match A.
|
||||
*/
|
||||
|
@ -221,6 +227,9 @@ portSTACK_TYPE *pxTopOfHardwareStack;
|
|||
pxTopOfStack--;
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) 0x031; /* R31 */
|
||||
|
||||
pxTopOfStack--;
|
||||
*pxTopOfStack = portNO_CRITICAL_NESTING; /* Critical nesting is zero when the task starts. */
|
||||
|
||||
/*lint +e950 +e611 +e923 */
|
||||
|
||||
return pxTopOfStack;
|
||||
|
@ -315,6 +324,22 @@ unsigned portCHAR ucHighByte, ucLowByte;
|
|||
vTaskIncrementTick();
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vPortEnterCritical( void )
|
||||
{
|
||||
portDISABLE_INTERRUPTS();
|
||||
uxCriticalNesting++;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vPortExitCritical( void )
|
||||
{
|
||||
uxCriticalNesting--;
|
||||
if( uxCriticalNesting == portNO_CRITICAL_NESTING )
|
||||
{
|
||||
portENABLE_INTERRUPTS();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue