You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.4 KiB
C
51 lines
1.4 KiB
C
18 years ago
|
#include "FreeRTOS.h"
|
||
17 years ago
|
#include "semphr.h"
|
||
17 years ago
|
#include "task.h"
|
||
18 years ago
|
|
||
18 years ago
|
/* The interrupt entry point. */
|
||
|
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
|
||
|
|
||
|
/* The function that actually performs the interrupt processing. This must be
|
||
|
separate to the wrapper to ensure the correct stack frame is set up. */
|
||
16 years ago
|
void vEMAC_ISR_Handler( void ) __attribute__((noinline));
|
||
18 years ago
|
|
||
|
extern xSemaphoreHandle xEMACSemaphore;
|
||
|
|
||
18 years ago
|
void vEMAC_ISR_Handler( void )
|
||
18 years ago
|
{
|
||
17 years ago
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||
|
|
||
18 years ago
|
/* Clear the interrupt. */
|
||
|
IntClear = 0xffff;
|
||
|
VICVectAddr = 0;
|
||
|
|
||
|
/* Ensure the uIP task is not blocked as data has arrived. */
|
||
17 years ago
|
xSemaphoreGiveFromISR( xEMACSemaphore, &xHigherPriorityTaskWoken );
|
||
|
|
||
|
if( xHigherPriorityTaskWoken )
|
||
18 years ago
|
{
|
||
18 years ago
|
/* If the uIP task was unblocked then calling "Yield from ISR" here
|
||
|
will ensure the interrupt returns directly to the uIP task, if it
|
||
|
is the highest priority read task. */
|
||
|
portYIELD_FROM_ISR();
|
||
18 years ago
|
}
|
||
18 years ago
|
}
|
||
|
/*-----------------------------------------------------------*/
|
||
18 years ago
|
|
||
18 years ago
|
void vEMAC_ISR_Wrapper( void )
|
||
|
{
|
||
|
/* Save the context of the interrupted task. */
|
||
|
portSAVE_CONTEXT();
|
||
|
|
||
|
/* Call the handler function. This must be separate from the wrapper
|
||
|
function to ensure the correct stack frame is set up. */
|
||
16 years ago
|
__asm volatile( "bl vEMAC_ISR_Handler" );
|
||
18 years ago
|
|
||
|
/* Restore the context of whichever task is going to run next. */
|
||
|
portRESTORE_CONTEXT();
|
||
18 years ago
|
}
|
||
|
|
||
|
|
||
18 years ago
|
|
||
|
|