configASSERT( pcParameter );\r
\r
/* Attempt to open the requested file. */\r
- pxFile = f_open( ( const char * ) pcParameter, "r" );\r
+ pxFile = f_open( pcParameter, "r" );\r
}\r
\r
if( pxFile != NULL )\r
configASSERT( pcParameter );\r
\r
/* Attempt to delete the file. */\r
- ucReturned = f_delete( ( const char * ) pcParameter );\r
+ ucReturned = f_delete( pcParameter );\r
\r
if( ucReturned == F_NO_ERROR )\r
{\r
long lSourceLength, lDestinationLength = 0;\r
\r
/* Obtain the name of the destination file. */\r
- pcDestinationFile = FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- 2, /* Return the second parameter. */\r
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcDestinationFile = ( char * ) FreeRTOS_CLIGetParameter\r
+ (\r
+ pcCommandString, /* The command string itself. */\r
+ 2, /* Return the second parameter. */\r
+ &xParameterStringLength /* Store the parameter string length. */\r
+ );\r
\r
/* Sanity check something was returned. */\r
configASSERT( pcDestinationFile );\r
\r
/* Obtain the name of the source file. */\r
- pcSourceFile = FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- 1, /* Return the first parameter. */\r
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcSourceFile = ( char * ) FreeRTOS_CLIGetParameter\r
+ (\r
+ pcCommandString, /* The command string itself. */\r
+ 1, /* Return the first parameter. */\r
+ &xParameterStringLength /* Store the parameter string length. */\r
+ );\r
\r
/* Sanity check something was returned. */\r
configASSERT( pcSourceFile );\r
pcSourceFile[ xParameterStringLength ] = 0x00;\r
\r
/* See if the source file exists, obtain its length if it does. */\r
- lSourceLength = f_filelength( ( const char * ) pcSourceFile );\r
+ lSourceLength = f_filelength( pcSourceFile );\r
\r
if( lSourceLength == 0 )\r
{\r
else\r
{\r
/* See if the destination file exists. */\r
- lDestinationLength = f_filelength( ( const char * ) pcDestinationFile );\r
+ lDestinationLength = f_filelength( pcDestinationFile );\r
\r
if( lDestinationLength != 0 )\r
{\r
/* Open the source file, seek past the data that has already been\r
read from the file, read the next block of data, then close the\r
file again so the destination file can be opened. */\r
- pxFile = f_open( ( const char * ) pcSourceFile, "r" );\r
+ pxFile = f_open( pcSourceFile, "r" );\r
if( pxFile != NULL )\r
{\r
f_seek( pxFile, lBytesRead, F_SEEK_SET );\r
\r
/* Open the destination file and write the block of data to the end of\r
the file. */\r
- pxFile = f_open( ( const char * ) pcDestinationFile, "a" );\r
+ pxFile = f_open( pcDestinationFile, "a" );\r
if( pxFile != NULL )\r
{\r
f_write( pxWriteBuffer, lBytesToRead, 1, pxFile );\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* If this is the last of the three parameters then there are no more\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* There might be more parameters to return after this one. */\r
configASSERT( pcParameter );\r
\r
/* There are only two valid parameter values. */\r
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
{\r
/* Start or restart the trace. */\r
vTraceStop();\r
\r
sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
}\r
- else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
+ else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
{\r
/* End the trace, if one is running. */\r
vTraceStop();\r
\r
static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
- const char * pcParameter;\r
+ char * pcParameter;\r
portBASE_TYPE lParameterStringLength, xReturn;\r
uint32_t ulIPAddress, ulBytesToPing;\r
const uint32_t ulDefaultBytesToPing = 8UL;\r
pcWriteBuffer[ 0 ] = 0x00;\r
\r
/* Obtain the number of bytes to ping. */\r
- pcParameter = FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- 2, /* Return the second parameter. */\r
- &lParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = ( char * ) FreeRTOS_CLIGetParameter\r
+ (\r
+ pcCommandString, /* The command string itself. */\r
+ 2, /* Return the second parameter. */\r
+ &lParameterStringLength /* Store the parameter string length. */\r
+ );\r
\r
if( pcParameter == NULL )\r
{\r
}\r
else\r
{\r
- ulBytesToPing = atol( ( const char * ) pcParameter );\r
+ ulBytesToPing = atol( pcParameter );\r
}\r
\r
/* Obtain the IP address string. */\r
- pcParameter = FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- 1, /* Return the first parameter. */\r
- &lParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = ( char * ) FreeRTOS_CLIGetParameter\r
+ (\r
+ pcCommandString, /* The command string itself. */\r
+ 1, /* Return the first parameter. */\r
+ &lParameterStringLength /* Store the parameter string length. */\r
+ );\r
\r
/* Sanity check something was returned. */\r
configASSERT( pcParameter );\r
digit, assume the host name has been passed in. */\r
if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )\r
{\r
- ulIPAddress = FreeRTOS_inet_addr( ( const uint8_t * ) pcParameter );\r
+ ulIPAddress = FreeRTOS_inet_addr( pcParameter );\r
}\r
else\r
{\r
pcParameter[ lParameterStringLength ] = 0x00;\r
\r
/* Attempt to resolve host. */\r
- ulIPAddress = FreeRTOS_gethostbyname( ( uint8_t * ) pcParameter );\r
+ ulIPAddress = FreeRTOS_gethostbyname( pcParameter );\r
}\r
\r
/* Convert IP address, which may have come from a DNS lookup, to string. */\r
\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );\r
\r
/* Generate the file name. */\r
sprintf( cFileName, "%s.txt", pcDirectory2 );\r
\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcRoot ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcRoot ) == 0 );\r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );\r
\r
/* Generate the file name. */\r
sprintf( cFileName, "%s.txt", pcDirectory2 );\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* If this is the last of the three parameters then there are no more\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* There might be more parameters to return after this one. */\r
}\r
else\r
{\r
- ulBytesToPing = atol( ( const char * ) pcParameter );\r
+ ulBytesToPing = atol( pcParameter );\r
}\r
\r
/* Obtain the IP address string. */\r
digit, assume the host name has been passed in. */\r
if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )\r
{\r
- ulIPAddress = FreeRTOS_inet_addr( ( const uint8_t * ) pcParameter );\r
+ ulIPAddress = FreeRTOS_inet_addr( pcParameter );\r
}\r
else\r
{\r
pcParameter[ lParameterStringLength ] = 0x00;\r
\r
/* Attempt to resolve host. */\r
- ulIPAddress = FreeRTOS_gethostbyname( ( uint8_t * ) pcParameter );\r
+ ulIPAddress = FreeRTOS_gethostbyname( pcParameter );\r
}\r
\r
/* Convert IP address, which may have come from a DNS lookup, to string. */\r
configASSERT( pcParameter );\r
\r
/* There are only two valid parameter values. */\r
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
{\r
/* Start or restart the trace. */\r
vTraceStop();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
}\r
/*-----------------------------------------------------------*/\r
\r
-/* \r
+/*\r
* Task that provides the input and output for the FreeRTOS+CLI command\r
* interpreter. In this case a UDP port is used. See the URL in the comments\r
* within main.c for the location of the online documentation.\r
{\r
long lBytes, lByte;\r
signed char cInChar, cInputIndex = 0;\r
-static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];\r
+static char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];\r
portBASE_TYPE xMoreDataToFollow;\r
struct freertos_sockaddr xClient;\r
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. */\r
string. */\r
if( cInChar == '\n' )\r
{\r
- /* Process the input string received prior to the \r
+ /* Process the input string received prior to the\r
newline. */\r
do\r
{\r
/* Pass the string to FreeRTOS+CLI. */\r
xMoreDataToFollow = FreeRTOS_CLIProcessCommand( cInputString, cOutputString, cmdMAX_OUTPUT_SIZE );\r
- \r
+\r
/* Send the output generated by the command's\r
implementation. */\r
- FreeRTOS_sendto( xSocket, cOutputString, strlen( ( const char * ) cOutputString ), 0, &xClient, xClientAddressLength );\r
+ FreeRTOS_sendto( xSocket, cOutputString, strlen( cOutputString ), 0, &xClient, xClientAddressLength );\r
\r
} while( xMoreDataToFollow != pdFALSE ); /* Until the command does not generate any more output. */\r
\r
- /* All the strings generated by the command processing \r
- have been sent. Clear the input string ready to receive \r
+ /* All the strings generated by the command processing\r
+ have been sent. Clear the input string ready to receive\r
the next command. */\r
cInputIndex = 0;\r
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
- \r
+\r
/* Transmit a spacer, just to make the command console\r
easier to read. */\r
FreeRTOS_sendto( xSocket, "\r\n", strlen( "\r\n" ), 0, &xClient, xClientAddressLength );\r
{\r
if( cInChar == '\r' )\r
{\r
- /* Ignore the character. Newlines are used to \r
+ /* Ignore the character. Newlines are used to\r
detect the end of the input string. */\r
}\r
else if( cInChar == '\b' )\r
{\r
- /* Backspace was pressed. Erase the last character \r
+ /* Backspace was pressed. Erase the last character\r
in the string - if any. */\r
if( cInputIndex > 0 )\r
{\r
}\r
}\r
}\r
- } \r
+ }\r
}\r
else\r
{\r
\r
/* Bind the address to the socket. */\r
if( FreeRTOS_bind( xSocket, &xServer, sizeof( xServer ) ) == -1 )\r
- { \r
+ {\r
FreeRTOS_closesocket( xSocket );\r
xSocket = FREERTOS_INVALID_SOCKET;\r
}\r
{\r
xSocket_t xSocket;\r
struct freertos_sockaddr xEchoServerAddress;\r
-int8_t cTxString[ 25 ], cRxString[ 25 ]; /* Make sure the stack is large enough to hold these. Turn on stack overflow checking during debug to be sure. */\r
+char cTxString[ 25 ], cRxString[ 25 ]; /* Make sure the stack is large enough to hold these. Turn on stack overflow checking during debug to be sure. */\r
int32_t lLoopCount = 0UL;\r
const int32_t lMaxLoopCount = 50;\r
volatile uint32_t ulRxCount = 0UL, ulTxCount = 0UL;\r
for( lLoopCount = 0; lLoopCount < lMaxLoopCount; lLoopCount++ )\r
{\r
/* Create the string that is sent to the echo server. */\r
- sprintf( ( char * ) cTxString, "Message number %u\r\n", ( unsigned int ) ulTxCount );\r
+ sprintf( cTxString, "Message number %u\r\n", ( unsigned int ) ulTxCount );\r
\r
/* Send the string to the socket. ulFlags is set to 0, so the zero\r
copy interface is not used. That means the data from cTxString is\r
to ensure the NULL string terminator is sent as part of the message. */\r
FreeRTOS_sendto( xSocket, /* The socket being sent to. */\r
( void * ) cTxString, /* The data being sent. */\r
- strlen( ( const char * ) cTxString ) + 1, /* The length of the data being sent. */\r
+ strlen( cTxString ) + 1,/* The length of the data being sent. */\r
0, /* ulFlags with the FREERTOS_ZERO_COPY bit clear. */\r
&xEchoServerAddress, /* The destination address. */\r
sizeof( xEchoServerAddress ) );\r
&xAddressLength );\r
\r
/* Compare the transmitted string to the received string. */\r
- if( strcmp( ( char * ) cRxString, ( char * ) cTxString ) == 0 )\r
+ if( strcmp( cRxString, cTxString ) == 0 )\r
{\r
/* The echo reply was received without error. */\r
ulRxCount++;\r
{\r
xSocket_t xSocket;\r
struct freertos_sockaddr xEchoServerAddress;\r
-static int8_t cTxString[ 40 ];\r
+static char cTxString[ 40 ];\r
int32_t lLoopCount = 0UL;\r
volatile uint32_t ulRxCount = 0UL, ulTxCount = 0UL;\r
uint32_t xAddressLength = sizeof( xEchoServerAddress );\r
uint8_t *pucUDPPayloadBuffer;\r
\r
const int32_t lMaxLoopCount = 50;\r
-const uint8_t * const pucStringToSend = ( const uint8_t * const ) "Zero copy message number";\r
+const char * const pcStringToSend = "Zero copy message number";\r
/* The buffer is large enough to hold the string, a number, and the string terminator. */\r
-const size_t xBufferLength = strlen( ( char * ) pucStringToSend ) + 15;\r
+const size_t xBufferLength = strlen( pcStringToSend ) + 15;\r
\r
#if ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1\r
{\r
/* A buffer was successfully obtained. Create the string that is\r
sent to the echo server. Note the string is written directly\r
into the buffer obtained from the IP stack. */\r
- sprintf( ( char * ) pucUDPPayloadBuffer, "%s %u\r\n", ( const char * ) "Zero copy message number", ( unsigned int ) ulTxCount );\r
+ sprintf( ( char * ) pucUDPPayloadBuffer, "%s %u\r\n", "Zero copy message number", ( unsigned int ) ulTxCount );\r
\r
/* Also copy the string into a local buffer so it can be compared\r
with the string that is later received back from the echo server. */\r
- strcpy( ( char * ) cTxString, ( char * ) pucUDPPayloadBuffer );\r
+ strcpy( cTxString, ( char * ) pucUDPPayloadBuffer );\r
\r
/* Pass the buffer into the send function. ulFlags has the\r
FREERTOS_ZERO_COPY bit set so the IP stack will take control of\r
echoMARK_SEND_IN_TRACE_BUFFER( xZeroCopySendEvent );\r
lReturned = FreeRTOS_sendto( xSocket, /* The socket being sent to. */\r
( void * ) pucUDPPayloadBuffer, /* The buffer being passed into the IP stack. */\r
- strlen( ( const char * ) cTxString ) + 1, /* The length of the data being sent. Plus 1 to ensure the null terminator is part of the data. */\r
+ strlen( cTxString ) + 1, /* The length of the data being sent. Plus 1 to ensure the null terminator is part of the data. */\r
FREERTOS_ZERO_COPY, /* ulFlags with the zero copy bit is set. */\r
&xEchoServerAddress, /* Where the data is being sent. */\r
sizeof( xEchoServerAddress ) );\r
{\r
/* Compare the string sent to the echo server with the string\r
received back from the echo server. */\r
- if( strcmp( ( char * ) pucUDPPayloadBuffer, ( char * ) cTxString ) == 0 )\r
+ if( strcmp( ( char * ) pucUDPPayloadBuffer, cTxString ) == 0 )\r
{\r
/* The strings matched. */\r
ulRxCount++;\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, lParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, lParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* If this is the last of the three parameters then there are no more\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, lParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, lParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* There might be more parameters to return after this one. */\r
configASSERT( pcParameter );\r
\r
/* There are only two valid parameter values. */\r
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
{\r
/* Start or restart the trace. */\r
vTraceStop();\r
\r
sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
}\r
- else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
+ else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
{\r
/* End the trace, if one is running. */\r
vTraceStop();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
CYASSL* xCyaSSL_Object;\r
WORD wVersionRequested;\r
WSADATA xWSAData;\r
-uint8_t cString[ 50 ];\r
+char cString[ 50 ];\r
portBASE_TYPE lReturned;\r
uint32_t ulCount = 0UL;\r
\r
/* Connect to the secure server. */\r
if( connect( xClientSocket, ( SOCKADDR * ) &xConnection, sizeof( xConnection ) ) == 0 )\r
{\r
- /* The connect was successful. Create a CyaSSL object to associate \r
+ /* The connect was successful. Create a CyaSSL object to associate\r
with this connection. */\r
xCyaSSL_Object = CyaSSL_new( xCyaSSL_ClientContext );\r
- \r
+\r
if( xCyaSSL_Object != NULL )\r
{\r
- /* Associate the created CyaSSL object with the connected \r
+ /* Associate the created CyaSSL object with the connected\r
socket. */\r
lReturned = CyaSSL_set_fd( xCyaSSL_Object, xClientSocket );\r
configASSERT( lReturned == SSL_SUCCESS );\r
do\r
{\r
/* Create the string that is sent to the secure server. */\r
- sprintf( ( char * ) cString, "Message number %lu\r\n", ulCount );\r
+ sprintf( cString, "Message number %lu\r\n", ulCount );\r
\r
- /* The next line is the secure equivalent of the standard \r
+ /* The next line is the secure equivalent of the standard\r
sockets call:\r
lReturned = send( xClientSocket, cString, strlen( cString ) + 1, 0 ); */\r
- lReturned = CyaSSL_write( xCyaSSL_Object, ( const char * ) cString, strlen( ( const char * ) cString ) + 1 );\r
- \r
- \r
+ lReturned = CyaSSL_write( xCyaSSL_Object, cString, strlen( cString ) + 1 );\r
+\r
+\r
/* Short delay to prevent the messages streaming up the\r
console too quickly. */\r
vTaskDelay( 50 );\r
\r
} while( ( lReturned != SOCKET_ERROR ) && ( ulCount < 10UL ) );\r
}\r
- \r
+\r
CyaSSL_free( xCyaSSL_Object );\r
closesocket( xClientSocket );\r
\r
configASSERT( pcParameter );\r
\r
/* Attempt to open the requested file. */\r
- pxFile = f_open( ( const char * ) pcParameter, "r" );\r
+ pxFile = f_open( pcParameter, "r" );\r
}\r
\r
if( pxFile != NULL )\r
if( ucReturned == F_NO_ERROR )\r
{\r
sprintf( pcWriteBuffer, "In: " );\r
- xStringLength = strlen( ( const char * ) pcWriteBuffer );\r
+ xStringLength = strlen( pcWriteBuffer );\r
f_getcwd( &( pcWriteBuffer[ xStringLength ] ), ( unsigned char ) ( xWriteBufferLen - xStringLength ) );\r
}\r
else\r
configASSERT( pcParameter );\r
\r
/* Attempt to delete the file. */\r
- ucReturned = f_delete( ( const char * ) pcParameter );\r
+ ucReturned = f_delete( pcParameter );\r
\r
if( ucReturned == F_NO_ERROR )\r
{\r
pcSourceFile[ xParameterStringLength ] = 0x00;\r
\r
/* See if the source file exists, obtain its length if it does. */\r
- lSourceLength = f_filelength( ( const char * ) pcSourceFile );\r
+ lSourceLength = f_filelength( pcSourceFile );\r
\r
if( lSourceLength == 0 )\r
{\r
else\r
{\r
/* See if the destination file exists. */\r
- lDestinationLength = f_filelength( ( const char * ) pcDestinationFile );\r
+ lDestinationLength = f_filelength( pcDestinationFile );\r
\r
if( lDestinationLength != 0 )\r
{\r
/* Open the source file, seek past the data that has already been\r
read from the file, read the next block of data, then close the\r
file again so the destination file can be opened. */\r
- pxFile = f_open( ( const char * ) pcSourceFile, "r" );\r
+ pxFile = f_open( pcSourceFile, "r" );\r
if( pxFile != NULL )\r
{\r
f_seek( pxFile, lBytesRead, F_SEEK_SET );\r
\r
/* Open the destination file and write the block of data to the end of\r
the file. */\r
- pxFile = f_open( ( const char * ) pcDestinationFile, "a" );\r
+ pxFile = f_open( pcDestinationFile, "a" );\r
if( pxFile != NULL )\r
{\r
f_write( pxWriteBuffer, lBytesToRead, 1, pxFile );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "In directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );\r
\r
/* Generate the file name. */\r
sprintf( cFileName, "%s.txt", pcDirectory2 );\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "Back in root directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcRoot ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcRoot ) == 0 );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "Back in directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );\r
\r
/* Generate the file name. */\r
sprintf( cFileName, "%s.txt", pcDirectory2 );\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* If this is the last of the three parameters then there are no more\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* There might be more parameters to return after this one. */\r
configASSERT( pcParameter );\r
\r
/* There are only two valid parameter values. */\r
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
{\r
/* Start or restart the trace. */\r
vTraceStop();\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* If this is the last of the three parameters then there are no more\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* There might be more parameters to return after this one. */\r
digit, assume the host name has been passed in. */\r
if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )\r
{\r
- ulIPAddress = FreeRTOS_inet_addr( ( const uint8_t * ) pcParameter );\r
+ ulIPAddress = FreeRTOS_inet_addr( pcParameter );\r
}\r
else\r
{\r
pcParameter[ lParameterStringLength ] = 0x00;\r
\r
/* Attempt to resolve host. */\r
- ulIPAddress = FreeRTOS_gethostbyname( ( uint8_t * ) pcParameter );\r
+ ulIPAddress = FreeRTOS_gethostbyname( pcParameter );\r
}\r
\r
/* Convert IP address, which may have come from a DNS lookup, to string. */\r
configASSERT( pcParameter );\r
\r
/* There are only two valid parameter values. */\r
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
{\r
/* Start or restart the trace. */\r
vTraceStop();\r
* Obtain a character from the CDC input. The calling task will be held in the\r
* Blocked state (so other tasks can execute) until a character is avilable.\r
*/\r
-int8_t cGetCDCChar( void );\r
+char cGetCDCChar( void );\r
\r
/*\r
* Initialise the third party virtual comport files driver\r
static xSemaphoreHandle xCDCMutex = NULL;\r
\r
/* Const messages output by the command console. */\r
-static const uint8_t * const pcWelcomeMessage = ( uint8_t * ) "FreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>";\r
-static const uint8_t * const pcEndOfOutputMessage = ( uint8_t * ) "\r\n[Press ENTER to execute the previous command again]\r\n>";\r
-static const uint8_t * const pcNewLine = ( uint8_t * ) "\r\n";\r
+static const char * const pcWelcomeMessage = "FreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>";\r
+static const char * const pcEndOfOutputMessage = "\r\n[Press ENTER to execute the previous command again]\r\n>";\r
+static const char * const pcNewLine = "\r\n";\r
\r
/*-----------------------------------------------------------*/\r
\r
\r
static void prvCDCCommandConsoleTask( void *pvParameters )\r
{\r
-int8_t cRxedChar, cInputIndex = 0, *pcOutputString;\r
-static int8_t cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];\r
+char cRxedChar;\r
+uint8_t ucInputIndex = 0;\r
+char *pcOutputString;\r
+static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];\r
portBASE_TYPE xReturned;\r
\r
( void ) pvParameters;\r
\r
/* Send the welcome message. This probably won't be seen as the console\r
will not have been connected yet. */\r
- USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcWelcomeMessage, strlen( ( const char * ) pcWelcomeMessage ) );\r
+ USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcWelcomeMessage, strlen( pcWelcomeMessage ) );\r
\r
for( ;; )\r
{\r
if( cRxedChar == '\n' || cRxedChar == '\r' )\r
{\r
/* Just to space the output from the input. */\r
- USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcNewLine, strlen( ( const char * ) pcNewLine ) );\r
+ USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcNewLine, strlen( pcNewLine ) );\r
\r
/* See if the command is empty, indicating that the last command is\r
to be executed again. */\r
- if( cInputIndex == 0 )\r
+ if( ucInputIndex == 0 )\r
{\r
/* Copy the last command back into the input string. */\r
- strcpy( ( char * ) cInputString, ( char * ) cLastInputString );\r
+ strcpy( cInputString, cLastInputString );\r
}\r
\r
/* Pass the received command to the command interpreter. The\r
xReturned = FreeRTOS_CLIProcessCommand( cInputString, pcOutputString, configCOMMAND_INT_MAX_OUTPUT_SIZE );\r
\r
/* Write the generated string to the CDC. */\r
- USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcOutputString, strlen( ( const char * ) pcOutputString ) );\r
+ USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcOutputString, strlen( pcOutputString ) );\r
vTaskDelay( 1 );\r
\r
} while( xReturned != pdFALSE );\r
Clear the input string ready to receive the next command. Remember\r
the command that was just processed first in case it is to be\r
processed again. */\r
- strcpy( ( char * ) cLastInputString, ( char * ) cInputString );\r
- cInputIndex = 0;\r
+ strcpy( cLastInputString, cInputString );\r
+ ucInputIndex = 0;\r
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
\r
- USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcEndOfOutputMessage, strlen( ( const char * ) pcEndOfOutputMessage ) );\r
+ USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcEndOfOutputMessage, strlen( pcEndOfOutputMessage ) );\r
}\r
else\r
{\r
{\r
/* Backspace was pressed. Erase the last character in the\r
string - if any. */\r
- if( cInputIndex > 0 )\r
+ if( ucInputIndex > 0 )\r
{\r
- cInputIndex--;\r
- cInputString[ cInputIndex ] = '\0';\r
+ ucInputIndex--;\r
+ cInputString[ ucInputIndex ] = '\0';\r
}\r
}\r
else\r
string will be passed to the command interpreter. */\r
if( ( cRxedChar >= ' ' ) && ( cRxedChar <= '~' ) )\r
{\r
- if( cInputIndex < cmdMAX_INPUT_SIZE )\r
+ if( ucInputIndex < cmdMAX_INPUT_SIZE )\r
{\r
- cInputString[ cInputIndex ] = cRxedChar;\r
- cInputIndex++;\r
+ cInputString[ ucInputIndex ] = cRxedChar;\r
+ ucInputIndex++;\r
}\r
}\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vOutputString( const uint8_t * const pucMessage )\r
+void vOutputString( const char * const pcMessage )\r
{\r
if( xSemaphoreTake( xCDCMutex, cmdMAX_MUTEX_WAIT ) == pdPASS )\r
{\r
- USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pucMessage, strlen( ( const char * ) pucMessage ) );\r
+ USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcMessage, strlen( pcMessage ) );\r
xSemaphoreGive( xCDCMutex );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-int8_t cGetCDCChar( void )\r
+char cGetCDCChar( void )\r
{\r
int32_t lAvailableBytes, xBytes = 0;\r
-int8_t cInputChar;\r
+char cInputChar;\r
\r
do\r
{\r
{\r
/* Attempt to read one character. */\r
xBytes = 1;\r
- xBytes = CDC_RdOutBuf( ( char * ) &cInputChar, &xBytes );\r
+ xBytes = CDC_RdOutBuf( &cInputChar, &xBytes );\r
\r
xSemaphoreGive( xCDCMutex );\r
}\r
/* Called by FreeRTOS+UDP when a reply is received to an outgoing ping request. */\r
void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier )\r
{\r
-static const uint8_t *pucSuccess = ( uint8_t * ) "\r\n\r\nPing reply received - ";\r
-static const uint8_t *pucInvalidChecksum = ( uint8_t * ) "\r\n\r\nPing reply received with invalid checksum - ";\r
-static const uint8_t *pucInvalidData = ( uint8_t * ) "\r\n\r\nPing reply received with invalid data - ";\r
-static uint8_t ucMessage[ 50 ];\r
-void vOutputString( const uint8_t * const pucMessage );\r
+static const char *pcSuccess = "\r\n\r\nPing reply received - ";\r
+static const char *pcInvalidChecksum = "\r\n\r\nPing reply received with invalid checksum - ";\r
+static const char *pcInvalidData = "\r\n\r\nPing reply received with invalid data - ";\r
+static char cMessage[ 50 ];\r
+void vOutputString( const char * const pcMessage );\r
\r
switch( eStatus )\r
{\r
case eSuccess :\r
- vOutputString( pucSuccess );\r
+ vOutputString( pcSuccess );\r
break;\r
\r
case eInvalidChecksum :\r
- vOutputString( pucInvalidChecksum );\r
+ vOutputString( pcInvalidChecksum );\r
break;\r
\r
case eInvalidData :\r
- vOutputString( pucInvalidData );\r
+ vOutputString( pcInvalidData );\r
break;\r
\r
default :\r
break;\r
}\r
\r
- sprintf( ( char * ) ucMessage, "identifier %d\r\n\r\n", ( int ) usIdentifier );\r
- vOutputString( ucMessage );\r
+ sprintf( cMessage, "identifier %d\r\n\r\n", ( int ) usIdentifier );\r
+ vOutputString( cMessage );\r
}\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
1 tab == 4 spaces!\r
*/\r
\r
-/* \r
+/*\r
* Creates two transmitting tasks and two receiving tasks. The transmitting\r
* tasks send values that are received by the receiving tasks. One set of tasks\r
* uses the standard API. The other set of tasks uses the zero copy API.\r
{\r
xSocket_t xClientSocket;\r
struct freertos_sockaddr xDestinationAddress;\r
-uint8_t cString[ 50 ];\r
+char cString[ 50 ];\r
portBASE_TYPE lReturned;\r
uint32_t ulCount = 0UL, ulIPAddress;\r
const uint32_t ulLoopsPerSocket = 10UL;\r
do\r
{\r
/* Create the string that is sent to the server. */\r
- sprintf( ( char * ) cString, "Server received (not zero copy): Message number %lu\r\n", ulCount );\r
+ sprintf( cString, "Server received (not zero copy): Message number %lu\r\n", ulCount );\r
\r
/* Send the string to the socket. ulFlags is set to 0, so the zero\r
copy option is not selected. That means the data from cString[] is\r
copied into a network buffer inside FreeRTOS_sendto(), and cString[]\r
can be reused as soon as FreeRTOS_sendto() has returned. */\r
- lReturned = FreeRTOS_sendto( xClientSocket, ( void * ) cString, strlen( ( const char * ) cString ), 0, &xDestinationAddress, sizeof( xDestinationAddress ) );\r
+ lReturned = FreeRTOS_sendto( xClientSocket, ( void * ) cString, strlen( cString ), 0, &xDestinationAddress, sizeof( xDestinationAddress ) );\r
\r
ulCount++;\r
\r
static void prvSimpleServerTask( void *pvParameters )\r
{\r
long lBytes;\r
-uint8_t cReceivedString[ 60 ];\r
+char cReceivedString[ 60 ];\r
struct freertos_sockaddr xClient, xBindAddress;\r
uint32_t xClientLength = sizeof( xClient );\r
xSocket_t xListeningSocket;\r
/* Print the received characters. */\r
if( lBytes > 0 )\r
{\r
- vOutputString( ( char * ) cReceivedString );\r
+ vOutputString( cReceivedString );\r
}\r
\r
/* Error check. */\r
- configASSERT( lBytes == ( portBASE_TYPE ) strlen( ( const char * ) cReceivedString ) );\r
+ configASSERT( lBytes == ( portBASE_TYPE ) strlen( cReceivedString ) );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
portBASE_TYPE lReturned;\r
uint32_t ulCount = 0UL, ulIPAddress;\r
const uint32_t ulLoopsPerSocket = 10UL;\r
-const uint8_t *pucStringToSend = ( const uint8_t * ) "Server received (using zero copy): Message number ";\r
+const char *pcStringToSend = "Server received (using zero copy): Message number ";\r
const portTickType x150ms = 150UL / portTICK_RATE_MS;\r
/* 15 is added to ensure the number, \r\n and terminating zero fit. */\r
-const size_t xStringLength = strlen( ( char * ) pucStringToSend ) + 15;\r
+const size_t xStringLength = strlen( pcStringToSend ) + 15;\r
\r
/* Remove compiler warning about unused parameters. */\r
( void ) pvParameters;\r
end. Note that the string is being written directly into the buffer\r
obtained from the IP stack above. */\r
memset( ( void * ) pucUDPPayloadBuffer, 0x00, xStringLength );\r
- sprintf( ( char * ) pucUDPPayloadBuffer, "%s%lu\r\n", ( char * ) pucStringToSend, ulCount );\r
+ sprintf( ( char * ) pucUDPPayloadBuffer, "%s%lu\r\n", pcStringToSend, ulCount );\r
\r
/* Pass the buffer into the send function. ulFlags has the\r
FREERTOS_ZERO_COPY bit set so the IP stack will take control of the\r
\r
/* Send the output generated by the command's\r
implementation. */\r
- FreeRTOS_sendto( xSocket, cOutputString, strlen( ( const char * ) cOutputString ), 0, &xClient, xClientAddressLength );\r
+ FreeRTOS_sendto( xSocket, cOutputString, strlen( cOutputString ), 0, &xClient, xClientAddressLength );\r
\r
} while( xMoreDataToFollow != pdFALSE ); /* Until the command does not generate any more output. */\r
\r
* This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license\r
* terms are different to the FreeRTOS license terms.\r
*\r
- * FreeRTOS+UDP uses a dual license model that allows the software to be used \r
- * under a standard GPL open source license, or a commercial license. The \r
- * standard GPL license (unlike the modified GPL license under which FreeRTOS \r
- * itself is distributed) requires that all software statically linked with \r
- * FreeRTOS+UDP is also distributed under the same GPL V2 license terms. \r
+ * FreeRTOS+UDP uses a dual license model that allows the software to be used\r
+ * under a standard GPL open source license, or a commercial license. The\r
+ * standard GPL license (unlike the modified GPL license under which FreeRTOS\r
+ * itself is distributed) requires that all software statically linked with\r
+ * FreeRTOS+UDP is also distributed under the same GPL V2 license terms.\r
* Details of both license options follow:\r
*\r
* - Open source licensing -\r
*\r
* - Commercial licensing -\r
* Businesses and individuals that for commercial or other reasons cannot comply\r
- * with the terms of the GPL V2 license must obtain a commercial license before \r
- * incorporating FreeRTOS+UDP into proprietary software for distribution in any \r
- * form. Commercial licenses can be purchased from http://shop.freertos.org/udp \r
+ * with the terms of the GPL V2 license must obtain a commercial license before\r
+ * incorporating FreeRTOS+UDP into proprietary software for distribution in any\r
+ * form. Commercial licenses can be purchased from http://shop.freertos.org/udp\r
* and do not require any source files to be changed.\r
*\r
* FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot\r
/*\r
* Create the DNS message in the zero copy buffer passed in the first parameter.\r
*/\r
-static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const uint8_t *pcHostName, uint16_t usIdentifier );\r
+static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const char *pcHostName, uint16_t usIdentifier );\r
\r
/*\r
* Simple routine that jumps over the NAME field of a resource record.\r
\r
/*-----------------------------------------------------------*/\r
\r
-uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName )\r
+uint32_t FreeRTOS_gethostbyname( const char *pcHostName )\r
{\r
static uint16_t usIdentifier = 0;\r
struct freertos_sockaddr xAddress;\r
portBASE_TYPE xAttempt;\r
int32_t lBytes;\r
size_t xPayloadLength;\r
-const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( ( const char * const ) pcHostName ) + sizeof( uint16_t ) + sizeof( uint16_t ) + 2; /* Two for the count of characters in the first subdomain part, and the string end byte */\r
+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 */\r
\r
if( xDNSSocket == NULL )\r
{\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const uint8_t *pcHostName, uint16_t usIdentifier )\r
+static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const char *pcHostName, uint16_t usIdentifier )\r
{\r
xDNSMessage_t *pxDNSMessageHeader;\r
uint8_t *pucStart, *pucByte;\r
pucByte = pucStart + 1;\r
\r
/* Copy in the host name. */\r
- strcpy( ( char * ) pucByte, ( const char * ) pcHostName );\r
+ strcpy( ( char * ) pucByte, pcHostName );\r
\r
/* Mark the end of the string. */\r
- pucByte += strlen( ( const char * ) pcHostName );\r
+ pucByte += strlen( pcHostName );\r
*pucByte = 0x00;\r
\r
/* Walk the string to replace the '.' characters with byte counts.\r
* This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license\r
* terms are different to the FreeRTOS license terms.\r
*\r
- * FreeRTOS+UDP uses a dual license model that allows the software to be used \r
- * under a standard GPL open source license, or a commercial license. The \r
- * standard GPL license (unlike the modified GPL license under which FreeRTOS \r
- * itself is distributed) requires that all software statically linked with \r
- * FreeRTOS+UDP is also distributed under the same GPL V2 license terms. \r
+ * FreeRTOS+UDP uses a dual license model that allows the software to be used\r
+ * under a standard GPL open source license, or a commercial license. The\r
+ * standard GPL license (unlike the modified GPL license under which FreeRTOS\r
+ * itself is distributed) requires that all software statically linked with\r
+ * FreeRTOS+UDP is also distributed under the same GPL V2 license terms.\r
* Details of both license options follow:\r
*\r
* - Open source licensing -\r
*\r
* - Commercial licensing -\r
* Businesses and individuals that for commercial or other reasons cannot comply\r
- * with the terms of the GPL V2 license must obtain a commercial license before \r
- * incorporating FreeRTOS+UDP into proprietary software for distribution in any \r
- * form. Commercial licenses can be purchased from http://shop.freertos.org/udp \r
+ * with the terms of the GPL V2 license must obtain a commercial license before\r
+ * incorporating FreeRTOS+UDP into proprietary software for distribution in any\r
+ * form. Commercial licenses can be purchased from http://shop.freertos.org/udp\r
* and do not require any source files to be changed.\r
*\r
* FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot\r
\r
#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
\r
- portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet ) \r
+ portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet )\r
{\r
xFreeRTOS_Socket_t *pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
portBASE_TYPE xReturn;\r
/* Is the socket a member of a select() group? */\r
if( pxSocket->xSelectQueue != NULL )\r
{\r
- /* Can the select group be notified that the socket is \r
+ /* Can the select group be notified that the socket is\r
ready to be read? */\r
if( xQueueSendFromISR( pxSocket->xSelectQueue, &pxSocket, &xHigherPriorityTaskWoken ) != pdPASS )\r
{\r
/* Could not notify the select group. */\r
xReturn = pdFAIL;\r
iptraceFAILED_TO_NOTIFY_SELECT_GROUP( pxSocket );\r
- } \r
+ }\r
}\r
}\r
- #endif \r
+ #endif\r
\r
if( xReturn == pdPASS )\r
{\r
taskENTER_CRITICAL();\r
{\r
- /* Add the network packet to the list of packets to be \r
+ /* Add the network packet to the list of packets to be\r
processed by the socket. */\r
vListInsertEnd( &( pxSocket->xWaitingPacketsList ), &( pxNetworkBuffer->xBufferListItem ) );\r
}\r
taskEXIT_CRITICAL();\r
\r
- /* The socket's counting semaphore records how many packets are \r
+ /* The socket's counting semaphore records how many packets are\r
waiting to be processed by the socket. */\r
xSemaphoreGiveFromISR( pxSocket->xWaitingPacketSemaphore, &xHigherPriorityTaskWoken );\r
}\r
\r
#if ipconfigINCLUDE_FULL_INET_ADDR == 1\r
\r
- uint32_t FreeRTOS_inet_addr( const uint8_t * pucIPAddress )\r
+ uint32_t FreeRTOS_inet_addr( const char *pcIPAddress )\r
{\r
const uint8_t ucDecimalBase = 10;\r
uint8_t ucOctet[ socketMAX_IP_ADDRESS_OCTETS ];\r
- const uint8_t *pucPointerOnEntering;\r
+ const char *pcPointerOnEntering;\r
uint32_t ulReturn = 0UL, ulOctetNumber, ulValue;\r
portBASE_TYPE xResult = pdPASS;\r
\r
for( ulOctetNumber = 0; ulOctetNumber < socketMAX_IP_ADDRESS_OCTETS; ulOctetNumber++ )\r
{\r
ulValue = 0;\r
- pucPointerOnEntering = pucIPAddress;\r
+ pcPointerOnEntering = pcIPAddress;\r
\r
- while( ( *pucIPAddress >= ( uint8_t ) '0' ) && ( *pucIPAddress <= ( uint8_t ) '9' ) )\r
+ while( ( *pcIPAddress >= ( uint8_t ) '0' ) && ( *pcIPAddress <= ( uint8_t ) '9' ) )\r
{\r
/* Move previous read characters into the next decimal\r
position. */\r
ulValue *= ucDecimalBase;\r
\r
/* Add the binary value of the ascii character. */\r
- ulValue += ( *pucIPAddress - ( uint8_t ) '0' );\r
+ ulValue += ( *pcIPAddress - ( uint8_t ) '0' );\r
\r
/* Move to next character in the string. */\r
- pucIPAddress++;\r
+ pcIPAddress++;\r
}\r
\r
/* Check characters were read. */\r
- if( pucIPAddress == pucPointerOnEntering )\r
+ if( pcIPAddress == pcPointerOnEntering )\r
{\r
xResult = pdFAIL;\r
}\r
/* Check the next character is as expected. */\r
if( ulOctetNumber < ( socketMAX_IP_ADDRESS_OCTETS - 1 ) )\r
{\r
- if( *pucIPAddress != ( uint8_t ) '.' )\r
+ if( *pcIPAddress != ( uint8_t ) '.' )\r
{\r
xResult = pdFAIL;\r
}\r
else\r
{\r
/* Move past the dot. */\r
- pucIPAddress++;\r
+ pcIPAddress++;\r
}\r
}\r
}\r
}\r
}\r
\r
- if( *pucIPAddress != ( uint8_t ) 0x00 )\r
+ if( *pcIPAddress != ( uint8_t ) 0x00 )\r
{\r
/* Expected the end of the string. */\r
xResult = pdFAIL;\r
* This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license\r
* terms are different to the FreeRTOS license terms.\r
*\r
- * FreeRTOS+UDP uses a dual license model that allows the software to be used \r
- * under a standard GPL open source license, or a commercial license. The \r
- * standard GPL license (unlike the modified GPL license under which FreeRTOS \r
- * itself is distributed) requires that all software statically linked with \r
- * FreeRTOS+UDP is also distributed under the same GPL V2 license terms. \r
+ * FreeRTOS+UDP uses a dual license model that allows the software to be used\r
+ * under a standard GPL open source license, or a commercial license. The\r
+ * standard GPL license (unlike the modified GPL license under which FreeRTOS\r
+ * itself is distributed) requires that all software statically linked with\r
+ * FreeRTOS+UDP is also distributed under the same GPL V2 license terms.\r
* Details of both license options follow:\r
*\r
* - Open source licensing -\r
*\r
* - Commercial licensing -\r
* Businesses and individuals that for commercial or other reasons cannot comply\r
- * with the terms of the GPL V2 license must obtain a commercial license before \r
- * incorporating FreeRTOS+UDP into proprietary software for distribution in any \r
- * form. Commercial licenses can be purchased from http://shop.freertos.org/udp \r
+ * with the terms of the GPL V2 license must obtain a commercial license before\r
+ * incorporating FreeRTOS+UDP into proprietary software for distribution in any\r
+ * form. Commercial licenses can be purchased from http://shop.freertos.org/udp\r
* and do not require any source files to be changed.\r
*\r
* FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot\r
* FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:\r
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml\r
*/\r
-uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName );\r
+uint32_t FreeRTOS_gethostbyname( const char *pcHostName );\r
\r
#endif /* FREERTOS_DNS_H */\r
\r
* This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license\r
* terms are different to the FreeRTOS license terms.\r
*\r
- * FreeRTOS+UDP uses a dual license model that allows the software to be used \r
- * under a standard GPL open source license, or a commercial license. The \r
- * standard GPL license (unlike the modified GPL license under which FreeRTOS \r
- * itself is distributed) requires that all software statically linked with \r
- * FreeRTOS+UDP is also distributed under the same GPL V2 license terms. \r
+ * FreeRTOS+UDP uses a dual license model that allows the software to be used\r
+ * under a standard GPL open source license, or a commercial license. The\r
+ * standard GPL license (unlike the modified GPL license under which FreeRTOS\r
+ * itself is distributed) requires that all software statically linked with\r
+ * FreeRTOS+UDP is also distributed under the same GPL V2 license terms.\r
* Details of both license options follow:\r
*\r
* - Open source licensing -\r
*\r
* - Commercial licensing -\r
* Businesses and individuals that for commercial or other reasons cannot comply\r
- * with the terms of the GPL V2 license must obtain a commercial license before \r
- * incorporating FreeRTOS+UDP into proprietary software for distribution in any \r
- * form. Commercial licenses can be purchased from http://shop.freertos.org/udp \r
+ * with the terms of the GPL V2 license must obtain a commercial license before\r
+ * incorporating FreeRTOS+UDP into proprietary software for distribution in any\r
+ * form. Commercial licenses can be purchased from http://shop.freertos.org/udp\r
* and do not require any source files to be changed.\r
*\r
* FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot\r
/* The socket type itself. */\r
typedef void *xSocket_t;\r
\r
-/* The xSocketSet_t type is the equivalent to the fd_set type used by the \r
+/* The xSocketSet_t type is the equivalent to the fd_set type used by the\r
Berkeley API. */\r
typedef void *xSocketSet_t;\r
\r
portBASE_TYPE FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );\r
portBASE_TYPE FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength );\r
portBASE_TYPE FreeRTOS_closesocket( xSocket_t xSocket );\r
-uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName );\r
-uint32_t FreeRTOS_inet_addr( const uint8_t * pucIPAddress );\r
+uint32_t FreeRTOS_gethostbyname( const char *pcHostName );\r
+uint32_t FreeRTOS_inet_addr( const char *pcIPAddress );\r
\r
#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
xSocketSet_t FreeRTOS_CreateSocketSet( unsigned portBASE_TYPE uxEventQueueLength );\r
configASSERT( pcParameter );\r
\r
/* Attempt to open the requested file. */\r
- pxFile = f_open( ( const char * ) pcParameter, "r" );\r
+ pxFile = f_open( pcParameter, "r" );\r
}\r
\r
if( pxFile != NULL )\r
configASSERT( pcParameter );\r
\r
/* Attempt to delete the file. */\r
- ucReturned = f_delete( ( const char * ) pcParameter );\r
+ ucReturned = f_delete( pcParameter );\r
\r
if( ucReturned == F_NO_ERROR )\r
{\r
pcSourceFile[ xParameterStringLength ] = 0x00;\r
\r
/* See if the source file exists, obtain its length if it does. */\r
- lSourceLength = f_filelength( ( const char * ) pcSourceFile );\r
+ lSourceLength = f_filelength( pcSourceFile );\r
\r
if( lSourceLength == 0 )\r
{\r
else\r
{\r
/* See if the destination file exists. */\r
- lDestinationLength = f_filelength( ( const char * ) pcDestinationFile );\r
+ lDestinationLength = f_filelength( pcDestinationFile );\r
\r
if( lDestinationLength != 0 )\r
{\r
/* Open the source file, seek past the data that has already been\r
read from the file, read the next block of data, then close the\r
file again so the destination file can be opened. */\r
- pxFile = f_open( ( const char * ) pcSourceFile, "r" );\r
+ pxFile = f_open( pcSourceFile, "r" );\r
if( pxFile != NULL )\r
{\r
f_seek( pxFile, lBytesRead, F_SEEK_SET );\r
\r
/* Open the destination file and write the block of data to the end of\r
the file. */\r
- pxFile = f_open( ( const char * ) pcDestinationFile, "a" );\r
+ pxFile = f_open( pcDestinationFile, "a" );\r
if( pxFile != NULL )\r
{\r
f_write( pxWriteBuffer, lBytesToRead, 1, pxFile );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "In directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );\r
\r
/* Generate the file name. */\r
sprintf( cFileName, "%s.txt", pcDirectory2 );\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "Back in root directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcRoot ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcRoot ) == 0 );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "Back in directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );\r
\r
/* Generate the file name. */\r
sprintf( cFileName, "%s.txt", pcDirectory2 );\r
configASSERT( pcParameter );\r
\r
/* There are only two valid parameter values. */\r
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
{\r
/* Start or restart the trace. */\r
vTraceStop();\r
\r
sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
}\r
- else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
+ else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
{\r
/* End the trace, if one is running. */\r
vTraceStop();\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* There might be more parameters to return after this one. */\r
configASSERT( pcParameter );\r
\r
/* There are only two valid parameter values. */\r
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
{\r
/* Start or restart the trace. */\r
vTraceStop();\r
\r
sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
}\r
- else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
+ else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
{\r
/* End the trace, if one is running. */\r
vTraceStop();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
extern void vRegisterSampleCLICommands( void );\r
\r
/*\r
- * Configure the UART used for IO.and register prvUARTRxNotificationHandler() \r
+ * Configure the UART used for IO.and register prvUARTRxNotificationHandler()\r
* to handle UART Rx events.\r
*/\r
static void prvConfigureUART( struct usart_module *pxCDCUsart );\r
\r
/*\r
- * Callback functions registered with the Atmel UART driver. Both functions \r
- * just 'give' a semaphore to unblock a task that may be waiting for a \r
+ * Callback functions registered with the Atmel UART driver. Both functions\r
+ * just 'give' a semaphore to unblock a task that may be waiting for a\r
* character to be received, or a transmission to complete.\r
*/\r
static void prvUARTTxNotificationHandler( const struct usart_module *const pxUSART );\r
void vUARTCommandConsoleStart( uint16_t usStackSize, unsigned portBASE_TYPE uxPriority )\r
{\r
vRegisterSampleCLICommands();\r
- \r
+\r
/* Create that task that handles the console itself. */\r
xTaskCreate( prvUARTCommandConsoleTask, /* The task that implements the command console. */\r
"CLI", /* Text name assigned to the task. This is just to assist debugging. The kernel does not use this name itself. */\r
pcOutputString = FreeRTOS_CLIGetOutputBuffer();\r
\r
/* Send the welcome message. */\r
- prvSendBuffer( &xCDCUsart, pcWelcomeMessage, strlen( ( char * ) pcWelcomeMessage ) );\r
+ prvSendBuffer( &xCDCUsart, pcWelcomeMessage, strlen( pcWelcomeMessage ) );\r
\r
for( ;; )\r
{\r
/* Wait for the next character to arrive. A semaphore is used to\r
ensure no CPU time is used until data has arrived. */\r
- usart_read_buffer_job( &xCDCUsart, ( uint8_t * ) &cRxedChar, sizeof( cRxedChar ) ); \r
+ usart_read_buffer_job( &xCDCUsart, ( uint8_t * ) &cRxedChar, sizeof( cRxedChar ) );\r
if( xSemaphoreTake( xRxCompleteSemaphore, portMAX_DELAY ) == pdPASS )\r
{\r
/* Echo the character back. */\r
if( ucInputIndex == 0 )\r
{\r
/* Copy the last command back into the input string. */\r
- strcpy( ( char * ) cInputString, ( char * ) cLastInputString );\r
+ strcpy( cInputString, cLastInputString );\r
}\r
\r
/* Pass the received command to the command interpreter. The\r
Clear the input string ready to receive the next command. Remember\r
the command that was just processed first in case it is to be\r
processed again. */\r
- strcpy( ( char * ) cLastInputString, ( char * ) cInputString );\r
+ strcpy( cLastInputString, cInputString );\r
ucInputIndex = 0;\r
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
\r
- prvSendBuffer( &xCDCUsart, pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );\r
+ prvSendBuffer( &xCDCUsart, pcEndOfOutputMessage, strlen( pcEndOfOutputMessage ) );\r
}\r
else\r
{\r
const portTickType xBlockMax100ms = 100UL / portTICK_RATE_MS;\r
\r
if( xBufferLength > 0 )\r
- { \r
+ {\r
usart_write_buffer_job( pxCDCUsart, ( uint8_t * ) pcBuffer, xBufferLength );\r
- \r
+\r
/* Wait for the Tx to complete so the buffer can be reused without\r
corrupting the data that is being sent. */\r
xSemaphoreTake( xTxCompleteSemaphore, xBlockMax100ms );\r
without wasting any CPU time. */\r
vSemaphoreCreateBinary( xTxCompleteSemaphore );\r
configASSERT( xTxCompleteSemaphore );\r
- \r
+\r
/* This semaphore is used to allow the task to block for an Rx to complete\r
without wasting any CPU time. */\r
vSemaphoreCreateBinary( xRxCompleteSemaphore );\r
xUARTConfig.pinmux_pad1 = EDBG_CDC_SERCOM_PINMUX_PAD1;\r
xUARTConfig.pinmux_pad2 = EDBG_CDC_SERCOM_PINMUX_PAD2;\r
xUARTConfig.pinmux_pad3 = EDBG_CDC_SERCOM_PINMUX_PAD3;\r
- while( usart_init( pxCDCUsart, EDBG_CDC_MODULE, &xUARTConfig ) != STATUS_OK ) \r
+ while( usart_init( pxCDCUsart, EDBG_CDC_MODULE, &xUARTConfig ) != STATUS_OK )\r
{\r
/* Nothing to do here. Should include a timeout really but this is\r
init code only. */\r
}\r
usart_enable( pxCDCUsart );\r
- \r
+\r
/* Register the driver callbacks. */\r
usart_register_callback( pxCDCUsart, prvUARTTxNotificationHandler, USART_CALLBACK_BUFFER_TRANSMITTED );\r
usart_register_callback( pxCDCUsart, prvUARTRxNotificationHandler, USART_CALLBACK_BUFFER_RECEIVED );\r
--- /dev/null
+[InternetShortcut]\r
+URL=http://www.freertos.org/Atmel_SAM4E_RTOS_Demo.html\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
* executed prior to this project being built. Once it has been executed\r
* remove the #error line below.\r
*/\r
-#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.\r
+//#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.\r
\r
/*\r
* Set configCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
configASSERT( pcParameter );\r
\r
/* Attempt to open the requested file. */\r
- pxFile = f_open( ( const char * ) pcParameter, "r" );\r
+ pxFile = f_open( pcParameter, "r" );\r
}\r
\r
if( pxFile != NULL )\r
configASSERT( pcParameter );\r
\r
/* Attempt to delete the file. */\r
- ucReturned = f_delete( ( const char * ) pcParameter );\r
+ ucReturned = f_delete( pcParameter );\r
\r
if( ucReturned == F_NO_ERROR )\r
{\r
configASSERT( pcDestinationFile );\r
\r
/* Obtain the name of the source file. */\r
- pcSourceFile = FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- 1, /* Return the first parameter. */\r
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcSourceFile = ( char * ) FreeRTOS_CLIGetParameter\r
+ (\r
+ pcCommandString, /* The command string itself. */\r
+ 1, /* Return the first parameter. */\r
+ &xParameterStringLength /* Store the parameter string length. */\r
+ );\r
\r
/* Sanity check something was returned. */\r
configASSERT( pcSourceFile );\r
/* Open the source file, seek past the data that has already been\r
read from the file, read the next block of data, then close the\r
file again so the destination file can be opened. */\r
- pxFile = f_open( ( const char * ) pcSourceFile, "r" );\r
+ pxFile = f_open( pcSourceFile, "r" );\r
if( pxFile != NULL )\r
{\r
f_seek( pxFile, lBytesRead, F_SEEK_SET );\r
\r
/* Open the destination file and write the block of data to the end of\r
the file. */\r
- pxFile = f_open( ( const char * ) pcDestinationFile, "a" );\r
+ pxFile = f_open( pcDestinationFile, "a" );\r
if( pxFile != NULL )\r
{\r
f_write( pxWriteBuffer, lBytesToRead, 1, pxFile );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "In directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );\r
\r
/* Generate the file name. */\r
sprintf( cFileName, "%s.txt", pcDirectory2 );\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "Back in root directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcRoot ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcRoot ) == 0 );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Obtain and print out the working directory. */\r
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );\r
printf( "Back in directory %s\r\n", cRAMBuffer );\r
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );\r
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );\r
\r
/* Generate the file name. */\r
sprintf( cFileName, "%s.txt", pcDirectory2 );\r
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
- vTaskList( ( char * ) pcWriteBuffer + strlen( pcHeader ) );\r
+ strcpy( pcWriteBuffer, pcHeader );\r
+ vTaskList( pcWriteBuffer + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
+ strcpy( pcWriteBuffer, pcHeader );\r
vTaskGetRunTimeStats( ( char * ) pcWriteBuffer + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
\r
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcParameter;\r
+const char *pcParameter;\r
portBASE_TYPE xParameterStringLength, xReturn;\r
static portBASE_TYPE lParameterNumber = 0;\r
\r
{\r
/* The first time the function is called after the command has been\r
entered just a header string is returned. */\r
- sprintf( ( char * ) pcWriteBuffer, "The three parameters were:\r\n" );\r
+ sprintf( pcWriteBuffer, "The three parameters were:\r\n" );\r
\r
/* Next time the function is called the first parameter will be echoed\r
back. */\r
else\r
{\r
/* Obtain the parameter string. */\r
- pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- lParameterNumber, /* Return the next parameter. */\r
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = FreeRTOS_CLIGetParameter\r
+ (\r
+ pcCommandString, /* The command string itself. */\r
+ lParameterNumber, /* Return the next parameter. */\r
+ &xParameterStringLength /* Store the parameter string length. */\r
+ );\r
\r
/* Sanity check something was returned. */\r
configASSERT( pcParameter );\r
\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
- sprintf( ( char * ) pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
- strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+ sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* If this is the last of the three parameters then there are no more\r
strings to return after this one. */\r
\r
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcParameter;\r
+const char *pcParameter;\r
portBASE_TYPE xParameterStringLength, xReturn;\r
static portBASE_TYPE lParameterNumber = 0;\r
\r
{\r
/* The first time the function is called after the command has been\r
entered just a header string is returned. */\r
- sprintf( ( char * ) pcWriteBuffer, "The parameters were:\r\n" );\r
+ sprintf( pcWriteBuffer, "The parameters were:\r\n" );\r
\r
/* Next time the function is called the first parameter will be echoed\r
back. */\r
else\r
{\r
/* Obtain the parameter string. */\r
- pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- lParameterNumber, /* Return the next parameter. */\r
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = FreeRTOS_CLIGetParameter\r
+ (\r
+ pcCommandString, /* The command string itself. */\r
+ lParameterNumber, /* Return the next parameter. */\r
+ &xParameterStringLength /* Store the parameter string length. */\r
+ );\r
\r
if( pcParameter != NULL )\r
{\r
/* Return the parameter string. */\r
memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
- sprintf( ( char * ) pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
- strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
- strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+ sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
+ strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
\r
/* There might be more parameters to return after this one. */\r
xReturn = pdTRUE;\r
\r
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
- int8_t *pcParameter;\r
+ const char *pcParameter;\r
portBASE_TYPE lParameterStringLength;\r
\r
/* Remove compile time warnings about unused parameters, and check the\r
configASSERT( pcWriteBuffer );\r
\r
/* Obtain the parameter string. */\r
- pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- 1, /* Return the first parameter. */\r
- &lParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = FreeRTOS_CLIGetParameter\r
+ (\r
+ pcCommandString, /* The command string itself. */\r
+ 1, /* Return the first parameter. */\r
+ &lParameterStringLength /* Store the parameter string length. */\r
+ );\r
\r
/* Sanity check something was returned. */\r
configASSERT( pcParameter );\r
\r
/* There are only two valid parameter values. */\r
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
{\r
/* Start or restart the trace. */\r
vTraceStop();\r
vTraceClear();\r
vTraceStart();\r
\r
- sprintf( ( char * ) pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
+ sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
}\r
- else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
+ else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
{\r
/* End the trace, if one is running. */\r
vTraceStop();\r
- sprintf( ( char * ) pcWriteBuffer, "Stopping trace recording.\r\n" );\r
+ sprintf( pcWriteBuffer, "Stopping trace recording.\r\n" );\r
}\r
else\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );\r
+ sprintf( pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );\r
}\r
\r
/* There is no more data to return after this single string, so return\r
pcOutputString = FreeRTOS_CLIGetOutputBuffer();\r
\r
/* Send the welcome message. */\r
- prvSendBuffer( pcWelcomeMessage, strlen( ( char * ) pcWelcomeMessage ) );\r
+ prvSendBuffer( pcWelcomeMessage, strlen( pcWelcomeMessage ) );\r
\r
for( ;; )\r
{\r
if( cRxedChar == '\n' || cRxedChar == '\r' )\r
{\r
/* Just to space the output from the input. */\r
- prvSendBuffer( pcNewLine, strlen( ( char * ) pcNewLine ) );\r
+ prvSendBuffer( pcNewLine, strlen( pcNewLine ) );\r
\r
/* See if the command is empty, indicating that the last command is\r
to be executed again. */\r
if( cInputIndex == 0 )\r
{\r
/* Copy the last command back into the input string. */\r
- strcpy( ( char * ) cInputString, ( char * ) cLastInputString );\r
+ strcpy( cInputString, cLastInputString );\r
}\r
\r
/* Pass the received command to the command interpreter. The\r
Clear the input string ready to receive the next command. Remember\r
the command that was just processed first in case it is to be\r
processed again. */\r
- strcpy( ( char * ) cLastInputString, ( char * ) cInputString );\r
+ strcpy( cLastInputString, cInputString );\r
cInputIndex = 0;\r
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
\r
- prvSendBuffer( pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );\r
+ prvSendBuffer( pcEndOfOutputMessage, strlen( pcEndOfOutputMessage ) );\r
}\r
else\r
{\r