mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-06-06 12:29:03 -04:00
Updated GCC/ARM7 ISR functions so they only use static variables.
This commit is contained in:
parent
a3921adfe1
commit
c54ec1c639
|
@ -97,10 +97,14 @@ void vUART_ISR( void )
|
||||||
variable declarations. */
|
variable declarations. */
|
||||||
portENTER_SWITCHING_ISR();
|
portENTER_SWITCHING_ISR();
|
||||||
|
|
||||||
/* Now we can declare the local variables. */
|
/* Now we can declare the local variables. These must be static. */
|
||||||
signed portCHAR cChar;
|
static signed portCHAR cChar;
|
||||||
portBASE_TYPE xTaskWokenByTx = pdFALSE, xTaskWokenByRx = pdFALSE;
|
static portBASE_TYPE xTaskWokenByTx, xTaskWokenByRx;
|
||||||
unsigned portLONG ulStatus;
|
static unsigned portLONG ulStatus;
|
||||||
|
|
||||||
|
/* These variables are static so need initialising manually here. */
|
||||||
|
xTaskWokenByTx = pdFALSE;
|
||||||
|
xTaskWokenByRx = pdFALSE;
|
||||||
|
|
||||||
/* What caused the interrupt? */
|
/* What caused the interrupt? */
|
||||||
ulStatus = AT91C_BASE_US0->US_CSR & AT91C_BASE_US0->US_IMR;
|
ulStatus = AT91C_BASE_US0->US_CSR & AT91C_BASE_US0->US_IMR;
|
||||||
|
@ -133,7 +137,7 @@ void vUART_ISR( void )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Acknowledge the interrupt at AIC level...
|
/* Acknowledge the interrupt at AIC level... */
|
||||||
AT91C_BASE_AIC->AIC_EOICR = serCLEAR_AIC_INTERRUPT;
|
AT91C_BASE_AIC->AIC_EOICR = serCLEAR_AIC_INTERRUPT;
|
||||||
|
|
||||||
/* Exit the ISR. If a task was woken by either a character being received
|
/* Exit the ISR. If a task was woken by either a character being received
|
||||||
|
|
|
@ -110,9 +110,13 @@ void vUART_ISR( void )
|
||||||
variable declarations. */
|
variable declarations. */
|
||||||
portENTER_SWITCHING_ISR();
|
portENTER_SWITCHING_ISR();
|
||||||
|
|
||||||
/* Now we can declare the local variables. */
|
/* Now we can declare the local variables. These must be static. */
|
||||||
signed portCHAR cChar;
|
static signed portCHAR cChar;
|
||||||
portBASE_TYPE xTaskWokenByTx = pdFALSE, xTaskWokenByRx = pdFALSE;
|
static portBASE_TYPE xTaskWokenByTx, xTaskWokenByRx;
|
||||||
|
|
||||||
|
/* As these variables are static they must be initialised manually here. */
|
||||||
|
xTaskWokenByTx = pdFALSE;
|
||||||
|
xTaskWokenByRx = pdFALSE;
|
||||||
|
|
||||||
/* What caused the interrupt? */
|
/* What caused the interrupt? */
|
||||||
switch( UART0_IIR & serINTERRUPT_SOURCE_MASK )
|
switch( UART0_IIR & serINTERRUPT_SOURCE_MASK )
|
||||||
|
|
|
@ -10,7 +10,9 @@ void vEMAC_ISR( void )
|
||||||
{
|
{
|
||||||
portENTER_SWITCHING_ISR();
|
portENTER_SWITCHING_ISR();
|
||||||
|
|
||||||
portBASE_TYPE xSwitchRequired = pdFALSE;
|
static portBASE_TYPE xSwitchRequired;
|
||||||
|
|
||||||
|
xSwitchRequired = pdFALSE;
|
||||||
|
|
||||||
/* Clear the interrupt. */
|
/* Clear the interrupt. */
|
||||||
MAC_INTCLEAR = 0xffff;
|
MAC_INTCLEAR = 0xffff;
|
||||||
|
|
|
@ -10,7 +10,12 @@ void vEMAC_ISR( void )
|
||||||
{
|
{
|
||||||
portENTER_SWITCHING_ISR();
|
portENTER_SWITCHING_ISR();
|
||||||
|
|
||||||
portBASE_TYPE xSwitchRequired = pdFALSE;
|
|
||||||
|
/* Variable must be static. */
|
||||||
|
static portBASE_TYPE xSwitchRequired;
|
||||||
|
|
||||||
|
/* As the variable is static it must be manually initialised here. */
|
||||||
|
xSwitchRequired = pdFALSE;
|
||||||
|
|
||||||
/* Clear the interrupt. */
|
/* Clear the interrupt. */
|
||||||
IntClear = 0xffff;
|
IntClear = 0xffff;
|
||||||
|
|
|
@ -59,7 +59,12 @@ void vEINT0_ISR( void )
|
||||||
portENTER_SWITCHING_ISR();
|
portENTER_SWITCHING_ISR();
|
||||||
|
|
||||||
extern xQueueHandle xTCPISRQueue;
|
extern xQueueHandle xTCPISRQueue;
|
||||||
portBASE_TYPE xTaskWoken = pdFALSE;
|
|
||||||
|
/* Must be declared static. */
|
||||||
|
static portBASE_TYPE xTaskWoken;
|
||||||
|
|
||||||
|
/* As the variable is static it must be manually initialised. */
|
||||||
|
xTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* Just wake the TCP task so it knows an ISR has occurred. */
|
/* Just wake the TCP task so it knows an ISR has occurred. */
|
||||||
xQueueSendFromISR( xTCPISRQueue, ( void * ) &lDummyVariable, xTaskWoken );
|
xQueueSendFromISR( xTCPISRQueue, ( void * ) &lDummyVariable, xTaskWoken );
|
||||||
|
|
|
@ -124,11 +124,16 @@ void vI2C_ISR( void )
|
||||||
{
|
{
|
||||||
portENTER_SWITCHING_ISR();
|
portENTER_SWITCHING_ISR();
|
||||||
|
|
||||||
|
/* Variables must be static. */
|
||||||
|
|
||||||
/* Holds the current transmission state. */
|
/* Holds the current transmission state. */
|
||||||
static I2C_STATE eCurrentState = eSentStart;
|
static I2C_STATE eCurrentState = eSentStart;
|
||||||
static portLONG lMessageIndex = -i2cBUFFER_ADDRESS_BYTES; /* There are two address bytes to send prior to the data. */
|
static portLONG lMessageIndex = -i2cBUFFER_ADDRESS_BYTES; /* There are two address bytes to send prior to the data. */
|
||||||
portBASE_TYPE xTaskWokenByTx = pdFALSE;
|
static portBASE_TYPE xTaskWokenByTx;
|
||||||
portLONG lBytesLeft;
|
static portLONG lBytesLeft;
|
||||||
|
|
||||||
|
xTaskWokenByTx = pdFALSE;
|
||||||
|
|
||||||
|
|
||||||
/* The action taken for this interrupt depends on our current state. */
|
/* The action taken for this interrupt depends on our current state. */
|
||||||
switch( eCurrentState )
|
switch( eCurrentState )
|
||||||
|
|
|
@ -71,11 +71,14 @@ void vEMACISR( void )
|
||||||
variable declarations. */
|
variable declarations. */
|
||||||
portENTER_SWITCHING_ISR();
|
portENTER_SWITCHING_ISR();
|
||||||
|
|
||||||
/* Variable definitions can be made now. */
|
/* Variable definitions can be made now. These must be static. */
|
||||||
volatile unsigned portLONG ulIntStatus, ulEventStatus;
|
static volatile unsigned portLONG ulIntStatus, ulEventStatus;
|
||||||
portBASE_TYPE xSwitchRequired = pdFALSE;
|
static portBASE_TYPE xSwitchRequired;
|
||||||
extern void vClearEMACTxBuffer( void );
|
extern void vClearEMACTxBuffer( void );
|
||||||
|
|
||||||
|
/* As the variable is static it must be initialised manually here. */
|
||||||
|
xSwitchRequired = pdFALSE;
|
||||||
|
|
||||||
/* Find the cause of the interrupt. */
|
/* Find the cause of the interrupt. */
|
||||||
ulIntStatus = AT91C_BASE_EMAC->EMAC_ISR;
|
ulIntStatus = AT91C_BASE_EMAC->EMAC_ISR;
|
||||||
ulEventStatus = AT91C_BASE_EMAC->EMAC_RSR;
|
ulEventStatus = AT91C_BASE_EMAC->EMAC_RSR;
|
||||||
|
|
|
@ -71,12 +71,15 @@ void vUSB_ISR( void )
|
||||||
stack variable declarations. */
|
stack variable declarations. */
|
||||||
portENTER_SWITCHING_ISR();
|
portENTER_SWITCHING_ISR();
|
||||||
|
|
||||||
/* Now variables can be declared. */
|
/* Now variables can be declared. These must be static. */
|
||||||
portCHAR cTaskWokenByPost = pdFALSE;
|
static portCHAR cTaskWokenByPost;
|
||||||
static volatile unsigned portLONG ulNextMessage = 0;
|
static volatile unsigned portLONG ulNextMessage = 0;
|
||||||
xISRStatus *pxMessage;
|
static xISRStatus *pxMessage;
|
||||||
unsigned portLONG ulRxBytes;
|
static unsigned portLONG ulRxBytes;
|
||||||
unsigned portCHAR ucFifoIndex;
|
static unsigned portCHAR ucFifoIndex;
|
||||||
|
|
||||||
|
/* As the variables are static they must be initialised manually here. */
|
||||||
|
cTaskWokenByPost = pdFALSE;
|
||||||
|
|
||||||
/* Use the next message from the array. */
|
/* Use the next message from the array. */
|
||||||
pxMessage = &( xISRMessages[ ( ulNextMessage & usbQUEUE_LENGTH ) ] );
|
pxMessage = &( xISRMessages[ ( ulNextMessage & usbQUEUE_LENGTH ) ] );
|
||||||
|
|
Loading…
Reference in a new issue