Update FreeRTOS+ components and demos to use typedef names introduced in FreeRTOS V8.

This commit is contained in:
Richard Barry 2014-06-20 20:15:20 +00:00
parent 4ce4de750a
commit 5e47df8c01
66 changed files with 395 additions and 395 deletions

View file

@ -75,7 +75,7 @@
task performing the transmit will block for niTX_BUFFER_FREE_WAIT
milliseconds. It will do this a maximum of niMAX_TX_ATTEMPTS before giving
up. */
#define niTX_BUFFER_FREE_WAIT ( ( portTickType ) 2UL / portTICK_RATE_MS )
#define niTX_BUFFER_FREE_WAIT ( ( TickType_t ) 2UL / portTICK_RATE_MS )
#define niMAX_TX_ATTEMPTS ( 5 )
/* The length of the queue used to send interrupt status words from the
@ -99,11 +99,11 @@ interrupt is received. */
static xSemaphoreHandle xEMACRxEventSemaphore = NULL;
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceInitialise( void )
BaseType_t xNetworkInterfaceInitialise( void )
{
EMAC_CFG_Type Emac_Config;
PINSEL_CFG_Type xPinConfig;
portBASE_TYPE xStatus, xReturn;
BaseType_t xStatus, xReturn;
extern uint8_t ucMACAddress[ 6 ];
/* Enable Ethernet Pins */
@ -142,9 +142,9 @@ extern uint8_t ucMACAddress[ 6 ];
}
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
BaseType_t xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{
portBASE_TYPE xReturn = pdFAIL;
BaseType_t xReturn = pdFAIL;
int32_t x;
extern void EMAC_StartTransmitNextBuffer( uint32_t ulLength );
extern void EMAC_SetNextPacketToSend( uint8_t * pucBuffer );
@ -252,7 +252,7 @@ extern uint8_t *EMAC_NextPacketToRead( void );
stack. No storage is required as the network buffer
will point directly to the buffer that already holds
the received data. */
pxNetworkBuffer = pxNetworkBufferGet( 0, ( portTickType ) 0 );
pxNetworkBuffer = pxNetworkBufferGet( 0, ( TickType_t ) 0 );
if( pxNetworkBuffer != NULL )
{
@ -262,7 +262,7 @@ extern uint8_t *EMAC_NextPacketToRead( void );
/* Data was received and stored. Send a message to the IP
task to let it know. */
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( TickType_t ) 0 ) == pdFALSE )
{
vNetworkBufferRelease( pxNetworkBuffer );
iptraceETHERNET_RX_EVENT_LOST();

View file

@ -71,7 +71,7 @@
operation will be held in the Blocked state (so other tasks can execute) for
niTX_BUFFER_FREE_WAIT ticks. It will do this a maximum of niMAX_TX_ATTEMPTS
before giving up. */
#define niTX_BUFFER_FREE_WAIT ( ( portTickType ) 2UL / portTICK_RATE_MS )
#define niTX_BUFFER_FREE_WAIT ( ( TickType_t ) 2UL / portTICK_RATE_MS )
#define niMAX_TX_ATTEMPTS ( 5 )
/*-----------------------------------------------------------*/
@ -92,10 +92,10 @@ static xSemaphoreHandle xEMACRxEventSemaphore = NULL;
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceInitialise( void )
BaseType_t xNetworkInterfaceInitialise( void )
{
EMAC_CFG_Type Emac_Config;
portBASE_TYPE xReturn;
BaseType_t xReturn;
extern uint8_t ucMACAddress[ 6 ];
Emac_Config.pbEMAC_Addr = ucMACAddress;
@ -141,9 +141,9 @@ extern uint8_t ucMACAddress[ 6 ];
}
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
BaseType_t xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{
portBASE_TYPE xReturn = pdFAIL;
BaseType_t xReturn = pdFAIL;
int32_t x;
/* Attempt to obtain access to a Tx descriptor. */
@ -236,7 +236,7 @@ xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };
{
/* The buffer filled by the DMA is going to be passed into the IP
stack. Allocate another buffer for the DMA descriptor. */
pxNetworkBuffer = pxNetworkBufferGet( ipTOTAL_ETHERNET_FRAME_SIZE, ( portTickType ) 0 );
pxNetworkBuffer = pxNetworkBufferGet( ipTOTAL_ETHERNET_FRAME_SIZE, ( TickType_t ) 0 );
if( pxNetworkBuffer != NULL )
{
@ -273,7 +273,7 @@ xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };
/* Data was received and stored. Send it to the IP task
for processing. */
xRxEvent.pvData = ( void * ) pxNetworkBuffer;
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( TickType_t ) 0 ) == pdFALSE )
{
/* The buffer could not be sent to the IP task so the
buffer must be released. */

View file

@ -81,13 +81,13 @@ static void setEmacAddr( uint8_t abStationAddr[] );
* all remain interrupts are disabled
* (Ref. from LPC17xx UM)
**********************************************************************/
portBASE_TYPE EMAC_Init(EMAC_CFG_Type *EMAC_ConfigStruct)
BaseType_t EMAC_Init(EMAC_CFG_Type *EMAC_ConfigStruct)
{
int32_t id1, id2, regv, phy = 0;
int32_t phy_linkstatus_reg, phy_linkstatus_mask;
uint32_t x;
const uint32_t ulMaxAttempts = 250UL;
portBASE_TYPE xReturn = pdPASS;
BaseType_t xReturn = pdPASS;
/* Enable Ethernet Pins (NGX LPC1830 Xplorer. */
scu_pinmux(0x2 ,0 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC7);
@ -287,9 +287,9 @@ portBASE_TYPE xReturn = pdPASS;
/*********************************************************************//**
**********************************************************************/
portBASE_TYPE EMAC_CheckTransmitIndex( void )
BaseType_t EMAC_CheckTransmitIndex( void )
{
portBASE_TYPE xReturn;
BaseType_t xReturn;
if( ( Tx_Desc[ TxDescIndex ].Status & OWN_BIT ) == 0 )
{
@ -374,9 +374,9 @@ void EMAC_UpdateRxConsumeIndex( void )
* it means there're available data has been received. They should be read
* out and released the Receive Data Buffer by updating the RxConsumeIndex value.
**********************************************************************/
portBASE_TYPE EMAC_CheckReceiveIndex(void)
BaseType_t EMAC_CheckReceiveIndex(void)
{
portBASE_TYPE xReturn;
BaseType_t xReturn;
if( ( Rx_Desc[ RxDescIndex ].Status & OWN_BIT ) == 0 )
{

View file

@ -215,15 +215,15 @@ typedef struct {
/* Prototypes */
portBASE_TYPE EMAC_Init(EMAC_CFG_Type *EMAC_ConfigStruct);
BaseType_t EMAC_Init(EMAC_CFG_Type *EMAC_ConfigStruct);
int32_t EMAC_UpdatePHYStatus(void);
uint32_t EMAC_GetReceiveDataSize(void);
void EMAC_StartTransmitNextBuffer( uint32_t ulLength );
void EMAC_SetNextPacketToSend( uint8_t * pucBuffer );
void EMAC_NextPacketToRead( xNetworkBufferDescriptor_t *pxNetworkBuffer );
void EMAC_UpdateRxConsumeIndex(void);
portBASE_TYPE EMAC_CheckReceiveIndex(void);
portBASE_TYPE EMAC_CheckTransmitIndex(void);
BaseType_t EMAC_CheckReceiveIndex(void);
BaseType_t EMAC_CheckTransmitIndex(void);
#ifdef __cplusplus
}

View file

@ -78,7 +78,7 @@
operation will be held in the Blocked state (so other tasks can execute) for
niTX_BUFFER_FREE_WAIT ticks. It will do this a maximum of niMAX_TX_ATTEMPTS
before giving up. */
#define niTX_BUFFER_FREE_WAIT ( ( portTickType ) 2UL / portTICK_RATE_MS )
#define niTX_BUFFER_FREE_WAIT ( ( TickType_t ) 2UL / portTICK_RATE_MS )
#define niMAX_TX_ATTEMPTS ( 5 )
/*-----------------------------------------------------------*/
@ -99,9 +99,9 @@ xSemaphoreHandle xEMACRxEventSemaphore = NULL;
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceInitialise( void )
BaseType_t xNetworkInterfaceInitialise( void )
{
portBASE_TYPE xReturn;
BaseType_t xReturn;
extern uint8_t ucMACAddress[ 6 ];
xReturn = xEMACInit( ucMACAddress );
@ -138,9 +138,9 @@ extern uint8_t ucMACAddress[ 6 ];
}
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
BaseType_t xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{
portBASE_TYPE xReturn = pdFAIL;
BaseType_t xReturn = pdFAIL;
int32_t x;
/* Attempt to obtain access to a Tx descriptor. */
@ -203,7 +203,7 @@ xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };
{
/* The buffer filled by the DMA is going to be passed into the IP
stack. Allocate another buffer for the DMA descriptor. */
pxNetworkBuffer = pxNetworkBufferGet( ipTOTAL_ETHERNET_FRAME_SIZE, ( portTickType ) 0 );
pxNetworkBuffer = pxNetworkBufferGet( ipTOTAL_ETHERNET_FRAME_SIZE, ( TickType_t ) 0 );
if( pxNetworkBuffer != NULL )
{
@ -240,7 +240,7 @@ xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };
/* Data was received and stored. Send it to the IP task
for processing. */
xRxEvent.pvData = ( void * ) pxNetworkBuffer;
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( TickType_t ) 0 ) == pdFALSE )
{
/* The buffer could not be sent to the IP task so the
buffer must be released. */

View file

@ -84,9 +84,9 @@ static unsigned int xTxDescriptorIndex = 0;
/*-----------------------------------------------------------*/
portBASE_TYPE xEMACInit( uint8_t ucMACAddress[ 6 ] )
BaseType_t xEMACInit( uint8_t ucMACAddress[ 6 ] )
{
portBASE_TYPE xReturn;
BaseType_t xReturn;
uint32_t ulPHYStatus;
/* Configure the hardware. */
@ -151,9 +151,9 @@ uint32_t ulPHYStatus;
}
/*-----------------------------------------------------------*/
portBASE_TYPE xEMACIsTxDescriptorAvailable( void )
BaseType_t xEMACIsTxDescriptorAvailable( void )
{
portBASE_TYPE xReturn;
BaseType_t xReturn;
if( ( xTxDescriptors[ xTxDescriptorIndex ].CTRLSTAT & RDES_OWN ) == 0 )
{
@ -215,9 +215,9 @@ void vEMACReturnRxDescriptor( void )
}
/*-----------------------------------------------------------*/
portBASE_TYPE xEMACRxDataAvailable( void )
BaseType_t xEMACRxDataAvailable( void )
{
portBASE_TYPE xReturn;
BaseType_t xReturn;
if( ( xRXDescriptors[ xRxDescriptorIndex ].STATUS & RDES_OWN ) == 0 )
{

View file

@ -46,13 +46,13 @@
/*
* Initialise the MAC and PHY.
*/
portBASE_TYPE xEMACInit( uint8_t ucMACAddress[ 6 ] );
BaseType_t xEMACInit( uint8_t ucMACAddress[ 6 ] );
/*
* Return pdTRUE if there is a FreeRTOS Tx descriptor. Return pdFALSE if all
* Tx descriptors are already in use.
*/
portBASE_TYPE xEMACIsTxDescriptorAvailable( void );
BaseType_t xEMACIsTxDescriptorAvailable( void );
/*
* Assign a buffer to a Tx descriptor so it is ready to be transmitted, but
@ -77,7 +77,7 @@ void vEMACReturnRxDescriptor( void );
* Returns pdTRUE if the next Rx descriptor contains received data. Returns
* pdFLASE fi the next Rx descriptor is still under the control of the DMA.
*/
portBASE_TYPE xEMACRxDataAvailable( void );
BaseType_t xEMACRxDataAvailable( void );
void vEMACSwapEmptyBufferForRxedData( xNetworkBufferDescriptor_t *pxNetworkBuffer );
#endif /* LPC18xx_43xx_EMAC_H */

View file

@ -61,7 +61,7 @@
operation will be held in the Blocked state (so other tasks can execute) for
niTX_BUFFER_FREE_WAIT ticks. It will do this a maximum of niMAX_TX_ATTEMPTS
before giving up. */
#define niTX_BUFFER_FREE_WAIT ( ( portTickType ) 2UL / portTICK_RATE_MS )
#define niTX_BUFFER_FREE_WAIT ( ( TickType_t ) 2UL / portTICK_RATE_MS )
#define niMAX_TX_ATTEMPTS ( 5 )
/*-----------------------------------------------------------*/
@ -90,12 +90,12 @@ static gmac_device_t xGMACStruct;
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceInitialise( void )
BaseType_t xNetworkInterfaceInitialise( void )
{
gmac_options_t xGMACOptions;
extern uint8_t ucMACAddress[ 6 ];
const portTickType xPHYDelay_400ms = 400UL;
portBASE_TYPE xReturn = pdFALSE;
const TickType_t xPHYDelay_400ms = 400UL;
BaseType_t xReturn = pdFALSE;
/* Ensure PHY is ready. */
vTaskDelay( xPHYDelay_400ms / portTICK_RATE_MS );
@ -167,7 +167,7 @@ portBASE_TYPE xReturn = pdFALSE;
static void prvGMACRxCallback( uint32_t ulStatus )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
/* Unblock the deferred interrupt handler task if the event was an Rx. */
if( ulStatus == GMAC_RSR_REC )
@ -179,9 +179,9 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
}
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
BaseType_t xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{
portBASE_TYPE xReturn = pdFAIL;
BaseType_t xReturn = pdFAIL;
int32_t x;
/* Attempt to obtain access to a Tx descriptor. */
@ -217,7 +217,7 @@ static void prvGMACDeferredInterruptHandlerTask( void *pvParameters )
{
xNetworkBufferDescriptor_t *pxNetworkBuffer;
xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };
static const portTickType xBufferWaitDelay = 1500UL / portTICK_RATE_MS;
static const TickType_t xBufferWaitDelay = 1500UL / portTICK_RATE_MS;
uint32_t ulReturned;
( void ) pvParameters;
@ -268,7 +268,7 @@ uint32_t ulReturned;
/* Data was received and stored. Send it to the IP task
for processing. */
xRxEvent.pvData = ( void * ) pxNetworkBuffer;
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( TickType_t ) 0 ) == pdFALSE )
{
/* The buffer could not be sent to the IP task so the
buffer must be released. */

View file

@ -71,7 +71,7 @@
task performing the transmit will block for niTX_BUFFER_FREE_WAIT
milliseconds. It will do this a maximum of niMAX_TX_ATTEMPTS before giving
up. */
#define niTX_BUFFER_FREE_WAIT ( ( portTickType ) 2UL / portTICK_RATE_MS )
#define niTX_BUFFER_FREE_WAIT ( ( TickType_t ) 2UL / portTICK_RATE_MS )
#define niMAX_TX_ATTEMPTS ( 5 )
/* The length of the queue used to send interrupt status words from the
@ -95,9 +95,9 @@ interrupt is received. */
xSemaphoreHandle xEMACRxEventSemaphore = NULL;
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceInitialise( void )
BaseType_t xNetworkInterfaceInitialise( void )
{
portBASE_TYPE xStatus, xReturn;
BaseType_t xStatus, xReturn;
extern uint8_t ucMACAddress[ 6 ];
/* Initialise the MAC. */
@ -120,7 +120,7 @@ extern uint8_t ucMACAddress[ 6 ];
}
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
BaseType_t xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{
extern void vEMACCopyWrite( uint8_t * pucBuffer, uint16_t usLength );

View file

@ -129,9 +129,9 @@ xSemaphoreHandle xPCAPMutex = NULL;
/*-----------------------------------------------------------*/
portBASE_TYPE xNetworkInterfaceInitialise( void )
BaseType_t xNetworkInterfaceInitialise( void )
{
portBASE_TYPE xReturn = pdFALSE;
BaseType_t xReturn = pdFALSE;
pcap_if_t *pxAllNetworkInterfaces;
if( xPCAPMutex == NULL )
@ -165,13 +165,13 @@ pcap_if_t *pxAllNetworkInterfaces;
#if updconfigLOOPBACK_ETHERNET_PACKETS == 1
portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
BaseType_t xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{
xEthernetHeader_t *pxEthernetHeader;
xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };
extern uint8_t xDefaultPartUDPPacketHeader[];
static const xMACAddress_t xBroadcastMACAddress = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
portBASE_TYPE xCanLoopback;
BaseType_t xCanLoopback;
pxEthernetHeader = ( xEthernetHeader_t * ) pxNetworkBuffer->pucEthernetBuffer;
@ -199,7 +199,7 @@ pcap_if_t *pxAllNetworkInterfaces;
is sending a message to itself, so a block time cannot be used for
fear of deadlocking. */
xRxEvent.pvData = ( void * ) pxNetworkBuffer;
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( TickType_t ) 0 ) == pdFALSE )
{
vNetworkBufferRelease( pxNetworkBuffer );
iptraceETHERNET_RX_EVENT_LOST();
@ -227,7 +227,7 @@ pcap_if_t *pxAllNetworkInterfaces;
#else /* updconfigLOOPBACK_ETHERNET_PACKETS == 1 */
portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
BaseType_t xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{
xSemaphoreTake( xPCAPMutex, portMAX_DELAY );
{
@ -432,7 +432,7 @@ eFrameProcessingResult_t eResult;
/* Data was received and stored. Send a message to the IP
task to let it know. */
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )
if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( TickType_t ) 0 ) == pdFALSE )
{
/* The buffer could not be sent to the stack so
must be released again. This is only an interrupt
@ -471,7 +471,7 @@ eFrameProcessingResult_t eResult;
#if configUSE_STATIC_BUFFERS == 1
void vNetworkInterfaceAllocateRAMToBuffers( xNetworkBufferDescriptor_t pxNetworkBuffers[ ipconfigNUM_NETWORK_BUFFERS ] )
{
portBASE_TYPE x;
BaseType_t x;
for( x = 0; x < ipconfigNUM_NETWORK_BUFFERS; x++ )
{