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

pull/4/head
Richard Barry 11 years ago
parent 4ce4de750a
commit 5e47df8c01

@ -100,7 +100,7 @@ static void prvCreateFileInfoString( char *pcBuffer, F_FIND *pxFindStruct );
/* /*
* Copies an existing file into a newly created file. * Copies an existing file into a newly created file.
*/ */
static portBASE_TYPE prvPerformCopy( const char *pcSourceFile, static BaseType_t prvPerformCopy( const char *pcSourceFile,
int32_t lSourceFileLength, int32_t lSourceFileLength,
const char *pcDestinationFile, const char *pcDestinationFile,
char *pxWriteBuffer, char *pxWriteBuffer,
@ -109,27 +109,27 @@ static portBASE_TYPE prvPerformCopy( const char *pcSourceFile,
/* /*
* Implements the DIR command. * Implements the DIR command.
*/ */
static portBASE_TYPE prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the CD command. * Implements the CD command.
*/ */
static portBASE_TYPE prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the DEL command. * Implements the DEL command.
*/ */
static portBASE_TYPE prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the TYPE command. * Implements the TYPE command.
*/ */
static portBASE_TYPE prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the COPY command. * Implements the COPY command.
*/ */
static portBASE_TYPE prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* Structure that defines the DIR command line command, which lists all the /* Structure that defines the DIR command line command, which lists all the
files in the current directory. */ files in the current directory. */
@ -193,10 +193,10 @@ void vRegisterFileSystemCLICommands( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn = pdTRUE; BaseType_t xParameterStringLength, xReturn = pdTRUE;
static F_FILE *pxFile = NULL; static F_FILE *pxFile = NULL;
int iChar; int iChar;
size_t xByte; size_t xByte;
@ -267,10 +267,10 @@ size_t xColumns = 50U;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength; BaseType_t xParameterStringLength;
unsigned char ucReturned; unsigned char ucReturned;
size_t xStringLength; size_t xStringLength;
@ -305,11 +305,11 @@ size_t xStringLength;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static F_FIND *pxFindStruct = NULL; static F_FIND *pxFindStruct = NULL;
unsigned char ucReturned; unsigned char ucReturned;
portBASE_TYPE xReturn = pdFALSE; BaseType_t xReturn = pdFALSE;
/* This assumes pcWriteBuffer is long enough. */ /* This assumes pcWriteBuffer is long enough. */
( void ) pcCommandString; ( void ) pcCommandString;
@ -371,10 +371,10 @@ portBASE_TYPE xReturn = pdFALSE;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength; BaseType_t xParameterStringLength;
unsigned char ucReturned; unsigned char ucReturned;
/* This function assumes xWriteBufferLen is large enough! */ /* This function assumes xWriteBufferLen is large enough! */
@ -409,10 +409,10 @@ unsigned char ucReturned;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
char *pcSourceFile, *pcDestinationFile; char *pcSourceFile, *pcDestinationFile;
portBASE_TYPE xParameterStringLength; BaseType_t xParameterStringLength;
long lSourceLength, lDestinationLength = 0; long lSourceLength, lDestinationLength = 0;
/* Obtain the name of the destination file. */ /* Obtain the name of the destination file. */
@ -478,7 +478,7 @@ long lSourceLength, lDestinationLength = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvPerformCopy( const char *pcSourceFile, static BaseType_t prvPerformCopy( const char *pcSourceFile,
int32_t lSourceFileLength, int32_t lSourceFileLength,
const char *pcDestinationFile, const char *pcDestinationFile,
char *pxWriteBuffer, char *pxWriteBuffer,
@ -486,7 +486,7 @@ static portBASE_TYPE prvPerformCopy( const char *pcSourceFile,
{ {
int32_t lBytesRead = 0, lBytesToRead, lBytesRemaining; int32_t lBytesRead = 0, lBytesToRead, lBytesRemaining;
F_FILE *pxFile; F_FILE *pxFile;
portBASE_TYPE xReturn = pdPASS; BaseType_t xReturn = pdPASS;
/* NOTE: Error handling has been omitted for clarity. */ /* NOTE: Error handling has been omitted for clarity. */

@ -93,28 +93,28 @@
/* /*
* Implements the task-stats command. * Implements the task-stats command.
*/ */
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the run-time-stats command. * Implements the run-time-stats command.
*/ */
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the echo-three-parameters command. * Implements the echo-three-parameters command.
*/ */
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the echo-parameters command. * Implements the echo-parameters command.
*/ */
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the "trace start" and "trace stop" commands; * Implements the "trace start" and "trace stop" commands;
*/ */
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
#endif #endif
/* Structure that defines the "run-time-stats" command line command. This /* Structure that defines the "run-time-stats" command line command. This
@ -189,7 +189,7 @@ void vRegisterSampleCLICommands( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n"; const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";
@ -210,7 +210,7 @@ const char *const pcHeader = "Task State Priority Stack #\r\n********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n"; const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";
@ -231,11 +231,11 @@ const char * const pcHeader = "Task Abs Time % Time\r\n*********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn; BaseType_t xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -298,11 +298,11 @@ static portBASE_TYPE lParameterNumber = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn; BaseType_t xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -367,10 +367,10 @@ static portBASE_TYPE lParameterNumber = 0;
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE lParameterStringLength; BaseType_t lParameterStringLength;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the

@ -138,7 +138,7 @@ signed char cRxedChar;
uint8_t ucInputIndex = 0; uint8_t ucInputIndex = 0;
char *pcOutputString; char *pcOutputString;
static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ]; static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];
portBASE_TYPE xReturned; BaseType_t xReturned;
xComPortHandle xPort; xComPortHandle xPort;
( void ) pvParameters; ( void ) pvParameters;

@ -91,17 +91,17 @@ commands. */
/* /*
* Defines a command that prints out IP address information. * Defines a command that prints out IP address information.
*/ */
static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that prints out the gathered demo debug stats. * Defines a command that prints out the gathered demo debug stats.
*/ */
static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that sends an ICMP ping request to an IP address. * Defines a command that sends an ICMP ping request to an IP address.
*/ */
static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* Structure that defines the "ip-config" command line command. */ /* Structure that defines the "ip-config" command line command. */
static const CLI_Command_Definition_t xIPConfig = static const CLI_Command_Definition_t xIPConfig =
@ -162,10 +162,10 @@ void vRegisterUDPCLICommands( void )
#if ipconfigSUPPORT_OUTGOING_PINGS == 1 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
char * pcParameter; char * pcParameter;
portBASE_TYPE lParameterStringLength, xReturn; BaseType_t lParameterStringLength, xReturn;
uint32_t ulIPAddress, ulBytesToPing; uint32_t ulIPAddress, ulBytesToPing;
const uint32_t ulDefaultBytesToPing = 8UL; const uint32_t ulDefaultBytesToPing = 8UL;
char cBuffer[ 16 ]; char cBuffer[ 16 ];
@ -253,11 +253,11 @@ void vRegisterUDPCLICommands( void )
#if configINCLUDE_DEMO_DEBUG_STATS != 0 #if configINCLUDE_DEMO_DEBUG_STATS != 0
static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static portBASE_TYPE xIndex = -1; static BaseType_t xIndex = -1;
extern xExampleDebugStatEntry_t xIPTraceValues[]; extern xExampleDebugStatEntry_t xIPTraceValues[];
portBASE_TYPE xReturn; BaseType_t xReturn;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -289,10 +289,10 @@ void vRegisterUDPCLICommands( void )
#endif /* configINCLUDE_DEMO_DEBUG_STATS */ #endif /* configINCLUDE_DEMO_DEBUG_STATS */
static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static portBASE_TYPE xIndex = 0; static BaseType_t xIndex = 0;
portBASE_TYPE xReturn; BaseType_t xReturn;
uint32_t ulAddress; uint32_t ulAddress;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the

@ -164,9 +164,9 @@ unsigned char ucStatus;
static void prvCreateDemoFilesUsing_f_write( void ) static void prvCreateDemoFilesUsing_f_write( void )
{ {
portBASE_TYPE xFileNumber, xWriteNumber; BaseType_t xFileNumber, xWriteNumber;
char cFileName[ fsMAX_FILE_NAME_LEN ]; char cFileName[ fsMAX_FILE_NAME_LEN ];
const portBASE_TYPE xMaxFiles = 5; const BaseType_t xMaxFiles = 5;
long lItemsWritten; long lItemsWritten;
F_FILE *pxFile; F_FILE *pxFile;
@ -207,9 +207,9 @@ F_FILE *pxFile;
static void prvVerifyDemoFileUsing_f_read( void ) static void prvVerifyDemoFileUsing_f_read( void )
{ {
portBASE_TYPE xFileNumber, xReadNumber; BaseType_t xFileNumber, xReadNumber;
char cFileName[ fsMAX_FILE_NAME_LEN ]; char cFileName[ fsMAX_FILE_NAME_LEN ];
const portBASE_TYPE xMaxFiles = 5; const BaseType_t xMaxFiles = 5;
long lItemsRead, lChar; long lItemsRead, lChar;
F_FILE *pxFile; F_FILE *pxFile;

@ -96,43 +96,43 @@ commands. */
/* /*
* Implements the run-time-stats command. * Implements the run-time-stats command.
*/ */
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the task-stats command. * Implements the task-stats command.
*/ */
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the echo-three-parameters command. * Implements the echo-three-parameters command.
*/ */
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the echo-parameters command. * Implements the echo-parameters command.
*/ */
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that prints out IP address information. * Defines a command that prints out IP address information.
*/ */
static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that prints out the gathered demo debug stats. * Defines a command that prints out the gathered demo debug stats.
*/ */
static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that sends an ICMP ping request to an IP address. * Defines a command that sends an ICMP ping request to an IP address.
*/ */
static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the "trace start" and "trace stop" commands; * Implements the "trace start" and "trace stop" commands;
*/ */
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
#endif #endif
/* Structure that defines the "ip-config" command line command. */ /* Structure that defines the "ip-config" command line command. */
@ -248,7 +248,7 @@ void vRegisterCLICommands( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n"; const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";
@ -269,7 +269,7 @@ const char *const pcHeader = "Task State Priority Stack #\r\n********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n"; const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";
@ -290,11 +290,11 @@ const char * const pcHeader = "Task Abs Time % Time\r\n*********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn; BaseType_t xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -357,11 +357,11 @@ static portBASE_TYPE lParameterNumber = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn; BaseType_t xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -426,10 +426,10 @@ static portBASE_TYPE lParameterNumber = 0;
#if ipconfigSUPPORT_OUTGOING_PINGS == 1 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
char * pcParameter; char * pcParameter;
portBASE_TYPE lParameterStringLength, xReturn; BaseType_t lParameterStringLength, xReturn;
uint32_t ulIPAddress, ulBytesToPing; uint32_t ulIPAddress, ulBytesToPing;
const uint32_t ulDefaultBytesToPing = 8UL; const uint32_t ulDefaultBytesToPing = 8UL;
char cBuffer[ 16 ]; char cBuffer[ 16 ];
@ -517,11 +517,11 @@ static portBASE_TYPE lParameterNumber = 0;
#if configINCLUDE_DEMO_DEBUG_STATS != 0 #if configINCLUDE_DEMO_DEBUG_STATS != 0
static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static portBASE_TYPE xIndex = -1; static BaseType_t xIndex = -1;
extern xExampleDebugStatEntry_t xIPTraceValues[]; extern xExampleDebugStatEntry_t xIPTraceValues[];
portBASE_TYPE xReturn; BaseType_t xReturn;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -553,10 +553,10 @@ static portBASE_TYPE lParameterNumber = 0;
#endif /* configINCLUDE_DEMO_DEBUG_STATS */ #endif /* configINCLUDE_DEMO_DEBUG_STATS */
static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static portBASE_TYPE xIndex = 0; static BaseType_t xIndex = 0;
portBASE_TYPE xReturn; BaseType_t xReturn;
uint32_t ulAddress; uint32_t ulAddress;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
@ -615,10 +615,10 @@ uint32_t ulAddress;
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE lParameterStringLength; BaseType_t lParameterStringLength;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the

@ -66,6 +66,6 @@
#ifndef UDP_COMMAND_INTERPRETER_H #ifndef UDP_COMMAND_INTERPRETER_H
#define UDP_COMMAND_INTERPRETER_H #define UDP_COMMAND_INTERPRETER_H
void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, unsigned portBASE_TYPE uxPriority ); void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, UBaseType_t uxPriority );
#endif /* UDP_COMMAND_INTERPRETER_H */ #endif /* UDP_COMMAND_INTERPRETER_H */

@ -102,7 +102,7 @@ static xSocket_t prvOpenUDPServerSocket( uint16_t usPort );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, unsigned portBASE_TYPE uxPriority ) void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, UBaseType_t uxPriority )
{ {
xTaskCreate( vUDPCommandInterpreterTask, "CLI", usStackSize, ( void * ) ulPort, uxPriority, NULL ); xTaskCreate( vUDPCommandInterpreterTask, "CLI", usStackSize, ( void * ) ulPort, uxPriority, NULL );
} }
@ -118,7 +118,7 @@ void vUDPCommandInterpreterTask( void *pvParameters )
long lBytes, lByte; long lBytes, lByte;
signed char cInChar, cInputIndex = 0; signed char cInChar, cInputIndex = 0;
static char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ]; static char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];
portBASE_TYPE xMoreDataToFollow; BaseType_t xMoreDataToFollow;
struct freertos_sockaddr xClient; struct freertos_sockaddr xClient;
socklen_t xClientAddressLength = 0; /* This is required as a parameter to maintain the sendto() Berkeley sockets API - but it is not actually used so can take any value. */ socklen_t xClientAddressLength = 0; /* This is required as a parameter to maintain the sendto() Berkeley sockets API - but it is not actually used so can take any value. */
xSocket_t xSocket; xSocket_t xSocket;

@ -87,13 +87,13 @@
#include "FreeRTOS_Sockets.h" #include "FreeRTOS_Sockets.h"
/* Small delay used between attempts to obtain a zero copy buffer. */ /* Small delay used between attempts to obtain a zero copy buffer. */
#define echoTINY_DELAY ( ( portTickType ) 2 ) #define echoTINY_DELAY ( ( TickType_t ) 2 )
/* The echo tasks create a socket, send out a number of echo requests /* The echo tasks create a socket, send out a number of echo requests
(listening for each echo reply), then close the socket again before (listening for each echo reply), then close the socket again before
starting over. This delay is used between each iteration to ensure the starting over. This delay is used between each iteration to ensure the
network does not get too congested. */ network does not get too congested. */
#define echoLOOP_DELAY ( ( portTickType ) 250 / portTICK_RATE_MS ) #define echoLOOP_DELAY ( ( TickType_t ) 250 / portTICK_RATE_MS )
#if ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 #if ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1
/* When the trace recorder code is included user events are generated to /* When the trace recorder code is included user events are generated to
@ -125,14 +125,14 @@ static void prvZeroCopyEchoClientTask( void *pvParameters );
/* The receive timeout is set shorter when the windows simulator is used /* The receive timeout is set shorter when the windows simulator is used
because simulated time is slower than real time. */ because simulated time is slower than real time. */
#ifdef _WINDOWS_ #ifdef _WINDOWS_
const portTickType xReceiveTimeOut = 50 / portTICK_RATE_MS; const TickType_t xReceiveTimeOut = 50 / portTICK_RATE_MS;
#else #else
const portTickType xReceiveTimeOut = 500 / portTICK_RATE_MS; const TickType_t xReceiveTimeOut = 500 / portTICK_RATE_MS;
#endif #endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vStartEchoClientTasks( uint16_t usTaskStackSize, unsigned portBASE_TYPE uxTaskPriority ) void vStartEchoClientTasks( uint16_t usTaskStackSize, UBaseType_t uxTaskPriority )
{ {
/* Create the echo client task that does not use the zero copy interface. */ /* Create the echo client task that does not use the zero copy interface. */
xTaskCreate( prvEchoClientTask, /* The function that implements the task. */ xTaskCreate( prvEchoClientTask, /* The function that implements the task. */

@ -71,6 +71,6 @@
* to send to and receive from an echo server. The other task uses the zero * to send to and receive from an echo server. The other task uses the zero
* copy interface to send to and receive from an echo server. * copy interface to send to and receive from an echo server.
*/ */
void vStartEchoClientTasks( uint16_t usTaskStackSize, unsigned portBASE_TYPE uxTaskPriority ); void vStartEchoClientTasks( uint16_t usTaskStackSize, UBaseType_t uxTaskPriority );
#endif /* TWO_ECHO_CLIENTS_H */ #endif /* TWO_ECHO_CLIENTS_H */

@ -128,17 +128,17 @@ xExampleDebugStatEntry_t xIPTraceValues[] =
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE xExampleDebugStatEntries( void ) BaseType_t xExampleDebugStatEntries( void )
{ {
/* Return the number of entries in the xIPTraceValues[] table. */ /* Return the number of entries in the xIPTraceValues[] table. */
return ( portBASE_TYPE ) ( sizeof( xIPTraceValues ) / sizeof( xExampleDebugStatEntry_t ) ); return ( BaseType_t ) ( sizeof( xIPTraceValues ) / sizeof( xExampleDebugStatEntry_t ) );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vExampleDebugStatUpdate( uint8_t ucIdentifier, uint32_t ulValue ) void vExampleDebugStatUpdate( uint8_t ucIdentifier, uint32_t ulValue )
{ {
portBASE_TYPE xIndex; BaseType_t xIndex;
const portBASE_TYPE xEntries = sizeof( xIPTraceValues ) / sizeof( xExampleDebugStatEntry_t ); const BaseType_t xEntries = sizeof( xIPTraceValues ) / sizeof( xExampleDebugStatEntry_t );
/* Update an entry in the xIPTraceValues[] table. Each row in the table /* Update an entry in the xIPTraceValues[] table. Each row in the table
includes a pointer to a function that performs the actual update. This includes a pointer to a function that performs the actual update. This

@ -150,7 +150,7 @@ configINCLUDE_DEMO_DEBUG_STATS setting in FreeRTOSIPConfig.h. */
/* /*
* Returns the number of entries in the xIPTraceValues table. * Returns the number of entries in the xIPTraceValues table.
*/ */
portBASE_TYPE xExampleDebugStatEntries( void ); BaseType_t xExampleDebugStatEntries( void );
#endif /* configINCLUDE_DEMO_DEBUG_STATS == 1 */ #endif /* configINCLUDE_DEMO_DEBUG_STATS == 1 */

@ -83,31 +83,31 @@ static void prvSaveTraceFile( void );
* Defines a command that returns a table showing the state of each task at the * Defines a command that returns a table showing the state of each task at the
* time the command is called. * time the command is called.
*/ */
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that returns a table showing how much time each task has * Defines a command that returns a table showing how much time each task has
* spent in the Running state. * spent in the Running state.
*/ */
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that expects exactly three parameters. Each of the three * Defines a command that expects exactly three parameters. Each of the three
* parameter are echoed back one at a time. * parameter are echoed back one at a time.
*/ */
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that can take a variable number of parameters. Each * Defines a command that can take a variable number of parameters. Each
* parameter is echoes back one at a time. * parameter is echoes back one at a time.
*/ */
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that starts/stops events being recorded for offline viewing * Defines a command that starts/stops events being recorded for offline viewing
* in FreeRTOS+Trace. * in FreeRTOS+Trace.
*/ */
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* Structure that defines the "run-time-stats" command line command. */ /* Structure that defines the "run-time-stats" command line command. */
static const CLI_Command_Definition_t xRunTimeStats = static const CLI_Command_Definition_t xRunTimeStats =
@ -172,7 +172,7 @@ void vRegisterCLICommands( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n"; const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";
@ -193,7 +193,7 @@ const char *const pcHeader = "Task State Priority Stack #\r\n********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n"; const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";
@ -214,11 +214,11 @@ const char * const pcHeader = "Task Abs Time % Time\r\n*********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE lParameterStringLength, xReturn; BaseType_t lParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -281,11 +281,11 @@ static portBASE_TYPE lParameterNumber = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE lParameterStringLength, xReturn; BaseType_t lParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -348,10 +348,10 @@ static portBASE_TYPE lParameterNumber = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE lParameterStringLength; BaseType_t lParameterStringLength;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the

@ -105,7 +105,7 @@
#define configTIMER_QUEUE_LENGTH 20 #define configTIMER_QUEUE_LENGTH 20
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) #define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 ) #define configMAX_PRIORITIES ( ( UBaseType_t ) 7 )
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )

@ -102,7 +102,7 @@ void vUDPCommandInterpreterTask( void *pvParameters )
long lBytes, lByte; long lBytes, lByte;
signed char cInChar, cInputIndex = 0; signed char cInChar, cInputIndex = 0;
static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ]; static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];
portBASE_TYPE xMoreDataToFollow; BaseType_t xMoreDataToFollow;
volatile int iErrorCode = 0; volatile int iErrorCode = 0;
struct sockaddr_in xClient; struct sockaddr_in xClient;
int xClientAddressLength = sizeof( struct sockaddr_in ); int xClientAddressLength = sizeof( struct sockaddr_in );

@ -217,7 +217,7 @@ const uint32_t ulLongTime_ms = 250UL;
static void prvQueueSendTask( void *pvParameters ) static void prvQueueSendTask( void *pvParameters )
{ {
portTickType xNextWakeTime; TickType_t xNextWakeTime;
const unsigned long ulValueToSend = 100UL; const unsigned long ulValueToSend = 100UL;
/* Remove warning about unused parameters. */ /* Remove warning about unused parameters. */

@ -102,7 +102,7 @@
#define configTIMER_QUEUE_LENGTH 20 #define configTIMER_QUEUE_LENGTH 20
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) #define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 ) #define configMAX_PRIORITIES ( ( UBaseType_t ) 7 )
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )

@ -95,7 +95,7 @@ CYASSL* xCyaSSL_Object;
WORD wVersionRequested; WORD wVersionRequested;
WSADATA xWSAData; WSADATA xWSAData;
char cString[ 50 ]; char cString[ 50 ];
portBASE_TYPE lReturned; BaseType_t lReturned;
uint32_t ulCount = 0UL; uint32_t ulCount = 0UL;
/* Remove compiler warning about unused parameters. */ /* Remove compiler warning about unused parameters. */

@ -117,7 +117,7 @@ static CYASSL_CTX* xCyaSSL_ServerContext = NULL;
/* See the comments at the top of main.c. */ /* See the comments at the top of main.c. */
void vSecureTCPServerTask( void *pvParameters ) void vSecureTCPServerTask( void *pvParameters )
{ {
portBASE_TYPE xReturned; BaseType_t xReturned;
long lBytes; long lBytes;
uint8_t cReceivedString[ 60 ]; uint8_t cReceivedString[ 60 ];
struct sockaddr_in xClient; struct sockaddr_in xClient;

@ -82,7 +82,7 @@
*----------------------------------------------------------*/ *----------------------------------------------------------*/
#define configUSE_PREEMPTION 1 #define configUSE_PREEMPTION 1
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 ) #define configMAX_PRIORITIES ( ( UBaseType_t ) 7 )
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */ #define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */ #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32U * 1024U ) ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32U * 1024U ) )

@ -99,7 +99,7 @@ static void prvCreateFileInfoString( char *pcBuffer, F_FIND *pxFindStruct );
/* /*
* Copies an existing file into a newly created file. * Copies an existing file into a newly created file.
*/ */
static portBASE_TYPE prvPerformCopy( const char *pcSourceFile, static BaseType_t prvPerformCopy( const char *pcSourceFile,
int32_t lSourceFileLength, int32_t lSourceFileLength,
const char *pcDestinationFile, const char *pcDestinationFile,
char *pxWriteBuffer, char *pxWriteBuffer,
@ -108,32 +108,32 @@ static portBASE_TYPE prvPerformCopy( const char *pcSourceFile,
/* /*
* Implements the DIR command. * Implements the DIR command.
*/ */
static portBASE_TYPE prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the CD command. * Implements the CD command.
*/ */
static portBASE_TYPE prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the DEL command. * Implements the DEL command.
*/ */
static portBASE_TYPE prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the TYPE command. * Implements the TYPE command.
*/ */
static portBASE_TYPE prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the COPY command. * Implements the COPY command.
*/ */
static portBASE_TYPE prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the TEST command. * Implements the TEST command.
*/ */
static portBASE_TYPE prvTESTFSCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvTESTFSCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* Structure that defines the DIR command line command, which lists all the /* Structure that defines the DIR command line command, which lists all the
files in the current directory. */ files in the current directory. */
@ -207,10 +207,10 @@ void vRegisterFileSystemCLICommands( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn = pdTRUE; BaseType_t xParameterStringLength, xReturn = pdTRUE;
static F_FILE *pxFile = NULL; static F_FILE *pxFile = NULL;
int iChar; int iChar;
size_t xByte; size_t xByte;
@ -281,10 +281,10 @@ size_t xColumns = 50U;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength; BaseType_t xParameterStringLength;
unsigned char ucReturned; unsigned char ucReturned;
size_t xStringLength; size_t xStringLength;
@ -319,11 +319,11 @@ size_t xStringLength;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static F_FIND *pxFindStruct = NULL; static F_FIND *pxFindStruct = NULL;
unsigned char ucReturned; unsigned char ucReturned;
portBASE_TYPE xReturn = pdFALSE; BaseType_t xReturn = pdFALSE;
/* This assumes pcWriteBuffer is long enough. */ /* This assumes pcWriteBuffer is long enough. */
( void ) pcCommandString; ( void ) pcCommandString;
@ -385,10 +385,10 @@ portBASE_TYPE xReturn = pdFALSE;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength; BaseType_t xParameterStringLength;
unsigned char ucReturned; unsigned char ucReturned;
/* This function assumes xWriteBufferLen is large enough! */ /* This function assumes xWriteBufferLen is large enough! */
@ -423,9 +423,9 @@ unsigned char ucReturned;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvTESTFSCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvTESTFSCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
unsigned portBASE_TYPE uxOriginalPriority; UBaseType_t uxOriginalPriority;
/* Avoid compiler warnings. */ /* Avoid compiler warnings. */
( void ) xWriteBufferLen; ( void ) xWriteBufferLen;
@ -450,11 +450,11 @@ unsigned portBASE_TYPE uxOriginalPriority;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
char *pcSourceFile; char *pcSourceFile;
const char *pcDestinationFile; const char *pcDestinationFile;
portBASE_TYPE xParameterStringLength; BaseType_t xParameterStringLength;
long lSourceLength, lDestinationLength = 0; long lSourceLength, lDestinationLength = 0;
/* Obtain the name of the destination file. */ /* Obtain the name of the destination file. */
@ -520,7 +520,7 @@ long lSourceLength, lDestinationLength = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvPerformCopy( const char *pcSourceFile, static BaseType_t prvPerformCopy( const char *pcSourceFile,
int32_t lSourceFileLength, int32_t lSourceFileLength,
const char *pcDestinationFile, const char *pcDestinationFile,
char *pxWriteBuffer, char *pxWriteBuffer,
@ -528,7 +528,7 @@ static portBASE_TYPE prvPerformCopy( const char *pcSourceFile,
{ {
int32_t lBytesRead = 0, lBytesToRead, lBytesRemaining; int32_t lBytesRead = 0, lBytesToRead, lBytesRemaining;
F_FILE *pxFile; F_FILE *pxFile;
portBASE_TYPE xReturn = pdPASS; BaseType_t xReturn = pdPASS;
/* NOTE: Error handling has been omitted for clarity. */ /* NOTE: Error handling has been omitted for clarity. */

@ -163,9 +163,9 @@ unsigned char ucStatus;
static void prvCreateDemoFilesUsing_f_write( void ) static void prvCreateDemoFilesUsing_f_write( void )
{ {
portBASE_TYPE xFileNumber, xWriteNumber; BaseType_t xFileNumber, xWriteNumber;
char cFileName[ fsMAX_FILE_NAME_LEN ]; char cFileName[ fsMAX_FILE_NAME_LEN ];
const portBASE_TYPE xMaxFiles = 5; const BaseType_t xMaxFiles = 5;
long lItemsWritten; long lItemsWritten;
F_FILE *pxFile; F_FILE *pxFile;
@ -207,9 +207,9 @@ F_FILE *pxFile;
static void prvVerifyDemoFileUsing_f_read( void ) static void prvVerifyDemoFileUsing_f_read( void )
{ {
portBASE_TYPE xFileNumber, xReadNumber; BaseType_t xFileNumber, xReadNumber;
char cFileName[ fsMAX_FILE_NAME_LEN ]; char cFileName[ fsMAX_FILE_NAME_LEN ];
const portBASE_TYPE xMaxFiles = 5; const BaseType_t xMaxFiles = 5;
long lItemsRead, lChar; long lItemsRead, lChar;
F_FILE *pxFile; F_FILE *pxFile;

@ -91,28 +91,28 @@
/* /*
* Implements the run-time-stats command. * Implements the run-time-stats command.
*/ */
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the task-stats command. * Implements the task-stats command.
*/ */
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the echo-three-parameters command. * Implements the echo-three-parameters command.
*/ */
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the echo-parameters command. * Implements the echo-parameters command.
*/ */
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the "trace start" and "trace stop" commands; * Implements the "trace start" and "trace stop" commands;
*/ */
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
#endif #endif
/* Structure that defines the "run-time-stats" command line command. This /* Structure that defines the "run-time-stats" command line command. This
@ -187,7 +187,7 @@ void vRegisterSampleCLICommands( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n"; const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";
@ -208,7 +208,7 @@ const char *const pcHeader = "Task State Priority Stack #\r\n********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n"; const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";
@ -229,11 +229,11 @@ const char * const pcHeader = "Task Abs Time % Time\r\n*********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn; BaseType_t xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -296,11 +296,11 @@ static portBASE_TYPE lParameterNumber = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn; BaseType_t xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -365,10 +365,10 @@ static portBASE_TYPE lParameterNumber = 0;
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE lParameterStringLength; BaseType_t lParameterStringLength;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the

@ -110,7 +110,7 @@ void vUDPCommandInterpreterTask( void *pvParameters )
long lBytes, lByte; long lBytes, lByte;
signed char cInChar, cInputIndex = 0; signed char cInChar, cInputIndex = 0;
static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ]; static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];
portBASE_TYPE xMoreDataToFollow; BaseType_t xMoreDataToFollow;
volatile int iErrorCode = 0; volatile int iErrorCode = 0;
struct sockaddr_in xClient; struct sockaddr_in xClient;
int xClientAddressLength = sizeof( struct sockaddr_in ); int xClientAddressLength = sizeof( struct sockaddr_in );

@ -180,7 +180,7 @@ const unsigned long ulMSToSleep = 5;
the set of sample files are created from the idle task hook function. */ the set of sample files are created from the idle task hook function. */
#if F_FS_THREAD_AWARE == 1 #if F_FS_THREAD_AWARE == 1
{ {
static portBASE_TYPE xCreatedSampleFiles = pdFALSE; static BaseType_t xCreatedSampleFiles = pdFALSE;
/* Initialise the drive and file system, then create a few example /* Initialise the drive and file system, then create a few example
files. The output from this function just goes to the stdout window, files. The output from this function just goes to the stdout window,

@ -96,43 +96,43 @@ commands. */
/* /*
* Implements the run-time-stats command. * Implements the run-time-stats command.
*/ */
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the task-stats command. * Implements the task-stats command.
*/ */
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the echo-three-parameters command. * Implements the echo-three-parameters command.
*/ */
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the echo-parameters command. * Implements the echo-parameters command.
*/ */
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that prints out IP address information. * Defines a command that prints out IP address information.
*/ */
static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that prints out the gathered demo debug stats. * Defines a command that prints out the gathered demo debug stats.
*/ */
static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Defines a command that sends an ICMP ping request to an IP address. * Defines a command that sends an ICMP ping request to an IP address.
*/ */
static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Implements the "trace start" and "trace stop" commands; * Implements the "trace start" and "trace stop" commands;
*/ */
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
#endif #endif
/* Structure that defines the "ip-config" command line command. */ /* Structure that defines the "ip-config" command line command. */
@ -248,7 +248,7 @@ void vRegisterCLICommands( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n"; const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";
@ -269,7 +269,7 @@ const char *const pcHeader = "Task State Priority Stack #\r\n********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n"; const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";
@ -290,11 +290,11 @@ const char * const pcHeader = "Task Abs Time % Time\r\n*********
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn; BaseType_t xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -357,11 +357,11 @@ static portBASE_TYPE lParameterNumber = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn; BaseType_t xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0; static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -426,10 +426,10 @@ static portBASE_TYPE lParameterNumber = 0;
#if ipconfigSUPPORT_OUTGOING_PINGS == 1 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
char * pcParameter; char * pcParameter;
portBASE_TYPE lParameterStringLength, xReturn; BaseType_t lParameterStringLength, xReturn;
uint32_t ulIPAddress, ulBytesToPing; uint32_t ulIPAddress, ulBytesToPing;
const uint32_t ulDefaultBytesToPing = 8UL; const uint32_t ulDefaultBytesToPing = 8UL;
char cBuffer[ 16 ]; char cBuffer[ 16 ];
@ -517,11 +517,11 @@ static portBASE_TYPE lParameterNumber = 0;
#if configINCLUDE_DEMO_DEBUG_STATS != 0 #if configINCLUDE_DEMO_DEBUG_STATS != 0
static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static portBASE_TYPE xIndex = -1; static BaseType_t xIndex = -1;
extern xExampleDebugStatEntry_t xIPTraceValues[]; extern xExampleDebugStatEntry_t xIPTraceValues[];
portBASE_TYPE xReturn; BaseType_t xReturn;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the
@ -553,10 +553,10 @@ static portBASE_TYPE lParameterNumber = 0;
#endif /* configINCLUDE_DEMO_DEBUG_STATS */ #endif /* configINCLUDE_DEMO_DEBUG_STATS */
static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static portBASE_TYPE xIndex = 0; static BaseType_t xIndex = 0;
portBASE_TYPE xReturn; BaseType_t xReturn;
uint32_t ulAddress; uint32_t ulAddress;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
@ -615,10 +615,10 @@ uint32_t ulAddress;
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
const char *pcParameter; const char *pcParameter;
portBASE_TYPE lParameterStringLength; BaseType_t lParameterStringLength;
/* Remove compile time warnings about unused parameters, and check the /* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer is not NULL. NOTE - for simplicity, this example assumes the

@ -127,7 +127,7 @@ static const char * const pcNewLine = "\r\n";
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vCDCCommandConsoleStart( uint16_t usStackSize, unsigned portBASE_TYPE uxPriority ) void vCDCCommandConsoleStart( uint16_t usStackSize, UBaseType_t uxPriority )
{ {
/* Create the semaphores and mutexes used by the CDC to task interface. */ /* Create the semaphores and mutexes used by the CDC to task interface. */
xCDCMutex = xSemaphoreCreateMutex(); xCDCMutex = xSemaphoreCreateMutex();
@ -156,7 +156,7 @@ char cRxedChar;
uint8_t ucInputIndex = 0; uint8_t ucInputIndex = 0;
char *pcOutputString; char *pcOutputString;
static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ]; static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];
portBASE_TYPE xReturned; BaseType_t xReturned;
( void ) pvParameters; ( void ) pvParameters;
@ -310,7 +310,7 @@ char cInputChar;
/* Callback function executed by the USB interrupt when new data arrives. */ /* Callback function executed by the USB interrupt when new data arrives. */
void vCDCNewDataNotify( void ) void vCDCNewDataNotify( void )
{ {
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; BaseType_t xHigherPriorityTaskWoken = pdFALSE;
configASSERT( xNewDataSemaphore ); configASSERT( xNewDataSemaphore );

@ -70,7 +70,7 @@
* Create the task that implements a command console using the USB virtual com * Create the task that implements a command console using the USB virtual com
* port driver for intput and output. * port driver for intput and output.
*/ */
void vCDCCommandConsoleStart( uint16_t usStackSize, unsigned portBASE_TYPE uxPriority ); void vCDCCommandConsoleStart( uint16_t usStackSize, UBaseType_t uxPriority );
#endif /* CDC_COMMAND_CONSOLE_H */ #endif /* CDC_COMMAND_CONSOLE_H */

@ -71,6 +71,6 @@
* to send to and receive from an echo server. The other task uses the zero * to send to and receive from an echo server. The other task uses the zero
* copy interface to send to and receive from an echo server. * copy interface to send to and receive from an echo server.
*/ */
void vStartEchoClientTasks( uint16_t usTaskStackSize, unsigned portBASE_TYPE uxTaskPriority ); void vStartEchoClientTasks( uint16_t usTaskStackSize, UBaseType_t uxTaskPriority );
#endif /* TWO_ECHO_CLIENTS_H */ #endif /* TWO_ECHO_CLIENTS_H */

@ -213,7 +213,7 @@ void vApplicationMallocFailedHook( void )
/* Called by FreeRTOS+UDP when the network connects. */ /* Called by FreeRTOS+UDP when the network connects. */
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent ) void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{ {
static portBASE_TYPE xTaskAlreadyCreated = pdFALSE; static BaseType_t xTaskAlreadyCreated = pdFALSE;
if( eNetworkEvent == eNetworkUp ) if( eNetworkEvent == eNetworkUp )
{ {

@ -81,7 +81,7 @@
#include "FreeRTOS_UDP_IP.h" #include "FreeRTOS_UDP_IP.h"
#include "FreeRTOS_Sockets.h" #include "FreeRTOS_Sockets.h"
#define selTINY_DELAY ( ( portTickType ) 2 ) #define selTINY_DELAY ( ( TickType_t ) 2 )
#define selNUMBER_OF_SOCKETS ( 3 ) #define selNUMBER_OF_SOCKETS ( 3 )
#define selSELECT_QUEUE_SIZE ( selNUMBER_OF_SOCKETS * 2 ) #define selSELECT_QUEUE_SIZE ( selNUMBER_OF_SOCKETS * 2 )
@ -101,7 +101,7 @@ static xSocket_t xRxSockets[ selNUMBER_OF_SOCKETS ] = { 0 };
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vStartSelectUDPServerTasks( uint16_t usStackSize, uint32_t ulFirstPortNumber, unsigned portBASE_TYPE uxPriority ) void vStartSelectUDPServerTasks( uint16_t usStackSize, uint32_t ulFirstPortNumber, UBaseType_t uxPriority )
{ {
/* Create task that sends to multiple sockets, and the task that uses the /* Create task that sends to multiple sockets, and the task that uses the
FreeRTOS_select() function to receive from multiple sockets. The first FreeRTOS_select() function to receive from multiple sockets. The first
@ -120,7 +120,7 @@ struct freertos_sockaddr xAddress;
uint32_t xClientLength = sizeof( struct freertos_sockaddr ), ulFirstRxPortNumber, x; uint32_t xClientLength = sizeof( struct freertos_sockaddr ), ulFirstRxPortNumber, x;
uint32_t ulReceivedValue = 0, ulExpectedValue = 0UL, ulReceivedCount[ selNUMBER_OF_SOCKETS ] = { 0 }; uint32_t ulReceivedValue = 0, ulExpectedValue = 0UL, ulReceivedCount[ selNUMBER_OF_SOCKETS ] = { 0 };
int32_t lBytes; int32_t lBytes;
const portTickType xRxBlockTime = 0; const TickType_t xRxBlockTime = 0;
/* The number of the port the first Rx socket will be bound to is passed in /* The number of the port the first Rx socket will be bound to is passed in
as the task parameter. Other port numbers used are consecutive from this. */ as the task parameter. Other port numbers used are consecutive from this. */
@ -197,7 +197,7 @@ uint32_t ulTxValue = 0;
struct freertos_sockaddr xDestinationAddress; struct freertos_sockaddr xDestinationAddress;
uint32_t ulIPAddress, ulFirstDestinationPortNumber, xPortNumber; uint32_t ulIPAddress, ulFirstDestinationPortNumber, xPortNumber;
xSocket_t xTxSocket; xSocket_t xTxSocket;
const portTickType xShortDelay = 100 / portTICK_RATE_MS, xSendBlockTime = 500 / portTICK_RATE_MS; const TickType_t xShortDelay = 100 / portTICK_RATE_MS, xSendBlockTime = 500 / portTICK_RATE_MS;
srand( ( unsigned int ) &xPortNumber ); srand( ( unsigned int ) &xPortNumber );

@ -81,7 +81,7 @@
#include "FreeRTOS_UDP_IP.h" #include "FreeRTOS_UDP_IP.h"
#include "FreeRTOS_Sockets.h" #include "FreeRTOS_Sockets.h"
#define simpTINY_DELAY ( ( portTickType ) 2 ) #define simpTINY_DELAY ( ( TickType_t ) 2 )
/* /*
* Uses a socket to send data without using the zero copy option. * Uses a socket to send data without using the zero copy option.
@ -109,7 +109,7 @@ static void prvSimpleZeroCopyServerTask( void *pvParameters );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vStartSimpleUDPClientServerTasks( uint16_t usStackSize, uint32_t ulPort, unsigned portBASE_TYPE uxPriority ) void vStartSimpleUDPClientServerTasks( uint16_t usStackSize, uint32_t ulPort, UBaseType_t uxPriority )
{ {
/* Create the client and server tasks that do not use the zero copy /* Create the client and server tasks that do not use the zero copy
interface. */ interface. */
@ -127,10 +127,10 @@ static void prvSimpleClientTask( void *pvParameters )
xSocket_t xClientSocket; xSocket_t xClientSocket;
struct freertos_sockaddr xDestinationAddress; struct freertos_sockaddr xDestinationAddress;
char cString[ 50 ]; char cString[ 50 ];
portBASE_TYPE lReturned; BaseType_t lReturned;
uint32_t ulCount = 0UL, ulIPAddress; uint32_t ulCount = 0UL, ulIPAddress;
const uint32_t ulLoopsPerSocket = 10UL; const uint32_t ulLoopsPerSocket = 10UL;
const portTickType x150ms = 150UL / portTICK_RATE_MS; const TickType_t x150ms = 150UL / portTICK_RATE_MS;
/* Remove compiler warning about unused parameters. */ /* Remove compiler warning about unused parameters. */
( void ) pvParameters; ( void ) pvParameters;
@ -230,7 +230,7 @@ xSocket_t xListeningSocket;
} }
/* Error check. */ /* Error check. */
configASSERT( lBytes == ( portBASE_TYPE ) strlen( cReceivedString ) ); configASSERT( lBytes == ( BaseType_t ) strlen( cReceivedString ) );
} }
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -240,11 +240,11 @@ static void prvSimpleZeroCopyUDPClientTask( void *pvParameters )
xSocket_t xClientSocket; xSocket_t xClientSocket;
uint8_t *pucUDPPayloadBuffer; uint8_t *pucUDPPayloadBuffer;
struct freertos_sockaddr xDestinationAddress; struct freertos_sockaddr xDestinationAddress;
portBASE_TYPE lReturned; BaseType_t lReturned;
uint32_t ulCount = 0UL, ulIPAddress; uint32_t ulCount = 0UL, ulIPAddress;
const uint32_t ulLoopsPerSocket = 10UL; const uint32_t ulLoopsPerSocket = 10UL;
const char *pcStringToSend = "Server received (using zero copy): Message number "; const char *pcStringToSend = "Server received (using zero copy): Message number ";
const portTickType x150ms = 150UL / portTICK_RATE_MS; const TickType_t x150ms = 150UL / portTICK_RATE_MS;
/* 15 is added to ensure the number, \r\n and terminating zero fit. */ /* 15 is added to ensure the number, \r\n and terminating zero fit. */
const size_t xStringLength = strlen( pcStringToSend ) + 15; const size_t xStringLength = strlen( pcStringToSend ) + 15;
@ -379,7 +379,7 @@ xSocket_t xListeningSocket;
/* It is expected to receive one more byte than the string length as /* It is expected to receive one more byte than the string length as
the NULL terminator is also transmitted. */ the NULL terminator is also transmitted. */
configASSERT( lBytes == ( ( portBASE_TYPE ) strlen( ( const char * ) pucUDPPayloadBuffer ) + 1 ) ); configASSERT( lBytes == ( ( BaseType_t ) strlen( ( const char * ) pucUDPPayloadBuffer ) + 1 ) );
/* Print the received characters. */ /* Print the received characters. */
if( lBytes > 0 ) if( lBytes > 0 )

@ -102,7 +102,7 @@ static xSocket_t prvOpenUDPServerSocket( uint16_t usPort );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, unsigned portBASE_TYPE uxPriority ) void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, UBaseType_t uxPriority )
{ {
xTaskCreate( vUDPCommandInterpreterTask, "CLI", usStackSize, ( void * ) ulPort, uxPriority, NULL ); xTaskCreate( vUDPCommandInterpreterTask, "CLI", usStackSize, ( void * ) ulPort, uxPriority, NULL );
} }
@ -118,7 +118,7 @@ void vUDPCommandInterpreterTask( void *pvParameters )
long lBytes, lByte; long lBytes, lByte;
signed char cInChar, cInputIndex = 0; signed char cInChar, cInputIndex = 0;
static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ]; static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];
portBASE_TYPE xMoreDataToFollow; BaseType_t xMoreDataToFollow;
struct freertos_sockaddr xClient; struct freertos_sockaddr xClient;
socklen_t xClientAddressLength = 0; /* This is required as a parameter to maintain the sendto() Berkeley sockets API - but it is not actually used so can take any value. */ socklen_t xClientAddressLength = 0; /* This is required as a parameter to maintain the sendto() Berkeley sockets API - but it is not actually used so can take any value. */
xSocket_t xSocket; xSocket_t xSocket;

@ -66,6 +66,6 @@
#ifndef SELECT_SERVER_H #ifndef SELECT_SERVER_H
#define SELECT_SERVER_H #define SELECT_SERVER_H
void vStartSelectUDPServerTasks( uint16_t usStackSize, uint32_t ulFirstPortNumber, unsigned portBASE_TYPE uxPriority ); void vStartSelectUDPServerTasks( uint16_t usStackSize, uint32_t ulFirstPortNumber, UBaseType_t uxPriority );
#endif /* SELECT_SERVER_H */ #endif /* SELECT_SERVER_H */

@ -66,6 +66,6 @@
#ifndef SIMPLE_CLIENT_AND_SERVER_H #ifndef SIMPLE_CLIENT_AND_SERVER_H
#define SIMPLE_CLIENT_AND_SERVER_H #define SIMPLE_CLIENT_AND_SERVER_H
void vStartSimpleUDPClientServerTasks( uint16_t usStackSize, uint32_t ulsPort, unsigned portBASE_TYPE uxPriority ); void vStartSimpleUDPClientServerTasks( uint16_t usStackSize, uint32_t ulsPort, UBaseType_t uxPriority );
#endif /* SIMPLE_CLIENT_AND_SERVER_H */ #endif /* SIMPLE_CLIENT_AND_SERVER_H */

@ -66,6 +66,6 @@
#ifndef UDP_COMMAND_INTERPRETER_H #ifndef UDP_COMMAND_INTERPRETER_H
#define UDP_COMMAND_INTERPRETER_H #define UDP_COMMAND_INTERPRETER_H
void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, unsigned portBASE_TYPE uxPriority ); void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, UBaseType_t uxPriority );
#endif /* UDP_COMMAND_INTERPRETER_H */ #endif /* UDP_COMMAND_INTERPRETER_H */

@ -82,7 +82,7 @@
*----------------------------------------------------------*/ *----------------------------------------------------------*/
#define configUSE_PREEMPTION 1 #define configUSE_PREEMPTION 1
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 ) #define configMAX_PRIORITIES ( ( UBaseType_t ) 7 )
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */ #define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */ #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32U * 1024U ) ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32U * 1024U ) )
@ -179,7 +179,7 @@ example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 1
results in the wired network being used, while setting results in the wired network being used, while setting
configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being
used. */ used. */
#define configNETWORK_INTERFACE_TO_USE 1L #define configNETWORK_INTERFACE_TO_USE 4L
/* The address of an echo server that will be used by the two demo echo client /* The address of an echo server that will be used by the two demo echo client
tasks. tasks.

@ -119,9 +119,9 @@ void vNetifTx( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
unsigned portBASE_TYPE uxNetifRx( void ) UBaseType_t uxNetifRx( void )
{ {
unsigned portBASE_TYPE xDataLen; UBaseType_t xDataLen;
unsigned char *pucTemp; unsigned char *pucTemp;
/* Check there is really data available. */ /* Check there is really data available. */
@ -156,9 +156,9 @@ unsigned char *pucTemp;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE xNetifInit( void ) BaseType_t xNetifInit( void )
{ {
portBASE_TYPE x; BaseType_t x;
pcap_if_t *pxAllNetworkInterfaces; pcap_if_t *pxAllNetworkInterfaces;
/* Allocate a free buffer to each buffer pointer. */ /* Allocate a free buffer to each buffer pointer. */

@ -78,13 +78,13 @@ void vNetifTx( void );
* bytes are placed in uip_buf. The number of bytes copied into uip_buf is * bytes are placed in uip_buf. The number of bytes copied into uip_buf is
* returned. * returned.
*/ */
unsigned portBASE_TYPE uxNetifRx( void ); UBaseType_t uxNetifRx( void );
/* /*
* Prepare a packet capture session. This will print out all the network * Prepare a packet capture session. This will print out all the network
* interfaces available, and the one actually used is set by the * interfaces available, and the one actually used is set by the
* configNETWORK_INTERFACE_TO_USE constant that is defined in * configNETWORK_INTERFACE_TO_USE constant that is defined in
* FreeRTOSConfig.h. */ * FreeRTOSConfig.h. */
portBASE_TYPE xNetifInit( void ); BaseType_t xNetifInit( void );
#endif /* NET_IF_H */ #endif /* NET_IF_H */

@ -225,7 +225,7 @@ void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{ {
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress; uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
int8_t cBuffer[ 16 ]; int8_t cBuffer[ 16 ];
static portBASE_TYPE xTasksAlreadyCreated = pdFALSE; static BaseType_t xTasksAlreadyCreated = pdFALSE;
if( eNetworkEvent == eNetworkUp ) if( eNetworkEvent == eNetworkUp )
{ {

@ -61,7 +61,7 @@ typedef struct xCOMMAND_INPUT_LIST
* The callback function that is executed when "help" is entered. This is the * The callback function that is executed when "help" is entered. This is the
* only default command that is always present. * only default command that is always present.
*/ */
static portBASE_TYPE prvHelpCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); static BaseType_t prvHelpCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* /*
* Return the number of parameters that follow the command name. * Return the number of parameters that follow the command name.
@ -98,11 +98,11 @@ static char cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE FreeRTOS_CLIRegisterCommand( const CLI_Command_Definition_t * const pxCommandToRegister ) BaseType_t FreeRTOS_CLIRegisterCommand( const CLI_Command_Definition_t * const pxCommandToRegister )
{ {
static CLI_Definition_List_Item_t *pxLastCommandInList = &xRegisteredCommands; static CLI_Definition_List_Item_t *pxLastCommandInList = &xRegisteredCommands;
CLI_Definition_List_Item_t *pxNewListItem; CLI_Definition_List_Item_t *pxNewListItem;
portBASE_TYPE xReturn = pdFAIL; BaseType_t xReturn = pdFAIL;
/* Check the parameter is not NULL. */ /* Check the parameter is not NULL. */
configASSERT( pxCommandToRegister ); configASSERT( pxCommandToRegister );
@ -139,10 +139,10 @@ portBASE_TYPE xReturn = pdFAIL;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE FreeRTOS_CLIProcessCommand( const char * const pcCommandInput, char * pcWriteBuffer, size_t xWriteBufferLen ) BaseType_t FreeRTOS_CLIProcessCommand( const char * const pcCommandInput, char * pcWriteBuffer, size_t xWriteBufferLen )
{ {
static const CLI_Definition_List_Item_t *pxCommand = NULL; static const CLI_Definition_List_Item_t *pxCommand = NULL;
portBASE_TYPE xReturn = pdTRUE; BaseType_t xReturn = pdTRUE;
const char *pcRegisteredCommandString; const char *pcRegisteredCommandString;
size_t xCommandStringLength; size_t xCommandStringLength;
@ -220,9 +220,9 @@ char *FreeRTOS_CLIGetOutputBuffer( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
const char *FreeRTOS_CLIGetParameter( const char *pcCommandString, unsigned portBASE_TYPE uxWantedParameter, portBASE_TYPE *pxParameterStringLength ) const char *FreeRTOS_CLIGetParameter( const char *pcCommandString, UBaseType_t uxWantedParameter, BaseType_t *pxParameterStringLength )
{ {
unsigned portBASE_TYPE uxParametersFound = 0; UBaseType_t uxParametersFound = 0;
const char *pcReturn = NULL; const char *pcReturn = NULL;
*pxParameterStringLength = 0; *pxParameterStringLength = 0;
@ -276,10 +276,10 @@ const char *pcReturn = NULL;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvHelpCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) static BaseType_t prvHelpCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{ {
static const CLI_Definition_List_Item_t * pxCommand = NULL; static const CLI_Definition_List_Item_t * pxCommand = NULL;
signed portBASE_TYPE xReturn; BaseType_t xReturn;
( void ) pcCommandString; ( void ) pcCommandString;
@ -312,7 +312,7 @@ signed portBASE_TYPE xReturn;
static int8_t prvGetNumberOfParameters( const char *pcCommandString ) static int8_t prvGetNumberOfParameters( const char *pcCommandString )
{ {
int8_t cParameters = 0; int8_t cParameters = 0;
portBASE_TYPE xLastCharacterWasSpace = pdFALSE; BaseType_t xLastCharacterWasSpace = pdFALSE;
/* Count the number of space delimited words in pcCommandString. */ /* Count the number of space delimited words in pcCommandString. */
while( *pcCommandString != 0x00 ) while( *pcCommandString != 0x00 )

@ -48,7 +48,7 @@ commands must comply. pcWriteBuffer is a buffer into which the output from
executing the command can be written, xWriteBufferLen is the length, in bytes of executing the command can be written, xWriteBufferLen is the length, in bytes of
the pcWriteBuffer buffer, and pcCommandString is the entire string as input by the pcWriteBuffer buffer, and pcCommandString is the entire string as input by
the user (from which parameters can be extracted).*/ the user (from which parameters can be extracted).*/
typedef portBASE_TYPE (*pdCOMMAND_LINE_CALLBACK)( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ); typedef BaseType_t (*pdCOMMAND_LINE_CALLBACK)( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* The structure that defines command line commands. A command line command /* The structure that defines command line commands. A command line command
should be defined by declaring a const structure of this type. */ should be defined by declaring a const structure of this type. */
@ -69,7 +69,7 @@ typedef struct xCOMMAND_LINE_INPUT
* handled by the command interpreter. Once a command has been registered it * handled by the command interpreter. Once a command has been registered it
* can be executed from the command line. * can be executed from the command line.
*/ */
portBASE_TYPE FreeRTOS_CLIRegisterCommand( const CLI_Command_Definition_t * const pxCommandToRegister ); BaseType_t FreeRTOS_CLIRegisterCommand( const CLI_Command_Definition_t * const pxCommandToRegister );
/* /*
* Runs the command interpreter for the command string "pcCommandInput". Any * Runs the command interpreter for the command string "pcCommandInput". Any
@ -82,7 +82,7 @@ portBASE_TYPE FreeRTOS_CLIRegisterCommand( const CLI_Command_Definition_t * cons
* pcCmdIntProcessCommand is not reentrant. It must not be called from more * pcCmdIntProcessCommand is not reentrant. It must not be called from more
* than one task - or at least - by more than one task at a time. * than one task - or at least - by more than one task at a time.
*/ */
portBASE_TYPE FreeRTOS_CLIProcessCommand( const char * const pcCommandInput, char * pcWriteBuffer, size_t xWriteBufferLen ); BaseType_t FreeRTOS_CLIProcessCommand( const char * const pcCommandInput, char * pcWriteBuffer, size_t xWriteBufferLen );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -102,7 +102,7 @@ char *FreeRTOS_CLIGetOutputBuffer( void );
/* /*
* Return a pointer to the xParameterNumber'th word in pcCommandString. * Return a pointer to the xParameterNumber'th word in pcCommandString.
*/ */
const char *FreeRTOS_CLIGetParameter( const char *pcCommandString, unsigned portBASE_TYPE uxWantedParameter, portBASE_TYPE *pxParameterStringLength ); const char *FreeRTOS_CLIGetParameter( const char *pcCommandString, UBaseType_t uxWantedParameter, BaseType_t *pxParameterStringLength );
#endif /* COMMAND_INTERPRETER_H */ #endif /* COMMAND_INTERPRETER_H */

@ -489,8 +489,8 @@ void* prvTraceGetCurrentTaskHandle(void);
/* Called on each OS tick. Will call uiPortGetTimestamp to make sure it is called at least once every OS tick. */ /* Called on each OS tick. Will call uiPortGetTimestamp to make sure it is called at least once every OS tick. */
#undef traceTASK_INCREMENT_TICK #undef traceTASK_INCREMENT_TICK
#define traceTASK_INCREMENT_TICK( xTickCount ) \ #define traceTASK_INCREMENT_TICK( xTickCount ) \
if (uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdTRUE || uxPendedTicks == 0) { trcKERNEL_HOOKS_INCREMENT_TICK(); } \ if (uxSchedulerSuspended == ( UBaseType_t ) pdTRUE || uxPendedTicks == 0) { trcKERNEL_HOOKS_INCREMENT_TICK(); } \
if (uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE) { trcKERNEL_HOOKS_NEW_TIME(DIV_NEW_TIME, xTickCount + 1); } if (uxSchedulerSuspended == ( UBaseType_t ) pdFALSE) { trcKERNEL_HOOKS_NEW_TIME(DIV_NEW_TIME, xTickCount + 1); }
/* Called on each task-switch */ /* Called on each task-switch */
#undef traceTASK_SWITCHED_IN #undef traceTASK_SWITCHED_IN

@ -56,7 +56,7 @@ traceObjectClass TraceObjectClassTable[5] = {
int uiInEventGroupSetBitsFromISR = 0; int uiInEventGroupSetBitsFromISR = 0;
extern unsigned char ucQueueGetQueueType(void*); extern unsigned char ucQueueGetQueueType(void*);
extern portBASE_TYPE uxQueueGetQueueNumber(void*); extern BaseType_t uxQueueGetQueueNumber(void*);
objectHandleType prvTraceGetObjectNumber(void* handle) objectHandleType prvTraceGetObjectNumber(void* handle)
{ {

@ -185,7 +185,7 @@ static void prvSendDHCPDiscover( xMACAddress_t *pxMACAddress );
/* /*
* Interpret message received on the DHCP socket. * Interpret message received on the DHCP socket.
*/ */
static portBASE_TYPE prvProcessDHCPReplies( uint8_t ucExpectedMessageType, xMACAddress_t *pxMACAddress, xNetworkAddressingParameters_t *pxNetworkAddressing ); static BaseType_t prvProcessDHCPReplies( uint8_t ucExpectedMessageType, xMACAddress_t *pxMACAddress, xNetworkAddressingParameters_t *pxNetworkAddressing );
/* /*
* Generate a DHCP request packet, and send it on the DHCP socket. * Generate a DHCP request packet, and send it on the DHCP socket.
@ -221,14 +221,14 @@ static xSocket_t xDHCPSocket = NULL;
static uint32_t ulTransactionId = 0UL, ulOfferedIPAddress = 0UL, ulDHCPServerAddress = 0UL, ulLeaseTime = 0; static uint32_t ulTransactionId = 0UL, ulOfferedIPAddress = 0UL, ulDHCPServerAddress = 0UL, ulLeaseTime = 0;
/* Hold information on the current timer state. */ /* Hold information on the current timer state. */
static portTickType xDHCPTxTime = 0x00, xDHCPTxPeriod = 0x00; static TickType_t xDHCPTxTime = 0x00, xDHCPTxPeriod = 0x00;
/* Maintains the DHCP state machine state. */ /* Maintains the DHCP state machine state. */
static eDHCPState_t eDHCPState = eWaitingSendFirstDiscover; static eDHCPState_t eDHCPState = eWaitingSendFirstDiscover;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vDHCPProcess( portBASE_TYPE xReset, xMACAddress_t *pxMACAddress, uint32_t *pulIPAddress, xNetworkAddressingParameters_t *pxNetworkAddressing ) void vDHCPProcess( BaseType_t xReset, xMACAddress_t *pxMACAddress, uint32_t *pulIPAddress, xNetworkAddressingParameters_t *pxNetworkAddressing )
{ {
if( xReset != pdFALSE ) if( xReset != pdFALSE )
{ {
@ -288,7 +288,7 @@ void vDHCPProcess( portBASE_TYPE xReset, xMACAddress_t *pxMACAddress, uint32_t *
} }
taskEXIT_CRITICAL(); taskEXIT_CRITICAL();
eDHCPState = eNotUsingLeasedAddress; eDHCPState = eNotUsingLeasedAddress;
xTimerStop( xDHCPTimer, ( portTickType ) 0 ); xTimerStop( xDHCPTimer, ( TickType_t ) 0 );
#if ipconfigUSE_NETWORK_EVENT_HOOK == 1 #if ipconfigUSE_NETWORK_EVENT_HOOK == 1
{ {
@ -395,7 +395,7 @@ void vDHCPProcess( portBASE_TYPE xReset, xMACAddress_t *pxMACAddress, uint32_t *
break; break;
case eNotUsingLeasedAddress: case eNotUsingLeasedAddress:
xTimerStop( xDHCPTimer, ( portTickType ) 0 ); xTimerStop( xDHCPTimer, ( TickType_t ) 0 );
break; break;
} }
} }
@ -404,8 +404,8 @@ void vDHCPProcess( portBASE_TYPE xReset, xMACAddress_t *pxMACAddress, uint32_t *
static void prvCreateDHCPSocket( void ) static void prvCreateDHCPSocket( void )
{ {
struct freertos_sockaddr xAddress; struct freertos_sockaddr xAddress;
portBASE_TYPE xReturn; BaseType_t xReturn;
portTickType xTimeoutTime = 0; TickType_t xTimeoutTime = 0;
/* Create the socket, if it has not already been created. */ /* Create the socket, if it has not already been created. */
if( xDHCPSocket == NULL ) if( xDHCPSocket == NULL )
@ -415,8 +415,8 @@ portTickType xTimeoutTime = 0;
/* Ensure the Rx and Tx timeouts are zero as the DHCP executes in the /* Ensure the Rx and Tx timeouts are zero as the DHCP executes in the
context of the IP task. */ context of the IP task. */
FreeRTOS_setsockopt( xDHCPSocket, 0, FREERTOS_SO_RCVTIMEO, ( void * ) &xTimeoutTime, sizeof( portTickType ) ); FreeRTOS_setsockopt( xDHCPSocket, 0, FREERTOS_SO_RCVTIMEO, ( void * ) &xTimeoutTime, sizeof( TickType_t ) );
FreeRTOS_setsockopt( xDHCPSocket, 0, FREERTOS_SO_SNDTIMEO, ( void * ) &xTimeoutTime, sizeof( portTickType ) ); FreeRTOS_setsockopt( xDHCPSocket, 0, FREERTOS_SO_SNDTIMEO, ( void * ) &xTimeoutTime, sizeof( TickType_t ) );
/* Bind to the standard DHCP client port. */ /* Bind to the standard DHCP client port. */
xAddress.sin_port = dhcpCLIENT_PORT; xAddress.sin_port = dhcpCLIENT_PORT;
@ -462,7 +462,7 @@ extern void vIPFunctionsTimerCallback( xTimerHandle xTimer );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvProcessDHCPReplies( uint8_t ucExpectedMessageType, xMACAddress_t *pxMACAddress, xNetworkAddressingParameters_t *pxNetworkAddressing ) static BaseType_t prvProcessDHCPReplies( uint8_t ucExpectedMessageType, xMACAddress_t *pxMACAddress, xNetworkAddressingParameters_t *pxNetworkAddressing )
{ {
uint8_t *pucUDPPayload, *pucLastByte; uint8_t *pucUDPPayload, *pucLastByte;
struct freertos_sockaddr xClient; struct freertos_sockaddr xClient;
@ -471,7 +471,7 @@ int32_t lBytes;
xDHCPMessage_t *pxDHCPMessage; xDHCPMessage_t *pxDHCPMessage;
uint8_t *pucByte, ucOptionCode, ucLength; uint8_t *pucByte, ucOptionCode, ucLength;
uint32_t ulProcessed; uint32_t ulProcessed;
portBASE_TYPE xReturn = pdFALSE; BaseType_t xReturn = pdFALSE;
const uint32_t ulMandatoryOptions = 2; /* DHCP server address, and the correct DHCP message type must be present in the options. */ const uint32_t ulMandatoryOptions = 2; /* DHCP server address, and the correct DHCP message type must be present in the options. */
lBytes = FreeRTOS_recvfrom( xDHCPSocket, ( void * ) &pucUDPPayload, 0, FREERTOS_ZERO_COPY, &xClient, &xClientLength ); lBytes = FreeRTOS_recvfrom( xDHCPSocket, ( void * ) &pucUDPPayload, 0, FREERTOS_ZERO_COPY, &xClient, &xClientLength );

@ -136,7 +136,7 @@ static xSocket_t xDNSSocket = NULL;
uint32_t ulIPAddress = 0UL; uint32_t ulIPAddress = 0UL;
uint8_t *pucUDPPayloadBuffer; uint8_t *pucUDPPayloadBuffer;
static uint32_t ulAddressLength; static uint32_t ulAddressLength;
portBASE_TYPE xAttempt; BaseType_t xAttempt;
int32_t lBytes; int32_t lBytes;
size_t xPayloadLength; size_t xPayloadLength;
const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( pcHostName ) + sizeof( uint16_t ) + sizeof( uint16_t ) + 2; /* Two for the count of characters in the first subdomain part, and the string end byte */ const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( pcHostName ) + sizeof( uint16_t ) + sizeof( uint16_t ) + 2; /* Two for the count of characters in the first subdomain part, and the string end byte */
@ -384,8 +384,8 @@ static xSocket_t prvCreateDNSSocket( void )
{ {
static xSocket_t xSocket = NULL; static xSocket_t xSocket = NULL;
struct freertos_sockaddr xAddress; struct freertos_sockaddr xAddress;
portBASE_TYPE xReturn; BaseType_t xReturn;
portTickType xTimeoutTime = 200 / portTICK_RATE_MS; TickType_t xTimeoutTime = 200 / portTICK_RATE_MS;
/* This must be the first time this function has been called. Create /* This must be the first time this function has been called. Create
the socket. */ the socket. */
@ -404,8 +404,8 @@ portTickType xTimeoutTime = 200 / portTICK_RATE_MS;
else else
{ {
/* Set the send and receive timeouts. */ /* Set the send and receive timeouts. */
FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_RCVTIMEO, ( void * ) &xTimeoutTime, sizeof( portTickType ) ); FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_RCVTIMEO, ( void * ) &xTimeoutTime, sizeof( TickType_t ) );
FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_SNDTIMEO, ( void * ) &xTimeoutTime, sizeof( portTickType ) ); FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_SNDTIMEO, ( void * ) &xTimeoutTime, sizeof( TickType_t ) );
} }
return xSocket; return xSocket;

@ -70,7 +70,7 @@ port number. */
/* xWaitingPacketSemaphore is not created until the socket is bound, so can be /* xWaitingPacketSemaphore is not created until the socket is bound, so can be
tested to see if bind() has been called. */ tested to see if bind() has been called. */
#define socketSOCKET_IS_BOUND( pxSocket ) ( ( portBASE_TYPE ) pxSocket->xWaitingPacketSemaphore ) #define socketSOCKET_IS_BOUND( pxSocket ) ( ( BaseType_t ) pxSocket->xWaitingPacketSemaphore )
/* If FreeRTOS_sendto() is called on a socket that is not bound to a port /* If FreeRTOS_sendto() is called on a socket that is not bound to a port
number then, depending on the FreeRTOSIPConfig.h settings, it might be that a number then, depending on the FreeRTOSIPConfig.h settings, it might be that a
@ -98,7 +98,7 @@ static uint16_t prvGetPrivatePortNumber( void );
* Return the list itme from within pxList that has an item value of * Return the list itme from within pxList that has an item value of
* xWantedItemValue. If there is no such list item return NULL. * xWantedItemValue. If there is no such list item return NULL.
*/ */
xListItem * pxListFindListItemWithValue( xList *pxList, portTickType xWantedItemValue ); xListItem * pxListFindListItemWithValue( xList *pxList, TickType_t xWantedItemValue );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -107,8 +107,8 @@ typedef struct XSOCKET
xSemaphoreHandle xWaitingPacketSemaphore; xSemaphoreHandle xWaitingPacketSemaphore;
xList xWaitingPacketsList; xList xWaitingPacketsList;
xListItem xBoundSocketListItem; /* Used to reference the socket from a bound sockets list. */ xListItem xBoundSocketListItem; /* Used to reference the socket from a bound sockets list. */
portTickType xReceiveBlockTime; TickType_t xReceiveBlockTime;
portTickType xSendBlockTime; TickType_t xSendBlockTime;
uint8_t ucSocketOptions; uint8_t ucSocketOptions;
#if ipconfigSUPPORT_SELECT_FUNCTION == 1 #if ipconfigSUPPORT_SELECT_FUNCTION == 1
xQueueHandle xSelectQueue; xQueueHandle xSelectQueue;
@ -122,7 +122,7 @@ static xList xBoundSocketsList;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
xSocket_t FreeRTOS_socket( portBASE_TYPE xDomain, portBASE_TYPE xType, portBASE_TYPE xProtocol ) xSocket_t FreeRTOS_socket( BaseType_t xDomain, BaseType_t xType, BaseType_t xProtocol )
{ {
xFreeRTOS_Socket_t *pxSocket; xFreeRTOS_Socket_t *pxSocket;
@ -149,7 +149,7 @@ xFreeRTOS_Socket_t *pxSocket;
vListInitialise( &( pxSocket->xWaitingPacketsList ) ); vListInitialise( &( pxSocket->xWaitingPacketsList ) );
vListInitialiseItem( &( pxSocket->xBoundSocketListItem ) ); vListInitialiseItem( &( pxSocket->xBoundSocketListItem ) );
listSET_LIST_ITEM_OWNER( &( pxSocket->xBoundSocketListItem ), ( void * ) pxSocket ); listSET_LIST_ITEM_OWNER( &( pxSocket->xBoundSocketListItem ), ( void * ) pxSocket );
pxSocket->xSendBlockTime = ( portTickType ) 0; pxSocket->xSendBlockTime = ( TickType_t ) 0;
pxSocket->xReceiveBlockTime = portMAX_DELAY; pxSocket->xReceiveBlockTime = portMAX_DELAY;
pxSocket->ucSocketOptions = FREERTOS_SO_UDPCKSUM_OUT; pxSocket->ucSocketOptions = FREERTOS_SO_UDPCKSUM_OUT;
#if ipconfigSUPPORT_SELECT_FUNCTION == 1 #if ipconfigSUPPORT_SELECT_FUNCTION == 1
@ -168,7 +168,7 @@ xFreeRTOS_Socket_t *pxSocket;
#if ipconfigSUPPORT_SELECT_FUNCTION == 1 #if ipconfigSUPPORT_SELECT_FUNCTION == 1
xSocketSet_t FreeRTOS_CreateSocketSet( unsigned portBASE_TYPE uxEventQueueLength ) xSocketSet_t FreeRTOS_CreateSocketSet( UBaseType_t uxEventQueueLength )
{ {
xQueueHandle xSelectQueue; xQueueHandle xSelectQueue;
@ -184,11 +184,11 @@ xFreeRTOS_Socket_t *pxSocket;
#if ipconfigSUPPORT_SELECT_FUNCTION == 1 #if ipconfigSUPPORT_SELECT_FUNCTION == 1
portBASE_TYPE FreeRTOS_FD_SET( xSocket_t xSocket, xSocketSet_t xSocketSet ) BaseType_t FreeRTOS_FD_SET( xSocket_t xSocket, xSocketSet_t xSocketSet )
{ {
xFreeRTOS_Socket_t *pxSocket = ( xFreeRTOS_Socket_t * ) xSocket; xFreeRTOS_Socket_t *pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;
portBASE_TYPE xReturn = pdFALSE; BaseType_t xReturn = pdFALSE;
unsigned portBASE_TYPE uxMessagesWaiting; UBaseType_t uxMessagesWaiting;
configASSERT( xSocket ); configASSERT( xSocket );
@ -230,10 +230,10 @@ xFreeRTOS_Socket_t *pxSocket;
#if ipconfigSUPPORT_SELECT_FUNCTION == 1 #if ipconfigSUPPORT_SELECT_FUNCTION == 1
portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet ) BaseType_t FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet )
{ {
xFreeRTOS_Socket_t *pxSocket = ( xFreeRTOS_Socket_t * ) xSocket; xFreeRTOS_Socket_t *pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;
portBASE_TYPE xReturn; BaseType_t xReturn;
/* Is the socket a member of the select group? */ /* Is the socket a member of the select group? */
if( pxSocket->xSelectQueue == ( xQueueHandle ) xSocketSet ) if( pxSocket->xSelectQueue == ( xQueueHandle ) xSocketSet )
@ -255,7 +255,7 @@ xFreeRTOS_Socket_t *pxSocket;
#if ipconfigSUPPORT_SELECT_FUNCTION == 1 #if ipconfigSUPPORT_SELECT_FUNCTION == 1
xSocket_t FreeRTOS_select( xSocketSet_t xSocketSet, portTickType xBlockTimeTicks ) xSocket_t FreeRTOS_select( xSocketSet_t xSocketSet, TickType_t xBlockTimeTicks )
{ {
xFreeRTOS_Socket_t *pxSocket; xFreeRTOS_Socket_t *pxSocket;
@ -361,7 +361,7 @@ xFreeRTOS_Socket_t *pxSocket;
extern xQueueHandle xNetworkEventQueue; extern xQueueHandle xNetworkEventQueue;
uint8_t *pucBuffer; uint8_t *pucBuffer;
xTimeOutType xTimeOut; xTimeOutType xTimeOut;
portTickType xTicksToWait; TickType_t xTicksToWait;
uint16_t usFragmentOffset; uint16_t usFragmentOffset;
xFreeRTOS_Socket_t *pxSocket; xFreeRTOS_Socket_t *pxSocket;
@ -537,7 +537,7 @@ xFreeRTOS_Socket_t *pxSocket;
xIPStackEvent_t xStackTxEvent = { eStackTxEvent, NULL }; xIPStackEvent_t xStackTxEvent = { eStackTxEvent, NULL };
extern xQueueHandle xNetworkEventQueue; extern xQueueHandle xNetworkEventQueue;
xTimeOutType xTimeOut; xTimeOutType xTimeOut;
portTickType xTicksToWait; TickType_t xTicksToWait;
int32_t lReturn = 0; int32_t lReturn = 0;
xFreeRTOS_Socket_t *pxSocket; xFreeRTOS_Socket_t *pxSocket;
uint8_t *pucBuffer; uint8_t *pucBuffer;
@ -649,9 +649,9 @@ xFreeRTOS_Socket_t *pxSocket;
#endif /* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS */ #endif /* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr * pxAddress, socklen_t xAddressLength ) BaseType_t FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr * pxAddress, socklen_t xAddressLength )
{ {
portBASE_TYPE xReturn = 0; /* In Berkeley sockets, 0 means pass for bind(). */ BaseType_t xReturn = 0; /* In Berkeley sockets, 0 means pass for bind(). */
xFreeRTOS_Socket_t *pxSocket; xFreeRTOS_Socket_t *pxSocket;
#if ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND == 1 #if ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND == 1
struct freertos_sockaddr xAddress; struct freertos_sockaddr xAddress;
@ -695,7 +695,7 @@ xFreeRTOS_Socket_t *pxSocket;
vTaskSuspendAll(); vTaskSuspendAll();
{ {
/* Check to ensure the port is not already in use. */ /* Check to ensure the port is not already in use. */
if( pxListFindListItemWithValue( &xBoundSocketsList, ( portTickType ) pxAddress->sin_port ) != NULL ) if( pxListFindListItemWithValue( &xBoundSocketsList, ( TickType_t ) pxAddress->sin_port ) != NULL )
{ {
xReturn = FREERTOS_EADDRINUSE; xReturn = FREERTOS_EADDRINUSE;
} }
@ -749,7 +749,7 @@ xFreeRTOS_Socket_t *pxSocket;
} /* Tested */ } /* Tested */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE FreeRTOS_closesocket( xSocket_t xSocket ) BaseType_t FreeRTOS_closesocket( xSocket_t xSocket )
{ {
xNetworkBufferDescriptor_t *pxNetworkBuffer; xNetworkBufferDescriptor_t *pxNetworkBuffer;
xFreeRTOS_Socket_t *pxSocket; xFreeRTOS_Socket_t *pxSocket;
@ -795,11 +795,11 @@ void FreeRTOS_SocketsInit( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength ) BaseType_t FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength )
{ {
/* The standard Berkeley function returns 0 for success. */ /* The standard Berkeley function returns 0 for success. */
portBASE_TYPE xReturn = 0; BaseType_t xReturn = 0;
portBASE_TYPE lOptionValue; BaseType_t lOptionValue;
xFreeRTOS_Socket_t *pxSocket; xFreeRTOS_Socket_t *pxSocket;
pxSocket = ( xFreeRTOS_Socket_t * ) xSocket; pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;
@ -815,7 +815,7 @@ xFreeRTOS_Socket_t *pxSocket;
{ {
case FREERTOS_SO_RCVTIMEO : case FREERTOS_SO_RCVTIMEO :
/* Receive time out. */ /* Receive time out. */
pxSocket->xReceiveBlockTime = *( ( portTickType * ) pvOptionValue ); pxSocket->xReceiveBlockTime = *( ( TickType_t * ) pvOptionValue );
break; break;
case FREERTOS_SO_SNDTIMEO : case FREERTOS_SO_SNDTIMEO :
@ -823,7 +823,7 @@ xFreeRTOS_Socket_t *pxSocket;
where ipconfigMAX_SEND_BLOCK_TIME_TICKS is defined in where ipconfigMAX_SEND_BLOCK_TIME_TICKS is defined in
FreeRTOSIPConfig.h (assuming an official configuration file is being FreeRTOSIPConfig.h (assuming an official configuration file is being
used. */ used. */
pxSocket->xSendBlockTime = *( ( portTickType * ) pvOptionValue ); pxSocket->xSendBlockTime = *( ( TickType_t * ) pvOptionValue );
if( pxSocket->xSendBlockTime > ipconfigMAX_SEND_BLOCK_TIME_TICKS ) if( pxSocket->xSendBlockTime > ipconfigMAX_SEND_BLOCK_TIME_TICKS )
{ {
pxSocket->xSendBlockTime = ipconfigMAX_SEND_BLOCK_TIME_TICKS; pxSocket->xSendBlockTime = ipconfigMAX_SEND_BLOCK_TIME_TICKS;
@ -832,7 +832,7 @@ xFreeRTOS_Socket_t *pxSocket;
case FREERTOS_SO_UDPCKSUM_OUT : case FREERTOS_SO_UDPCKSUM_OUT :
/* Turn calculating of the UDP checksum on/off for this socket. */ /* Turn calculating of the UDP checksum on/off for this socket. */
lOptionValue = ( portBASE_TYPE ) pvOptionValue; lOptionValue = ( BaseType_t ) pvOptionValue;
if( lOptionValue == 0 ) if( lOptionValue == 0 )
{ {
@ -854,18 +854,18 @@ xFreeRTOS_Socket_t *pxSocket;
} /* Tested */ } /* Tested */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE xProcessReceivedUDPPacket( xNetworkBufferDescriptor_t *pxNetworkBuffer, uint16_t usPort ) BaseType_t xProcessReceivedUDPPacket( xNetworkBufferDescriptor_t *pxNetworkBuffer, uint16_t usPort )
{ {
xListItem *pxListItem; xListItem *pxListItem;
portBASE_TYPE xReturn = pdPASS; BaseType_t xReturn = pdPASS;
xFreeRTOS_Socket_t *pxSocket; xFreeRTOS_Socket_t *pxSocket;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; BaseType_t xHigherPriorityTaskWoken = pdFALSE;
vTaskSuspendAll(); vTaskSuspendAll();
{ {
/* See if there is a list item associated with the port number on the /* See if there is a list item associated with the port number on the
list of bound sockets. */ list of bound sockets. */
pxListItem = pxListFindListItemWithValue( &xBoundSocketsList, ( portTickType ) usPort ); pxListItem = pxListFindListItemWithValue( &xBoundSocketsList, ( TickType_t ) usPort );
} }
xTaskResumeAll(); xTaskResumeAll();
@ -952,7 +952,7 @@ uint16_t usReturn;
} /* Tested */ } /* Tested */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
xListItem * pxListFindListItemWithValue( xList *pxList, portTickType xWantedItemValue ) xListItem * pxListFindListItemWithValue( xList *pxList, TickType_t xWantedItemValue )
{ {
xListItem *pxIterator, *pxReturn; xListItem *pxIterator, *pxReturn;
@ -978,7 +978,7 @@ xListItem *pxIterator, *pxReturn;
uint8_t ucOctet[ socketMAX_IP_ADDRESS_OCTETS ]; uint8_t ucOctet[ socketMAX_IP_ADDRESS_OCTETS ];
const char *pcPointerOnEntering; const char *pcPointerOnEntering;
uint32_t ulReturn = 0UL, ulOctetNumber, ulValue; uint32_t ulReturn = 0UL, ulOctetNumber, ulValue;
portBASE_TYPE xResult = pdPASS; BaseType_t xResult = pdPASS;
for( ulOctetNumber = 0; ulOctetNumber < socketMAX_IP_ADDRESS_OCTETS; ulOctetNumber++ ) for( ulOctetNumber = 0; ulOctetNumber < socketMAX_IP_ADDRESS_OCTETS; ulOctetNumber++ )
{ {

@ -95,7 +95,7 @@
#define ipIP_VERSION_AND_HEADER_LENGTH_BYTE ( ( uint8_t ) 0x45 ) #define ipIP_VERSION_AND_HEADER_LENGTH_BYTE ( ( uint8_t ) 0x45 )
/* Time delay between repeated attempts to initialise the network hardware. */ /* Time delay between repeated attempts to initialise the network hardware. */
#define ipINITIALISATION_RETRY_DELAY ( ( ( portTickType ) 3000 ) / portTICK_RATE_MS ) #define ipINITIALISATION_RETRY_DELAY ( ( ( TickType_t ) 3000 ) / portTICK_RATE_MS )
/* The local MAC address is accessed from within xDefaultPartUDPPacketHeader, /* The local MAC address is accessed from within xDefaultPartUDPPacketHeader,
rather than duplicated in its own variable. */ rather than duplicated in its own variable. */
@ -220,7 +220,7 @@ static void prvReturnEthernetFrame( xNetworkBufferDescriptor_t * const pxNetwork
/* /*
* Return the checksum generated over usDataLengthBytes from pucNextData. * Return the checksum generated over usDataLengthBytes from pucNextData.
*/ */
static uint16_t prvGenerateChecksum( const uint8_t * const pucNextData, const uint16_t usDataLengthBytes, portBASE_TYPE xChecksumIsOffloaded ); static uint16_t prvGenerateChecksum( const uint8_t * const pucNextData, const uint16_t usDataLengthBytes, BaseType_t xChecksumIsOffloaded );
/* /*
* The callback function that is assigned to all periodic processing timers - * The callback function that is assigned to all periodic processing timers -
@ -246,7 +246,7 @@ static void prvRefreshARPCacheEntry( const xMACAddress_t * const pxMACAddress, c
* Creates the pseudo header necessary then generate the checksum over the UDP * Creates the pseudo header necessary then generate the checksum over the UDP
* packet. Returns the calculated checksum. * packet. Returns the calculated checksum.
*/ */
static uint16_t prvGenerateUDPChecksum( const xUDPPacket_t * const pxUDPPacket, portBASE_TYPE xChecksumIsOffloaded ); static uint16_t prvGenerateUDPChecksum( const xUDPPacket_t * const pxUDPPacket, BaseType_t xChecksumIsOffloaded );
/* /*
* Look for ulIPAddress in the ARP cache. If the IP address exists, copy the * Look for ulIPAddress in the ARP cache. If the IP address exists, copy the
@ -293,7 +293,7 @@ static void prvCompleteUDPHeader( xNetworkBufferDescriptor_t *pxNetworkBuffer, x
* zero. Return pdPASS if the message was sent successfully, otherwise return * zero. Return pdPASS if the message was sent successfully, otherwise return
* pdFALSE. * pdFALSE.
*/ */
static portBASE_TYPE prvSendEventToIPTask( eIPEvent_t eEvent ); static BaseType_t prvSendEventToIPTask( eIPEvent_t eEvent );
/* /*
* Generate and send an ARP request for the IP address passed in ulIPAddress. * Generate and send an ARP request for the IP address passed in ulIPAddress.
@ -335,7 +335,7 @@ static xTimerHandle xARPTimer = NULL;
/* Used to ensure network down events cannot be missed when they cannot be /* Used to ensure network down events cannot be missed when they cannot be
posted to the network event queue because the network event queue is already posted to the network event queue because the network event queue is already
full. */ full. */
static portBASE_TYPE xNetworkDownEventPending = pdFALSE; static BaseType_t xNetworkDownEventPending = pdFALSE;
/* For convenience, a MAC address of all zeros and another of all 0xffs are /* For convenience, a MAC address of all zeros and another of all 0xffs are
defined const for quick reference. */ defined const for quick reference. */
@ -463,7 +463,7 @@ xIPStackEvent_t xReceivedEvent;
void FreeRTOS_NetworkDown( void ) void FreeRTOS_NetworkDown( void )
{ {
static const xIPStackEvent_t xNetworkDownEvent = { eNetworkDownEvent, NULL }; static const xIPStackEvent_t xNetworkDownEvent = { eNetworkDownEvent, NULL };
const portTickType xDontBlock = 0; const TickType_t xDontBlock = 0;
/* Simply send the network task the appropriate event. */ /* Simply send the network task the appropriate event. */
if( xQueueSendToBack( xNetworkEventQueue, &xNetworkDownEvent, xDontBlock ) != pdPASS ) if( xQueueSendToBack( xNetworkEventQueue, &xNetworkDownEvent, xDontBlock ) != pdPASS )
@ -479,10 +479,10 @@ const portTickType xDontBlock = 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE FreeRTOS_NetworkDownFromISR( void ) BaseType_t FreeRTOS_NetworkDownFromISR( void )
{ {
static const xIPStackEvent_t xNetworkDownEvent = { eNetworkDownEvent, NULL }; static const xIPStackEvent_t xNetworkDownEvent = { eNetworkDownEvent, NULL };
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; BaseType_t xHigherPriorityTaskWoken = pdFALSE;
/* Simply send the network task the appropriate event. */ /* Simply send the network task the appropriate event. */
if( xQueueSendToBackFromISR( xNetworkEventQueue, &xNetworkDownEvent, &xHigherPriorityTaskWoken ) != pdPASS ) if( xQueueSendToBackFromISR( xNetworkEventQueue, &xNetworkDownEvent, &xHigherPriorityTaskWoken ) != pdPASS )
@ -499,7 +499,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void *FreeRTOS_GetUDPPayloadBuffer( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks ) void *FreeRTOS_GetUDPPayloadBuffer( size_t xRequestedSizeBytes, TickType_t xBlockTimeTicks )
{ {
xNetworkBufferDescriptor_t *pxNetworkBuffer; xNetworkBufferDescriptor_t *pxNetworkBuffer;
void *pvReturn; void *pvReturn;
@ -547,9 +547,9 @@ uint8_t * FreeRTOS_GetMACAddress( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE FreeRTOS_IPInit( const uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucNetMask[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucGatewayAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucDNSServerAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ] ) BaseType_t FreeRTOS_IPInit( const uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucNetMask[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucGatewayAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucDNSServerAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ] )
{ {
static portBASE_TYPE xReturn = pdFALSE; static BaseType_t xReturn = pdFALSE;
/* Only create the IP event queue if it has not already been created, in /* Only create the IP event queue if it has not already been created, in
case this function is called more than once. */ case this function is called more than once. */
@ -632,11 +632,11 @@ void FreeRTOS_GetAddressConfiguration( uint32_t *pulIPAddress, uint32_t *pulNetM
#if ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) #if ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )
portBASE_TYPE FreeRTOS_SendPingRequest( uint32_t ulIPAddress, size_t xNumberOfBytesToSend, portTickType xBlockTimeTicks ) BaseType_t FreeRTOS_SendPingRequest( uint32_t ulIPAddress, size_t xNumberOfBytesToSend, TickType_t xBlockTimeTicks )
{ {
xNetworkBufferDescriptor_t *pxNetworkBuffer; xNetworkBufferDescriptor_t *pxNetworkBuffer;
xICMPHeader_t *pxICMPHeader; xICMPHeader_t *pxICMPHeader;
portBASE_TYPE xReturn = pdFAIL; BaseType_t xReturn = pdFAIL;
static uint16_t usSequenceNumber = 0; static uint16_t usSequenceNumber = 0;
uint8_t *pucChar; uint8_t *pucChar;
xIPStackEvent_t xStackTxEvent = { eStackTxEvent, NULL }; xIPStackEvent_t xStackTxEvent = { eStackTxEvent, NULL };
@ -699,11 +699,11 @@ void FreeRTOS_GetAddressConfiguration( uint32_t *pulIPAddress, uint32_t *pulNetM
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static portBASE_TYPE prvSendEventToIPTask( eIPEvent_t eEvent ) static BaseType_t prvSendEventToIPTask( eIPEvent_t eEvent )
{ {
xIPStackEvent_t xEventMessage; xIPStackEvent_t xEventMessage;
const portTickType xDontBlock = 0; const TickType_t xDontBlock = 0;
portBASE_TYPE xReturn; BaseType_t xReturn;
xEventMessage.eEventType = eEvent; xEventMessage.eEventType = eEvent;
xReturn = xQueueSendToBack( xNetworkEventQueue, &xEventMessage, xDontBlock ); xReturn = xQueueSendToBack( xNetworkEventQueue, &xEventMessage, xDontBlock );
@ -724,7 +724,7 @@ eIPEvent_t eMessage;
/* This time can be used to send more than one type of message to the IP /* This time can be used to send more than one type of message to the IP
task. The message ID is stored in the ID of the timer. The strange task. The message ID is stored in the ID of the timer. The strange
casting is to avoid compiler warnings. */ casting is to avoid compiler warnings. */
eMessage = ( eIPEvent_t ) ( ( portBASE_TYPE ) pvTimerGetTimerID( xTimer ) ); eMessage = ( eIPEvent_t ) ( ( BaseType_t ) pvTimerGetTimerID( xTimer ) );
prvSendEventToIPTask( eMessage ); prvSendEventToIPTask( eMessage );
} }
@ -748,7 +748,7 @@ xNetworkBufferDescriptor_t *pxNetworkBuffer;
static void prvAgeARPCache( void ) static void prvAgeARPCache( void )
{ {
portBASE_TYPE x; BaseType_t x;
/* Loop through each entry in the ARP cache. */ /* Loop through each entry in the ARP cache. */
for( x = 0; x < ipconfigARP_CACHE_ENTRIES; x++ ) for( x = 0; x < ipconfigARP_CACHE_ENTRIES; x++ )
@ -791,7 +791,7 @@ portBASE_TYPE x;
static eARPLookupResult_t prvGetARPCacheEntry( uint32_t *pulIPAddress, xMACAddress_t * const pxMACAddress ) static eARPLookupResult_t prvGetARPCacheEntry( uint32_t *pulIPAddress, xMACAddress_t * const pxMACAddress )
{ {
portBASE_TYPE x; BaseType_t x;
eARPLookupResult_t eReturn; eARPLookupResult_t eReturn;
uint32_t ulAddressToLookup; uint32_t ulAddressToLookup;
@ -873,7 +873,7 @@ uint32_t ulAddressToLookup;
static void prvRefreshARPCacheEntry( const xMACAddress_t * const pxMACAddress, const uint32_t ulIPAddress ) static void prvRefreshARPCacheEntry( const xMACAddress_t * const pxMACAddress, const uint32_t ulIPAddress )
{ {
portBASE_TYPE x, xEntryFound = pdFALSE, xOldestEntry = 0; BaseType_t x, xEntryFound = pdFALSE, xOldestEntry = 0;
uint8_t ucMinAgeFound = 0U; uint8_t ucMinAgeFound = 0U;
/* Only process the IP address if it is on the local network. */ /* Only process the IP address if it is on the local network. */
@ -1355,7 +1355,7 @@ static void prvProcessNetworkDownEvent( void )
#if ipconfigUSE_NETWORK_EVENT_HOOK == 1 #if ipconfigUSE_NETWORK_EVENT_HOOK == 1
{ {
static portBASE_TYPE xCallEventHook = pdFALSE; static BaseType_t xCallEventHook = pdFALSE;
/* The first network down event is generated by the IP stack /* The first network down event is generated by the IP stack
itself to initialise the network hardware, so do not call the itself to initialise the network hardware, so do not call the
@ -1480,7 +1480,7 @@ static eFrameProcessingResult_t prvProcessIPPacket( const xIPPacket_t * const px
eFrameProcessingResult_t eReturn = eReleaseBuffer; eFrameProcessingResult_t eReturn = eReleaseBuffer;
const xIPHeader_t * pxIPHeader; const xIPHeader_t * pxIPHeader;
xUDPPacket_t *pxUDPPacket; xUDPPacket_t *pxUDPPacket;
portBASE_TYPE xChecksumIsCorrect; BaseType_t xChecksumIsCorrect;
pxIPHeader = &( pxIPPacket->xIPHeader ); pxIPHeader = &( pxIPPacket->xIPHeader );
@ -1569,7 +1569,7 @@ portBASE_TYPE xChecksumIsCorrect;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static uint16_t prvGenerateUDPChecksum( const xUDPPacket_t * const pxUDPPacket, portBASE_TYPE xChecksumIsOffloaded ) static uint16_t prvGenerateUDPChecksum( const xUDPPacket_t * const pxUDPPacket, BaseType_t xChecksumIsOffloaded )
{ {
xPseudoHeader_t *pxPseudoHeader; xPseudoHeader_t *pxPseudoHeader;
uint16_t usLength, usReturn; uint16_t usLength, usReturn;
@ -1727,7 +1727,7 @@ uint16_t usLength, usReturn;
#endif /* ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) */ #endif /* ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static uint16_t prvGenerateChecksum( const uint8_t * const pucNextData, const uint16_t usDataLengthBytes, portBASE_TYPE xChecksumIsOffloaded ) static uint16_t prvGenerateChecksum( const uint8_t * const pucNextData, const uint16_t usDataLengthBytes, BaseType_t xChecksumIsOffloaded )
{ {
uint32_t ulChecksum = 0; uint32_t ulChecksum = 0;
uint16_t us, usDataLength16BitWords, *pusNextData, usReturn; uint16_t us, usDataLength16BitWords, *pusNextData, usReturn;

@ -50,7 +50,7 @@
/* /*
* NOT A PUBLIC API FUNCTION. * NOT A PUBLIC API FUNCTION.
*/ */
void vDHCPProcess( portBASE_TYPE xReset, xMACAddress_t *pxMACAddress, uint32_t *pulIPAddress, xNetworkAddressingParameters_t *pxNetworkAddressing ); void vDHCPProcess( BaseType_t xReset, xMACAddress_t *pxMACAddress, uint32_t *pulIPAddress, xNetworkAddressingParameters_t *pxNetworkAddressing );
#endif /* FREERTOS_DHCP_H */ #endif /* FREERTOS_DHCP_H */

@ -294,7 +294,7 @@ void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
* interrupt. If a non zero value is returned, then the calling ISR should * interrupt. If a non zero value is returned, then the calling ISR should
* perform a context switch before exiting the ISR. * perform a context switch before exiting the ISR.
*/ */
portBASE_TYPE FreeRTOS_ReleaseFreeNetworkBufferFromISR( void ); BaseType_t FreeRTOS_ReleaseFreeNetworkBufferFromISR( void );
/* /*
* Create a message that contains a command to initialise the network interface. * Create a message that contains a command to initialise the network interface.
@ -309,7 +309,7 @@ portBASE_TYPE FreeRTOS_ReleaseFreeNetworkBufferFromISR( void );
* the interrupt is exited. * the interrupt is exited.
*/ */
void FreeRTOS_NetworkDown( void ); void FreeRTOS_NetworkDown( void );
portBASE_TYPE FreeRTOS_NetworkDownFromISR( void ); BaseType_t FreeRTOS_NetworkDownFromISR( void );
/* /*
* Inspect an Ethernet frame to see if it contains data that the stack needs to * Inspect an Ethernet frame to see if it contains data that the stack needs to
@ -319,11 +319,11 @@ portBASE_TYPE FreeRTOS_NetworkDownFromISR( void );
eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucEthernetBuffer ); eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucEthernetBuffer );
#if( ipconfigINCLUDE_TEST_CODE == 1 ) #if( ipconfigINCLUDE_TEST_CODE == 1 )
unsigned portBASE_TYPE uxGetNumberOfFreeNetworkBuffers( void ); UBaseType_t uxGetNumberOfFreeNetworkBuffers( void );
#endif /* ipconfigINCLUDE_TEST_CODE */ #endif /* ipconfigINCLUDE_TEST_CODE */
/* Socket related private functions. */ /* Socket related private functions. */
portBASE_TYPE xProcessReceivedUDPPacket( xNetworkBufferDescriptor_t *pxNetworkBuffer, uint16_t usPort ); BaseType_t xProcessReceivedUDPPacket( xNetworkBufferDescriptor_t *pxNetworkBuffer, uint16_t usPort );
void FreeRTOS_SocketsInit( void ); void FreeRTOS_SocketsInit( void );
/* If FreeRTOS+NABTO is included then include the prototype of the function that /* If FreeRTOS+NABTO is included then include the prototype of the function that

@ -148,20 +148,20 @@ typedef void *xSocketSet_t;
* FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL: * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml
*/ */
xSocket_t FreeRTOS_socket( portBASE_TYPE xDomain, portBASE_TYPE xType, portBASE_TYPE xProtocol ); xSocket_t FreeRTOS_socket( BaseType_t xDomain, BaseType_t xType, BaseType_t xProtocol );
int32_t FreeRTOS_recvfrom( xSocket_t xSocket, void *pvBuffer, size_t xBufferLength, uint32_t ulFlags, struct freertos_sockaddr *pxSourceAddress, socklen_t *pxSourceAddressLength ); int32_t FreeRTOS_recvfrom( xSocket_t xSocket, void *pvBuffer, size_t xBufferLength, uint32_t ulFlags, struct freertos_sockaddr *pxSourceAddress, socklen_t *pxSourceAddressLength );
int32_t FreeRTOS_sendto( xSocket_t xSocket, const void *pvBuffer, size_t xTotalDataLength, uint32_t ulFlags, const struct freertos_sockaddr *pxDestinationAddress, socklen_t xDestinationAddressLength ); int32_t FreeRTOS_sendto( xSocket_t xSocket, const void *pvBuffer, size_t xTotalDataLength, uint32_t ulFlags, const struct freertos_sockaddr *pxDestinationAddress, socklen_t xDestinationAddressLength );
portBASE_TYPE FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength ); BaseType_t FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );
portBASE_TYPE FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength ); BaseType_t FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength );
portBASE_TYPE FreeRTOS_closesocket( xSocket_t xSocket ); BaseType_t FreeRTOS_closesocket( xSocket_t xSocket );
uint32_t FreeRTOS_gethostbyname( const char *pcHostName ); uint32_t FreeRTOS_gethostbyname( const char *pcHostName );
uint32_t FreeRTOS_inet_addr( const char *pcIPAddress ); uint32_t FreeRTOS_inet_addr( const char *pcIPAddress );
#if ipconfigSUPPORT_SELECT_FUNCTION == 1 #if ipconfigSUPPORT_SELECT_FUNCTION == 1
xSocketSet_t FreeRTOS_CreateSocketSet( unsigned portBASE_TYPE uxEventQueueLength ); xSocketSet_t FreeRTOS_CreateSocketSet( UBaseType_t uxEventQueueLength );
portBASE_TYPE FreeRTOS_FD_SET( xSocket_t xSocket, xSocketSet_t xSocketSet ); BaseType_t FreeRTOS_FD_SET( xSocket_t xSocket, xSocketSet_t xSocketSet );
portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet ); BaseType_t FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet );
xSocket_t FreeRTOS_select( xSocketSet_t xSocketSet, portTickType xBlockTimeTicks ); xSocket_t FreeRTOS_select( xSocketSet_t xSocketSet, TickType_t xBlockTimeTicks );
#endif /* ipconfigSUPPORT_SELECT_FUNCTION */ #endif /* ipconfigSUPPORT_SELECT_FUNCTION */
#endif /* FREERTOS_UDP_H */ #endif /* FREERTOS_UDP_H */

@ -98,17 +98,17 @@ typedef enum ePING_REPLY_STATUS
* FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL: * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml
*/ */
portBASE_TYPE FreeRTOS_IPInit( const uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucNetMask[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucGatewayAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucDNSServerAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ] ); BaseType_t FreeRTOS_IPInit( const uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucNetMask[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucGatewayAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucDNSServerAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ] );
void * FreeRTOS_GetUDPPayloadBuffer( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks ); void * FreeRTOS_GetUDPPayloadBuffer( size_t xRequestedSizeBytes, TickType_t xBlockTimeTicks );
void FreeRTOS_GetAddressConfiguration( uint32_t *pulIPAddress, uint32_t *pulNetMask, uint32_t *pulGatewayAddress, uint32_t *pulDNSServerAddress ); void FreeRTOS_GetAddressConfiguration( uint32_t *pulIPAddress, uint32_t *pulNetMask, uint32_t *pulGatewayAddress, uint32_t *pulDNSServerAddress );
portBASE_TYPE FreeRTOS_SendPingRequest( uint32_t ulIPAddress, size_t xNumberOfBytesToSend, portTickType xBlockTimeTicks ); BaseType_t FreeRTOS_SendPingRequest( uint32_t ulIPAddress, size_t xNumberOfBytesToSend, TickType_t xBlockTimeTicks );
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent ); void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent );
void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier ); void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier );
void FreeRTOS_ReleaseUDPPayloadBuffer( void *pvBuffer ); void FreeRTOS_ReleaseUDPPayloadBuffer( void *pvBuffer );
uint8_t * FreeRTOS_GetMACAddress( void ); uint8_t * FreeRTOS_GetMACAddress( void );
#if ( ipconfigFREERTOS_PLUS_NABTO == 1 ) #if ( ipconfigFREERTOS_PLUS_NABTO == 1 )
portBASE_TYPE xStartNabtoTask( void ); BaseType_t xStartNabtoTask( void );
#endif #endif
#endif /* FREERTOS_IP_H */ #endif /* FREERTOS_IP_H */

@ -44,11 +44,11 @@
#define NETWORK_BUFFER_MANAGEMENT_H #define NETWORK_BUFFER_MANAGEMENT_H
/* NOTE PUBLIC API FUNCTIONS. */ /* NOTE PUBLIC API FUNCTIONS. */
portBASE_TYPE xNetworkBuffersInitialise( void ); BaseType_t xNetworkBuffersInitialise( void );
xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks ); xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, TickType_t xBlockTimeTicks );
xNetworkBufferDescriptor_t *pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes ); xNetworkBufferDescriptor_t *pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes );
void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer ); void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer );
portBASE_TYPE vNetworkBufferReleaseFromISR( xNetworkBufferDescriptor_t * const pxNetworkBuffer ); BaseType_t vNetworkBufferReleaseFromISR( xNetworkBufferDescriptor_t * const pxNetworkBuffer );
uint8_t *pucEthernetBufferGet( size_t *pxRequestedSizeBytes ); uint8_t *pucEthernetBufferGet( size_t *pxRequestedSizeBytes );
void vEthernetBufferRelease( uint8_t *pucEthernetBuffer ); void vEthernetBufferRelease( uint8_t *pucEthernetBuffer );

@ -44,8 +44,8 @@
#define NETWORK_INTERFACE_H #define NETWORK_INTERFACE_H
/* NOTE PUBLIC API FUNCTIONS. */ /* NOTE PUBLIC API FUNCTIONS. */
portBASE_TYPE xNetworkInterfaceInitialise( void ); BaseType_t xNetworkInterfaceInitialise( void );
portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer ); BaseType_t xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer );
void vNetworkInterfaceAllocateRAMToBuffers( xNetworkBufferDescriptor_t pxNetworkBuffers[ ipconfigNUM_NETWORK_BUFFERS ] ); void vNetworkInterfaceAllocateRAMToBuffers( xNetworkBufferDescriptor_t pxNetworkBuffers[ ipconfigNUM_NETWORK_BUFFERS ] );
#endif /* NETWORK_INTERFACE_H */ #endif /* NETWORK_INTERFACE_H */

@ -82,9 +82,9 @@ static xSemaphoreHandle xNetworkBufferSemaphore = NULL;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE xNetworkBuffersInitialise( void ) BaseType_t xNetworkBuffersInitialise( void )
{ {
portBASE_TYPE xReturn, x; BaseType_t xReturn, x;
/* Only initialise the buffers and their associated kernel objects if they /* Only initialise the buffers and their associated kernel objects if they
have not been initialised before. */ have not been initialised before. */
@ -126,7 +126,7 @@ portBASE_TYPE xReturn, x;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks ) xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, TickType_t xBlockTimeTicks )
{ {
xNetworkBufferDescriptor_t *pxReturn = NULL; xNetworkBufferDescriptor_t *pxReturn = NULL;
@ -158,7 +158,7 @@ xNetworkBufferDescriptor_t *pxReturn = NULL;
xNetworkBufferDescriptor_t *pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes ) xNetworkBufferDescriptor_t *pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes )
{ {
xNetworkBufferDescriptor_t *pxReturn = NULL; xNetworkBufferDescriptor_t *pxReturn = NULL;
unsigned portBASE_TYPE uxSavedInterruptStatus; UBaseType_t uxSavedInterruptStatus;
/*_RB_ The current implementation only has a single size memory block, so /*_RB_ The current implementation only has a single size memory block, so
the requested size parameter is not used (yet). */ the requested size parameter is not used (yet). */
@ -194,10 +194,10 @@ unsigned portBASE_TYPE uxSavedInterruptStatus;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE vNetworkBufferReleaseFromISR( xNetworkBufferDescriptor_t * const pxNetworkBuffer ) BaseType_t vNetworkBufferReleaseFromISR( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{ {
unsigned portBASE_TYPE uxSavedInterruptStatus; UBaseType_t uxSavedInterruptStatus;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; BaseType_t xHigherPriorityTaskWoken = pdFALSE;
/* Ensure the buffer is returned to the list of free buffers before the /* Ensure the buffer is returned to the list of free buffers before the
counting semaphore is 'given' to say a buffer is available. */ counting semaphore is 'given' to say a buffer is available. */
@ -216,7 +216,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer ) void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{ {
portBASE_TYPE xListItemAlreadyInFreeList; BaseType_t xListItemAlreadyInFreeList;
/* Ensure the buffer is returned to the list of free buffers before the /* Ensure the buffer is returned to the list of free buffers before the
counting semaphore is 'given' to say a buffer is available. */ counting semaphore is 'given' to say a buffer is available. */
@ -240,7 +240,7 @@ portBASE_TYPE xListItemAlreadyInFreeList;
#if( ipconfigINCLUDE_TEST_CODE == 1 ) #if( ipconfigINCLUDE_TEST_CODE == 1 )
unsigned portBASE_TYPE uxGetNumberOfFreeNetworkBuffers( void ) UBaseType_t uxGetNumberOfFreeNetworkBuffers( void )
{ {
return listCURRENT_LIST_LENGTH( &xFreeBuffersList ); return listCURRENT_LIST_LENGTH( &xFreeBuffersList );
} }

@ -85,9 +85,9 @@ static xSemaphoreHandle xNetworkBufferSemaphore = NULL;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE xNetworkBuffersInitialise( void ) BaseType_t xNetworkBuffersInitialise( void )
{ {
portBASE_TYPE xReturn, x; BaseType_t xReturn, x;
/* Only initialise the buffers and their associated kernel objects if they /* Only initialise the buffers and their associated kernel objects if they
have not been initialised before. */ have not been initialised before. */
@ -177,7 +177,7 @@ void vEthernetBufferRelease( uint8_t *pucEthernetBuffer )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks ) xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, TickType_t xBlockTimeTicks )
{ {
xNetworkBufferDescriptor_t *pxReturn = NULL; xNetworkBufferDescriptor_t *pxReturn = NULL;
@ -247,7 +247,7 @@ xNetworkBufferDescriptor_t *pxReturn = NULL;
void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer ) void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{ {
portBASE_TYPE xListItemAlreadyInFreeList; BaseType_t xListItemAlreadyInFreeList;
/* Ensure the buffer is returned to the list of free buffers before the /* Ensure the buffer is returned to the list of free buffers before the
counting semaphore is 'given' to say a buffer is available. Release the counting semaphore is 'given' to say a buffer is available. Release the
@ -277,7 +277,7 @@ portBASE_TYPE xListItemAlreadyInFreeList;
#if( ipconfigINCLUDE_TEST_CODE == 1 ) #if( ipconfigINCLUDE_TEST_CODE == 1 )
unsigned portBASE_TYPE uxGetNumberOfFreeNetworkBuffers( void ) UBaseType_t uxGetNumberOfFreeNetworkBuffers( void )
{ {
return listCURRENT_LIST_LENGTH( &xFreeBuffersList ); return listCURRENT_LIST_LENGTH( &xFreeBuffersList );
} }

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

@ -71,7 +71,7 @@
operation will be held in the Blocked state (so other tasks can execute) for 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 niTX_BUFFER_FREE_WAIT ticks. It will do this a maximum of niMAX_TX_ATTEMPTS
before giving up. */ 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 ) #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; EMAC_CFG_Type Emac_Config;
portBASE_TYPE xReturn; BaseType_t xReturn;
extern uint8_t ucMACAddress[ 6 ]; extern uint8_t ucMACAddress[ 6 ];
Emac_Config.pbEMAC_Addr = ucMACAddress; 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; int32_t x;
/* Attempt to obtain access to a Tx descriptor. */ /* 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 /* The buffer filled by the DMA is going to be passed into the IP
stack. Allocate another buffer for the DMA descriptor. */ 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 ) if( pxNetworkBuffer != NULL )
{ {
@ -273,7 +273,7 @@ xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };
/* Data was received and stored. Send it to the IP task /* Data was received and stored. Send it to the IP task
for processing. */ for processing. */
xRxEvent.pvData = ( void * ) pxNetworkBuffer; 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 /* The buffer could not be sent to the IP task so the
buffer must be released. */ buffer must be released. */

@ -81,13 +81,13 @@ static void setEmacAddr( uint8_t abStationAddr[] );
* all remain interrupts are disabled * all remain interrupts are disabled
* (Ref. from LPC17xx UM) * (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 id1, id2, regv, phy = 0;
int32_t phy_linkstatus_reg, phy_linkstatus_mask; int32_t phy_linkstatus_reg, phy_linkstatus_mask;
uint32_t x; uint32_t x;
const uint32_t ulMaxAttempts = 250UL; const uint32_t ulMaxAttempts = 250UL;
portBASE_TYPE xReturn = pdPASS; BaseType_t xReturn = pdPASS;
/* Enable Ethernet Pins (NGX LPC1830 Xplorer. */ /* Enable Ethernet Pins (NGX LPC1830 Xplorer. */
scu_pinmux(0x2 ,0 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC7); 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 ) 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 * 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. * 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 ) if( ( Rx_Desc[ RxDescIndex ].Status & OWN_BIT ) == 0 )
{ {

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

@ -78,7 +78,7 @@
operation will be held in the Blocked state (so other tasks can execute) for 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 niTX_BUFFER_FREE_WAIT ticks. It will do this a maximum of niMAX_TX_ATTEMPTS
before giving up. */ 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 ) #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 ]; extern uint8_t ucMACAddress[ 6 ];
xReturn = xEMACInit( ucMACAddress ); 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; int32_t x;
/* Attempt to obtain access to a Tx descriptor. */ /* 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 /* The buffer filled by the DMA is going to be passed into the IP
stack. Allocate another buffer for the DMA descriptor. */ 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 ) if( pxNetworkBuffer != NULL )
{ {
@ -240,7 +240,7 @@ xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };
/* Data was received and stored. Send it to the IP task /* Data was received and stored. Send it to the IP task
for processing. */ for processing. */
xRxEvent.pvData = ( void * ) pxNetworkBuffer; 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 /* The buffer could not be sent to the IP task so the
buffer must be released. */ buffer must be released. */

@ -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; uint32_t ulPHYStatus;
/* Configure the hardware. */ /* 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 ) 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 ) if( ( xRXDescriptors[ xRxDescriptorIndex ].STATUS & RDES_OWN ) == 0 )
{ {

@ -46,13 +46,13 @@
/* /*
* Initialise the MAC and PHY. * 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 * Return pdTRUE if there is a FreeRTOS Tx descriptor. Return pdFALSE if all
* Tx descriptors are already in use. * 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 * 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 * 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. * 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 ); void vEMACSwapEmptyBufferForRxedData( xNetworkBufferDescriptor_t *pxNetworkBuffer );
#endif /* LPC18xx_43xx_EMAC_H */ #endif /* LPC18xx_43xx_EMAC_H */

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

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

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

Loading…
Cancel
Save