/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
ulRxLength[ ulTemp ] = 0;\r
}\r
- \r
+\r
/* Create the queue and task used to defer the MAC processing to the\r
task level. */\r
vSemaphoreCreateBinary( xMACInterruptSemaphore );\r
xSemaphoreTake( xMACInterruptSemaphore, 0 );\r
- xReturn = xTaskCreate( vMACHandleTask, ( signed portCHAR * ) "MAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
+ xReturn = xTaskCreate( vMACHandleTask, "MAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
vTaskDelay( macNEGOTIATE_DELAY );\r
- \r
+\r
/* We are only interested in Rx interrupts. */\r
IntPrioritySet( INT_ETH, configKERNEL_INTERRUPT_PRIORITY );\r
IntEnable( INT_ETH );\r
{\r
/* Leave room for the size at the start of the buffer. */\r
uip_buf = &( ucRxBuffers[ ulNextRxBuffer ][ 2 ] );\r
- \r
+\r
ulRxLength[ ulNextRxBuffer ] = 0;\r
- \r
+\r
ulNextRxBuffer++;\r
if( ulNextRxBuffer >= emacNUM_RX_BUFFERS )\r
{\r
{\r
vTaskDelay( macWAIT_SEND_TIME );\r
}\r
- \r
- pulSource = ( unsigned portLONG * ) pus; \r
- \r
+\r
+ pulSource = ( unsigned portLONG * ) pus;\r
+\r
for( ulNextWord = 0; ulNextWord < ulNextTxSpace; ulNextWord += sizeof( unsigned portLONG ) )\r
{\r
HWREG(ETH_BASE + MAC_O_DATA) = *pulSource;\r
/* Clear the interrupt. */\r
ulTemp = EthernetIntStatus( ETH_BASE, pdFALSE );\r
EthernetIntClear( ETH_BASE, ulTemp );\r
- \r
+\r
/* Was it an Rx interrupt? */\r
if( ulTemp & ETH_INT_RX )\r
{\r
xSemaphoreGiveFromISR( xMACInterruptSemaphore, &xHigherPriorityTaskWoken );\r
EthernetIntDisable( ETH_BASE, ETH_INT_RX );\r
}\r
- \r
+\r
/* Switch to the uIP task. */\r
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r
{\r
/* Wait for something to do. */\r
xSemaphoreTake( xMACInterruptSemaphore, portMAX_DELAY );\r
- \r
+\r
while( ( ulInt = ( EthernetIntStatus( ETH_BASE, pdFALSE ) & ETH_INT_RX ) ) != 0 )\r
- { \r
+ {\r
ulLength = HWREG( ETH_BASE + MAC_O_DATA );\r
- \r
+\r
/* Leave room at the start of the buffer for the size. */\r
- pulBuffer = ( unsigned long * ) &( ucRxBuffers[ ulNextRxBuffer ][ 2 ] ); \r
+ pulBuffer = ( unsigned long * ) &( ucRxBuffers[ ulNextRxBuffer ][ 2 ] );\r
*pulBuffer = ( ulLength >> 16 );\r
\r
- /* Get the size of the data. */ \r
- pulBuffer = ( unsigned long * ) &( ucRxBuffers[ ulNextRxBuffer ][ 4 ] ); \r
+ /* Get the size of the data. */\r
+ pulBuffer = ( unsigned long * ) &( ucRxBuffers[ ulNextRxBuffer ][ 4 ] );\r
ulLength &= 0xFFFF;\r
- \r
+\r
if( ulLength > 4 )\r
{\r
ulLength -= 4;\r
- \r
+\r
if( ulLength >= UIP_BUFSIZE )\r
{\r
/* The data won't fit in our buffer. Ensure we don't\r
*pulBuffer = HWREG( ETH_BASE + MAC_O_DATA );\r
pulBuffer++;\r
}\r
- \r
+\r
/* Store the length of the data into the separate array. */\r
ulRxLength[ ulNextRxBuffer ] = ulLength;\r
- \r
+\r
/* Use the next buffer the next time through. */\r
ulNextRxBuffer++;\r
if( ulNextRxBuffer >= emacNUM_RX_BUFFERS )\r
{\r
ulNextRxBuffer = 0;\r
}\r
- \r
+\r
/* Ensure the uIP task is not blocked as data has arrived. */\r
xSemaphoreGive( xEMACSemaphore );\r
}\r
}\r
- \r
+\r
EthernetIntEnable( ETH_BASE, ETH_INT_RX );\r
}\r
}\r