/*\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
/*\r
* Print out information on a single file.\r
*/\r
-static void prvCreateFileInfoString( int8_t *pcBuffer, F_FIND *pxFindStruct );\r
+static void prvCreateFileInfoString( char *pcBuffer, F_FIND *pxFindStruct );\r
\r
/*\r
* Copies an existing file into a newly created file.\r
*/\r
-static portBASE_TYPE prvPerformCopy( int8_t *pcSourceFile,\r
- int32_t lSourceFileLength,\r
- int8_t *pcDestinationFile,\r
- int8_t *pxWriteBuffer,\r
- size_t xWriteBufferLen );\r
+static portBASE_TYPE prvPerformCopy( char *pcSourceFile,\r
+ int32_t lSourceFileLength,\r
+ char *pcDestinationFile,\r
+ char *pxWriteBuffer,\r
+ size_t xWriteBufferLen );\r
\r
/*\r
* Implements the DIR command.\r
*/\r
-static portBASE_TYPE prvDIRCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the CD command.\r
*/\r
-static portBASE_TYPE prvCDCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the DEL command.\r
*/\r
-static portBASE_TYPE prvDELCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the TYPE command.\r
*/\r
-static portBASE_TYPE prvTYPECommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the COPY command.\r
*/\r
-static portBASE_TYPE prvCOPYCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Registers the CLI commands that are specific to the files system with the\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvTYPECommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcParameter;\r
+const char *pcParameter;\r
portBASE_TYPE xParameterStringLength, xReturn = pdTRUE;\r
static F_FILE *pxFile = NULL;\r
int iChar;\r
if( pxFile == NULL )\r
{\r
/* The file has not been opened yet. Find the file name. */\r
- pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- 1, /* Return the first parameter. */\r
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = 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( pcParameter );\r
}\r
else\r
{\r
- pcWriteBuffer[ xByte ] = ( int8_t ) iChar;\r
+ pcWriteBuffer[ xByte ] = ( char ) iChar;\r
}\r
}\r
}\r
xReturn = pdFALSE;\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvCDCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcParameter;\r
+const char *pcParameter;\r
portBASE_TYPE xParameterStringLength;\r
unsigned char ucReturned;\r
size_t xStringLength;\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
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = 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( pcParameter );\r
\r
/* Attempt to move to the requested directory. */\r
- ucReturned = f_chdir( ( char * ) pcParameter );\r
+ ucReturned = f_chdir( pcParameter );\r
\r
if( ucReturned == F_NO_ERROR )\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "In: " );\r
- xStringLength = strlen( ( const char * ) pcWriteBuffer );\r
- f_getcwd( ( char * ) &( pcWriteBuffer[ xStringLength ] ), ( unsigned char ) ( xWriteBufferLen - xStringLength ) );\r
+ sprintf( pcWriteBuffer, "In: " );\r
+ xStringLength = strlen( pcWriteBuffer );\r
+ f_getcwd( &( pcWriteBuffer[ xStringLength ] ), ( unsigned char ) ( xWriteBufferLen - xStringLength ) );\r
}\r
else\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Error" );\r
+ sprintf( pcWriteBuffer, "Error" );\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return pdFALSE;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvDIRCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
static F_FIND *pxFindStruct = NULL;\r
unsigned char ucReturned;\r
}\r
else\r
{\r
- snprintf( ( char * ) pcWriteBuffer, xWriteBufferLen, "Error: f_findfirst() failed." );\r
+ snprintf( pcWriteBuffer, xWriteBufferLen, "Error: f_findfirst() failed." );\r
}\r
}\r
else\r
{\r
- snprintf( ( char * ) pcWriteBuffer, xWriteBufferLen, "Failed to allocate RAM (using heap_4.c will prevent fragmentation)." );\r
+ snprintf( pcWriteBuffer, xWriteBufferLen, "Failed to allocate RAM (using heap_4.c will prevent fragmentation)." );\r
}\r
}\r
else\r
}\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvDELCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcParameter;\r
+const char *pcParameter;\r
portBASE_TYPE xParameterStringLength;\r
unsigned char ucReturned;\r
\r
( void ) xWriteBufferLen;\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
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = 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( pcParameter );\r
\r
if( ucReturned == F_NO_ERROR )\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "%s was deleted", pcParameter );\r
+ sprintf( pcWriteBuffer, "%s was deleted", pcParameter );\r
}\r
else\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Error" );\r
+ sprintf( pcWriteBuffer, "Error" );\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return pdFALSE;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvCOPYCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcSourceFile, *pcDestinationFile;\r
+char *pcSourceFile, *pcDestinationFile;\r
portBASE_TYPE xParameterStringLength;\r
long lSourceLength, lDestinationLength = 0;\r
\r
/* Obtain the name of the destination file. */\r
- pcDestinationFile = ( int8_t * ) 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 = ( int8_t * ) 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
\r
if( lSourceLength == 0 )\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Source file does not exist" );\r
+ sprintf( pcWriteBuffer, "Source file does not exist" );\r
}\r
else\r
{\r
\r
if( lDestinationLength != 0 )\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Error: Destination file already exists" );\r
+ sprintf( pcWriteBuffer, "Error: Destination file already exists" );\r
}\r
}\r
\r
{\r
if( prvPerformCopy( pcSourceFile, lSourceLength, pcDestinationFile, pcWriteBuffer, xWriteBufferLen ) == pdPASS )\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Copy made" );\r
+ sprintf( pcWriteBuffer, "Copy made" );\r
}\r
else\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Error during copy" );\r
+ sprintf( pcWriteBuffer, "Error during copy" );\r
}\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return pdFALSE;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvPerformCopy( int8_t *pcSourceFile,\r
- int32_t lSourceFileLength,\r
- int8_t *pcDestinationFile,\r
- int8_t *pxWriteBuffer,\r
- size_t xWriteBufferLen )\r
+static portBASE_TYPE prvPerformCopy( char *pcSourceFile,\r
+ int32_t lSourceFileLength,\r
+ char *pcDestinationFile,\r
+ char *pxWriteBuffer,\r
+ size_t xWriteBufferLen )\r
{\r
int32_t lBytesRead = 0, lBytesToRead, lBytesRemaining;\r
F_FILE *pxFile;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvCreateFileInfoString( int8_t *pcBuffer, F_FIND *pxFindStruct )\r
+static void prvCreateFileInfoString( char *pcBuffer, F_FIND *pxFindStruct )\r
{\r
const char *pcWritableFile = "writable file", *pcReadOnlyFile = "read only file", *pcDirectory = "directory";\r
const char * pcAttrib;\r
\r
/* Create a string that includes the file name, the file size and the\r
attributes string. */\r
- sprintf( ( char * ) pcBuffer, "%s [%s] [size=%d]", pxFindStruct->filename, pcAttrib, pxFindStruct->filesize );\r
+ sprintf( pcBuffer, "%s [%s] [size=%d]", pxFindStruct->filename, pcAttrib, pxFindStruct->filesize );\r
}\r
/*\r
* Implements the run-time-stats command.\r
*/\r
-static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the task-stats command.\r
*/\r
-static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the echo-three-parameters command.\r
*/\r
-static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the echo-parameters command.\r
*/\r
-static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Registers the CLI commands defined within this file with the FreeRTOS+CLI\r
* Implements the "trace start" and "trace stop" commands;\r
*/\r
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
- static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+ static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
#endif\r
\r
/* Structure that defines the "run-time-stats" command line command. This\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";\r
\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
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";\r
\r
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
- vTaskGetRunTimeStats( ( ( char * ) pcWriteBuffer ) + strlen( pcHeader ) );\r
+ strcpy( pcWriteBuffer, pcHeader );\r
+ vTaskGetRunTimeStats( pcWriteBuffer + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\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
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\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
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
\r
- static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+ static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
- int8_t *pcParameter;\r
+ 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
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
{\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
/*-----------------------------------------------------------*/\r
\r
/* Const messages output by the command console. */\r
-static const signed char * const pcWelcomeMessage = "FreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>";\r
-static const signed char * const pcEndOfOutputMessage = "\r\n[Press ENTER to execute the previous command again]\r\n>";\r
-static const signed char * const pcNewLine = "\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 prvUARTCommandConsoleTask( 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, cInputIndex = 0, *pcOutputString;\r
+static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];\r
portBASE_TYPE xReturned;\r
\r
( void ) pvParameters;\r
pcOutputString = FreeRTOS_CLIGetOutputBuffer();\r
\r
/* Send the welcome message. */\r
- vSerialPutString( NULL, pcWelcomeMessage, strlen( ( char * ) pcWelcomeMessage ) );\r
+ vSerialPutString( NULL, ( const signed char * ) pcWelcomeMessage, strlen( ( char * ) pcWelcomeMessage ) );\r
\r
for( ;; )\r
{\r
/* Only interested in reading one character at a time. */\r
- while( xSerialGetChar( NULL, &cRxedChar, portMAX_DELAY ) == pdFALSE );\r
+ while( xSerialGetChar( NULL, ( signed char * ) &cRxedChar, portMAX_DELAY ) == pdFALSE );\r
\r
/* Echo the character back. */\r
xSerialPutChar( NULL, cRxedChar, portMAX_DELAY );\r
if( cRxedChar == '\n' || cRxedChar == '\r' )\r
{\r
/* Just to space the output from the input. */\r
- vSerialPutString( NULL, pcNewLine, strlen( ( char * ) pcNewLine ) );\r
+ vSerialPutString( NULL, ( const signed char * ) pcNewLine, strlen( ( char * ) pcNewLine ) );\r
\r
/* See if the command is empty, indicating that the last command is\r
to be executed again. */\r
xReturned = FreeRTOS_CLIProcessCommand( cInputString, pcOutputString, configCOMMAND_INT_MAX_OUTPUT_SIZE );\r
\r
/* Write the generated string to the UART. */\r
- vSerialPutString( NULL, pcOutputString, strlen( ( char * ) pcOutputString ) );\r
+ vSerialPutString( NULL, ( const signed char * ) pcOutputString, strlen( ( char * ) pcOutputString ) );\r
\r
} while( xReturned != pdFALSE );\r
\r
strcpy( ( char * ) cLastInputString, ( char * ) cInputString );\r
cInputIndex = 0;\r
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
- vSerialPutString( NULL, pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );\r
+ vSerialPutString( NULL, ( const signed char * ) pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );\r
}\r
else\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
\r
/* Create the queues used to hold Rx/Tx characters. Note the comments at\r
the top of this file regarding the use of queues in this manner. */\r
- xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) );\r
- xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) );\r
+ xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) );\r
+ xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( char ) );\r
\r
/* If the queues were created correctly then setup the serial port\r
hardware. */\r
\r
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength )\r
{\r
-signed char *pxNext;\r
+char *pxNext;\r
\r
/* A couple of parameters that this port does not use. */\r
( void ) usStringLength;\r
( void ) pxPort;\r
\r
/* Send each character in the string, one at a time. */\r
- pxNext = ( signed char * ) pcString;\r
+ pxNext = ( char * ) pcString;\r
while( *pxNext )\r
{\r
xSerialPutChar( pxPort, *pxNext, portMAX_DELAY );\r
/*\r
* Implements the run-time-stats command.\r
*/\r
-static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the task-stats command.\r
*/\r
-static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the echo-three-parameters command.\r
*/\r
-static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the echo-parameters command.\r
*/\r
-static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the "trace start" and "trace stop" commands;\r
*/\r
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
- static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+ static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
#endif\r
\r
/* Structure that defines the "run-time-stats" command line command. This\r
generates a table that shows how much run time each task has */\r
static const CLI_Command_Definition_t xRunTimeStats =\r
{\r
- ( const int8_t * const ) "run-time-stats", /* The command string to type. */\r
- ( const int8_t * const ) "\r\nrun-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n",\r
+ "run-time-stats", /* The command string to type. */\r
+ "\r\nrun-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n",\r
prvRunTimeStatsCommand, /* The function to run. */\r
0 /* No parameters are expected. */\r
};\r
a table that gives information on each task in the system. */\r
static const CLI_Command_Definition_t xTaskStats =\r
{\r
- ( const int8_t * const ) "task-stats", /* The command string to type. */\r
- ( const int8_t * const ) "\r\ntask-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n",\r
+ "task-stats", /* The command string to type. */\r
+ "\r\ntask-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n",\r
prvTaskStatsCommand, /* The function to run. */\r
0 /* No parameters are expected. */\r
};\r
time. */\r
static const CLI_Command_Definition_t xThreeParameterEcho =\r
{\r
- ( const int8_t * const ) "echo-3-parameters",\r
- ( const int8_t * const ) "\r\necho-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n",\r
+ "echo-3-parameters",\r
+ "\r\necho-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n",\r
prvThreeParameterEchoCommand, /* The function to run. */\r
3 /* Three parameters are expected, which can take any value. */\r
};\r
a time. */\r
static const CLI_Command_Definition_t xParameterEcho =\r
{\r
- ( const int8_t * const ) "echo-parameters",\r
- ( const int8_t * const ) "\r\necho-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n",\r
+ "echo-parameters",\r
+ "\r\necho-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n",\r
prvParameterEchoCommand, /* The function to run. */\r
-1 /* The user can enter any number of commands. */\r
};\r
parameter, which can be either "start" or "stop". */\r
static const CLI_Command_Definition_t xStartStopTrace =\r
{\r
- ( const int8_t * const ) "trace",\r
- ( const int8_t * const ) "\r\ntrace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n",\r
+ "trace",\r
+ "\r\ntrace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n",\r
prvStartStopTraceCommand, /* The function to run. */\r
1 /* One parameter is expected. Valid values are "start" and "stop". */\r
};\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";\r
\r
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
- vTaskList( ( char * ) pcWriteBuffer + strlen( ( char * ) 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
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";\r
\r
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
- vTaskGetRunTimeStats( ( char * ) pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+ strcpy( pcWriteBuffer, pcHeader );\r
+ vTaskGetRunTimeStats( pcWriteBuffer + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\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
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\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, ( const char * ) 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
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
\r
- static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\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
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
{\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
* Ensure a previous interrupt driven Tx has completed before sending the next\r
* data block to the UART.\r
*/\r
-static void prvSendBuffer( struct usart_module *pxCDCUsart, uint8_t * pcBuffer, size_t xBufferLength );\r
+static void prvSendBuffer( struct usart_module *pxCDCUsart, const char * pcBuffer, size_t xBufferLength );\r
\r
/*\r
* Register the 'standard' sample CLI commands with FreeRTOS+CLI.\r
/*-----------------------------------------------------------*/\r
\r
/* Const messages output by the command console. */\r
-static uint8_t * const pcWelcomeMessage = ( uint8_t * ) "\r\n\r\nFreeRTOS 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 char * const pcWelcomeMessage = "\r\n\r\nFreeRTOS 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
/* This semaphore is used to allow the task to wait for a Tx to complete\r
without wasting any CPU time. */\r
\r
static void prvUARTCommandConsoleTask( void *pvParameters )\r
{\r
-uint8_t ucRxedChar, ucInputIndex = 0, *pucOutputString;\r
-static int8_t cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];\r
+char cRxedChar, *pcOutputString;\r
+uint8_t ucInputIndex = 0;\r
+static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];\r
portBASE_TYPE xReturned;\r
static struct usart_module xCDCUsart; /* Static so it doesn't take up too much stack. */\r
\r
/* Obtain the address of the output buffer. Note there is no mutual\r
exclusion on this buffer as it is assumed only one command console\r
interface will be used at any one time. */\r
- pucOutputString = ( uint8_t * ) FreeRTOS_CLIGetOutputBuffer();\r
+ pcOutputString = FreeRTOS_CLIGetOutputBuffer();\r
\r
/* Send the welcome message. */\r
prvSendBuffer( &xCDCUsart, pcWelcomeMessage, strlen( ( char * ) pcWelcomeMessage ) );\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, &ucRxedChar, sizeof( ucRxedChar ) ); \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
- prvSendBuffer( &xCDCUsart, ( uint8_t * ) &ucRxedChar, sizeof( ucRxedChar ) );\r
+ prvSendBuffer( &xCDCUsart, &cRxedChar, sizeof( cRxedChar ) );\r
\r
/* Was it the end of the line? */\r
- if( ucRxedChar == '\n' || ucRxedChar == '\r' )\r
+ if( cRxedChar == '\n' || cRxedChar == '\r' )\r
{\r
/* Just to space the output from the input. */\r
- prvSendBuffer( &xCDCUsart, ( uint8_t * ) pcNewLine, strlen( ( char * ) pcNewLine ) );\r
+ prvSendBuffer( &xCDCUsart, pcNewLine, strlen( pcNewLine ) );\r
\r
/* See if the command is empty, indicating that the last command is\r
to be executed again. */\r
do\r
{\r
/* Get the next output string from the command interpreter. */\r
- xReturned = FreeRTOS_CLIProcessCommand( cInputString, ( int8_t * ) pucOutputString, configCOMMAND_INT_MAX_OUTPUT_SIZE );\r
+ xReturned = FreeRTOS_CLIProcessCommand( cInputString, pcOutputString, configCOMMAND_INT_MAX_OUTPUT_SIZE );\r
\r
/* Write the generated string to the UART. */\r
- prvSendBuffer( &xCDCUsart, ( uint8_t * ) pucOutputString, strlen( ( char * ) pucOutputString ) );\r
+ prvSendBuffer( &xCDCUsart, pcOutputString, strlen( pcOutputString ) );\r
\r
} while( xReturned != pdFALSE );\r
\r
ucInputIndex = 0;\r
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
\r
- prvSendBuffer( &xCDCUsart, ( uint8_t * ) pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );\r
+ prvSendBuffer( &xCDCUsart, pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );\r
}\r
else\r
{\r
- if( ucRxedChar == '\r' )\r
+ if( cRxedChar == '\r' )\r
{\r
/* Ignore the character. */\r
}\r
- else if( ( ucRxedChar == '\b' ) || ( ucRxedChar == cmdASCII_DEL ) )\r
+ else if( ( cRxedChar == '\b' ) || ( cRxedChar == cmdASCII_DEL ) )\r
{\r
/* Backspace was pressed. Erase the last character in the\r
string - if any. */\r
/* A character was entered. Add it to the string\r
entered so far. When a \n is entered the complete\r
string will be passed to the command interpreter. */\r
- if( ( ucRxedChar >= ' ' ) && ( ucRxedChar <= '~' ) )\r
+ if( ( cRxedChar >= ' ' ) && ( cRxedChar <= '~' ) )\r
{\r
if( ucInputIndex < cmdMAX_INPUT_SIZE )\r
{\r
- cInputString[ ucInputIndex ] = ucRxedChar;\r
+ cInputString[ ucInputIndex ] = cRxedChar;\r
ucInputIndex++;\r
}\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvSendBuffer( struct usart_module *pxCDCUsart, uint8_t * pcBuffer, size_t xBufferLength )\r
+static void prvSendBuffer( struct usart_module *pxCDCUsart, const char * pcBuffer, size_t xBufferLength )\r
{\r
const portTickType xBlockMax100ms = 100UL / portTICK_RATE_MS;\r
\r
if( xBufferLength > 0 )\r
{ \r
- usart_write_buffer_job( pxCDCUsart, pcBuffer, xBufferLength );\r
+ usart_write_buffer_job( pxCDCUsart, ( uint8_t * ) pcBuffer, xBufferLength );\r
\r
/* Wait for the Tx to complete so the buffer can be reused without\r
corrupting the data that is being sent. */\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
/*\r
* Print out information on a single file.\r
*/\r
-static void prvCreateFileInfoString( int8_t *pcBuffer, F_FIND *pxFindStruct );\r
+static void prvCreateFileInfoString( char *pcBuffer, F_FIND *pxFindStruct );\r
\r
/*\r
* Copies an existing file into a newly created file.\r
*/\r
-static portBASE_TYPE prvPerformCopy( int8_t *pcSourceFile,\r
- int32_t lSourceFileLength,\r
- int8_t *pcDestinationFile,\r
- int8_t *pxWriteBuffer,\r
- size_t xWriteBufferLen );\r
+static portBASE_TYPE prvPerformCopy( const char *pcSourceFile,\r
+ int32_t lSourceFileLength,\r
+ const char *pcDestinationFile,\r
+ char *pxWriteBuffer,\r
+ size_t xWriteBufferLen );\r
\r
/*\r
* Implements the DIR command.\r
*/\r
-static portBASE_TYPE prvDIRCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the CD command.\r
*/\r
-static portBASE_TYPE prvCDCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the DEL command.\r
*/\r
-static portBASE_TYPE prvDELCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the TYPE command.\r
*/\r
-static portBASE_TYPE prvTYPECommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the COPY command.\r
*/\r
-static portBASE_TYPE prvCOPYCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/* Structure that defines the DIR command line command, which lists all the\r
files in the current directory. */\r
static const CLI_Command_Definition_t xDIR =\r
{\r
- ( const int8_t * const ) "dir", /* The command string to type. */\r
- ( const int8_t * const ) "\r\ndir:\r\n Lists the files in the current directory\r\n",\r
+ "dir", /* The command string to type. */\r
+ "\r\ndir:\r\n Lists the files in the current directory\r\n",\r
prvDIRCommand, /* The function to run. */\r
0 /* No parameters are expected. */\r
};\r
working directory. */\r
static const CLI_Command_Definition_t xCD =\r
{\r
- ( const int8_t * const ) "cd", /* The command string to type. */\r
- ( const int8_t * const ) "\r\ncd <dir name>:\r\n Changes the working directory\r\n",\r
+ "cd", /* The command string to type. */\r
+ "\r\ncd <dir name>:\r\n Changes the working directory\r\n",\r
prvCDCommand, /* The function to run. */\r
1 /* One parameter is expected. */\r
};\r
contents of a file to the console. */\r
static const CLI_Command_Definition_t xTYPE =\r
{\r
- ( const int8_t * const ) "type", /* The command string to type. */\r
- ( const int8_t * const ) "\r\ntype <filename>:\r\n Prints file contents to the terminal\r\n",\r
+ "type", /* The command string to type. */\r
+ "\r\ntype <filename>:\r\n Prints file contents to the terminal\r\n",\r
prvTYPECommand, /* The function to run. */\r
1 /* One parameter is expected. */\r
};\r
/* Structure that defines the DEL command line command, which deletes a file. */\r
static const CLI_Command_Definition_t xDEL =\r
{\r
- ( const int8_t * const ) "del", /* The command string to type. */\r
- ( const int8_t * const ) "\r\ndel <filename>:\r\n deletes a file or directory\r\n",\r
+ "del", /* The command string to type. */\r
+ "\r\ndel <filename>:\r\n deletes a file or directory\r\n",\r
prvDELCommand, /* The function to run. */\r
1 /* One parameter is expected. */\r
};\r
/* Structure that defines the COPY command line command, which deletes a file. */\r
static const CLI_Command_Definition_t xCOPY =\r
{\r
- ( const int8_t * const ) "copy", /* The command string to type. */\r
- ( const int8_t * const ) "\r\ncopy <source file> <dest file>:\r\n Copies <source file> to <dest file>\r\n",\r
+ "copy", /* The command string to type. */\r
+ "\r\ncopy <source file> <dest file>:\r\n Copies <source file> to <dest file>\r\n",\r
prvCOPYCommand, /* The function to run. */\r
2 /* Two parameters are expected. */\r
};\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvTYPECommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcParameter;\r
+const char *pcParameter;\r
portBASE_TYPE xParameterStringLength, xReturn = pdTRUE;\r
static F_FILE *pxFile = NULL;\r
int iChar;\r
if( pxFile == NULL )\r
{\r
/* The file has not been opened yet. Find the file name. */\r
- pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
- (\r
- pcCommandString, /* The command string itself. */\r
- 1, /* Return the first parameter. */\r
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = 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( pcParameter );\r
}\r
else\r
{\r
- pcWriteBuffer[ xByte ] = ( int8_t ) iChar;\r
+ pcWriteBuffer[ xByte ] = ( char ) iChar;\r
}\r
}\r
}\r
xReturn = pdFALSE;\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvCDCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcParameter;\r
+const char *pcParameter;\r
portBASE_TYPE xParameterStringLength;\r
unsigned char ucReturned;\r
size_t xStringLength;\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
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = 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( pcParameter );\r
\r
/* Attempt to move to the requested directory. */\r
- ucReturned = f_chdir( ( char * ) pcParameter );\r
+ ucReturned = f_chdir( pcParameter );\r
\r
if( ucReturned == F_NO_ERROR )\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "In: " );\r
- xStringLength = strlen( ( const char * ) pcWriteBuffer );\r
- f_getcwd( ( char * ) &( pcWriteBuffer[ xStringLength ] ), ( unsigned char ) ( xWriteBufferLen - xStringLength ) );\r
+ sprintf( pcWriteBuffer, "In: " );\r
+ xStringLength = strlen( pcWriteBuffer );\r
+ f_getcwd( &( pcWriteBuffer[ xStringLength ] ), ( unsigned char ) ( xWriteBufferLen - xStringLength ) );\r
}\r
else\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Error" );\r
+ sprintf( pcWriteBuffer, "Error" );\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return pdFALSE;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvDIRCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
static F_FIND *pxFindStruct = NULL;\r
unsigned char ucReturned;\r
}\r
else\r
{\r
- snprintf( ( char * ) pcWriteBuffer, xWriteBufferLen, "Error: f_findfirst() failed." );\r
+ snprintf( pcWriteBuffer, xWriteBufferLen, "Error: f_findfirst() failed." );\r
}\r
}\r
else\r
{\r
- snprintf( ( char * ) pcWriteBuffer, xWriteBufferLen, "Failed to allocate RAM (using heap_4.c will prevent fragmentation)." );\r
+ snprintf( pcWriteBuffer, xWriteBufferLen, "Failed to allocate RAM (using heap_4.c will prevent fragmentation)." );\r
}\r
}\r
else\r
}\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvDELCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcParameter;\r
+const char *pcParameter;\r
portBASE_TYPE xParameterStringLength;\r
unsigned char ucReturned;\r
\r
( void ) xWriteBufferLen;\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
- &xParameterStringLength /* Store the parameter string length. */\r
- );\r
+ pcParameter = 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( pcParameter );\r
\r
if( ucReturned == F_NO_ERROR )\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "%s was deleted", pcParameter );\r
+ sprintf( pcWriteBuffer, "%s was deleted", pcParameter );\r
}\r
else\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Error" );\r
+ sprintf( pcWriteBuffer, "Error" );\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return pdFALSE;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvCOPYCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
-int8_t *pcSourceFile, *pcDestinationFile;\r
+const char *pcDestinationFile;\r
+char *pcSourceFile;\r
portBASE_TYPE xParameterStringLength;\r
long lSourceLength, lDestinationLength = 0;\r
\r
/* Obtain the name of the destination file. */\r
- pcDestinationFile = ( int8_t * ) 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 = 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 = ( int8_t * ) 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 = 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
- sprintf( ( char * ) pcWriteBuffer, "Source file does not exist" );\r
+ sprintf( pcWriteBuffer, "Source file does not exist" );\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
- sprintf( ( char * ) pcWriteBuffer, "Error: Destination file already exists" );\r
+ sprintf( pcWriteBuffer, "Error: Destination file already exists" );\r
}\r
}\r
\r
{\r
if( prvPerformCopy( pcSourceFile, lSourceLength, pcDestinationFile, pcWriteBuffer, xWriteBufferLen ) == pdPASS )\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Copy made" );\r
+ sprintf( pcWriteBuffer, "Copy made" );\r
}\r
else\r
{\r
- sprintf( ( char * ) pcWriteBuffer, "Error during copy" );\r
+ sprintf( pcWriteBuffer, "Error during copy" );\r
}\r
}\r
\r
- strcat( ( char * ) pcWriteBuffer, cliNEW_LINE );\r
+ strcat( pcWriteBuffer, cliNEW_LINE );\r
\r
return pdFALSE;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvPerformCopy( int8_t *pcSourceFile,\r
- int32_t lSourceFileLength,\r
- int8_t *pcDestinationFile,\r
- int8_t *pxWriteBuffer,\r
- size_t xWriteBufferLen )\r
+static portBASE_TYPE prvPerformCopy( const char *pcSourceFile,\r
+ int32_t lSourceFileLength,\r
+ const char *pcDestinationFile,\r
+ char *pxWriteBuffer,\r
+ size_t xWriteBufferLen )\r
{\r
int32_t lBytesRead = 0, lBytesToRead, lBytesRemaining;\r
F_FILE *pxFile;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvCreateFileInfoString( int8_t *pcBuffer, F_FIND *pxFindStruct )\r
+static void prvCreateFileInfoString( char *pcBuffer, F_FIND *pxFindStruct )\r
{\r
const char *pcWritableFile = "writable file", *pcReadOnlyFile = "read only file", *pcDirectory = "directory";\r
const char * pcAttrib;\r
\r
/* Create a string that includes the file name, the file size and the\r
attributes string. */\r
- sprintf( ( char * ) pcBuffer, "%s [%s] [size=%d]", pxFindStruct->filename, pcAttrib, ( int ) pxFindStruct->filesize );\r
+ sprintf( pcBuffer, "%s [%s] [size=%d]", pxFindStruct->filename, pcAttrib, ( int ) pxFindStruct->filesize );\r
}\r
/*\r
* Implements the run-time-stats command.\r
*/\r
-static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the task-stats command.\r
*/\r
-static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the echo-three-parameters command.\r
*/\r
-static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the echo-parameters command.\r
*/\r
-static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
\r
/*\r
* Implements the "trace start" and "trace stop" commands;\r
*/\r
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
- static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+ static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
#endif\r
\r
/* Structure that defines the "run-time-stats" command line command. This\r
generates a table that shows how much run time each task has */\r
static const CLI_Command_Definition_t xRunTimeStats =\r
{\r
- ( const int8_t * const ) "run-time-stats", /* The command string to type. */\r
- ( const int8_t * const ) "\r\nrun-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n",\r
+ "run-time-stats", /* The command string to type. */\r
+ "\r\nrun-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n",\r
prvRunTimeStatsCommand, /* The function to run. */\r
0 /* No parameters are expected. */\r
};\r
a table that gives information on each task in the system. */\r
static const CLI_Command_Definition_t xTaskStats =\r
{\r
- ( const int8_t * const ) "task-stats", /* The command string to type. */\r
- ( const int8_t * const ) "\r\ntask-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n",\r
+ "task-stats", /* The command string to type. */\r
+ "\r\ntask-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n",\r
prvTaskStatsCommand, /* The function to run. */\r
0 /* No parameters are expected. */\r
};\r
time. */\r
static const CLI_Command_Definition_t xThreeParameterEcho =\r
{\r
- ( const int8_t * const ) "echo-3-parameters",\r
- ( const int8_t * const ) "\r\necho-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n",\r
+ "echo-3-parameters",\r
+ "\r\necho-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n",\r
prvThreeParameterEchoCommand, /* The function to run. */\r
3 /* Three parameters are expected, which can take any value. */\r
};\r
a time. */\r
static const CLI_Command_Definition_t xParameterEcho =\r
{\r
- ( const int8_t * const ) "echo-parameters",\r
- ( const int8_t * const ) "\r\necho-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n",\r
+ "echo-parameters",\r
+ "\r\necho-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n",\r
prvParameterEchoCommand, /* The function to run. */\r
-1 /* The user can enter any number of commands. */\r
};\r
parameter, which can be either "start" or "stop". */\r
static const CLI_Command_Definition_t xStartStopTrace =\r
{\r
- ( const int8_t * const ) "trace",\r
- ( const int8_t * const ) "\r\ntrace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n",\r
+ "trace",\r
+ "\r\ntrace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n",\r
prvStartStopTraceCommand, /* The function to run. */\r
1 /* One parameter is expected. Valid values are "start" and "stop". */\r
};\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
int8_t *pcParameter;\r
portBASE_TYPE xParameterStringLength, xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
int8_t *pcParameter;\r
portBASE_TYPE xParameterStringLength, xReturn;\r
\r
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
\r
- static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+ static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
{\r
int8_t *pcParameter;\r
portBASE_TYPE lParameterStringLength;\r
* Ensure a previous interrupt driven Tx has completed before sending the next\r
* data block to the UART.\r
*/\r
-static void prvSendBuffer( const uint8_t * pcBuffer, size_t xBufferLength );\r
+static void prvSendBuffer( const char * pcBuffer, size_t xBufferLength );\r
\r
/*\r
* A UART is used for printf() output and CLI input and output. Configure the\r
/*-----------------------------------------------------------*/\r
\r
/* Const messages output by the command console. */\r
-static const uint8_t * const pcWelcomeMessage = ( uint8_t * ) "\r\n\r\nFreeRTOS 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 = "\r\n\r\nFreeRTOS 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
/* The UART used by the CLI. */\r
#if configBUILD_FOR_DEVELOPMENT_KIT == 1\r
\r
static void prvUARTCommandConsoleTask( 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, *pcOutputString;\r
+unsigned char cInputIndex = 0;\r
+static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];\r
portBASE_TYPE xReturned;\r
\r
( void ) pvParameters;\r
if( xQueueReceive( xRxedChars, &cRxedChar, portMAX_DELAY ) == pdPASS )\r
{\r
/* Echo the character back. */\r
- prvSendBuffer( ( uint8_t * ) &cRxedChar, sizeof( cRxedChar ) );\r
+ prvSendBuffer( &cRxedChar, sizeof( cRxedChar ) );\r
\r
/* Was it the end of the line? */\r
if( cRxedChar == '\n' || cRxedChar == '\r' )\r
{\r
/* Just to space the output from the input. */\r
- prvSendBuffer( ( uint8_t * ) pcNewLine, strlen( ( char * ) pcNewLine ) );\r
+ prvSendBuffer( pcNewLine, strlen( ( char * ) pcNewLine ) );\r
\r
/* See if the command is empty, indicating that the last command is\r
to be executed again. */\r
xReturned = FreeRTOS_CLIProcessCommand( cInputString, pcOutputString, configCOMMAND_INT_MAX_OUTPUT_SIZE );\r
\r
/* Write the generated string to the UART. */\r
- prvSendBuffer( ( uint8_t * ) pcOutputString, strlen( ( char * ) pcOutputString ) );\r
+ prvSendBuffer( pcOutputString, strlen( pcOutputString ) );\r
\r
} while( xReturned != pdFALSE );\r
\r
cInputIndex = 0;\r
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
\r
- prvSendBuffer( ( uint8_t * ) pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );\r
+ prvSendBuffer( pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );\r
}\r
else\r
{\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvSendBuffer( const uint8_t * pcBuffer, size_t xBufferLength )\r
+static void prvSendBuffer( const char * pcBuffer, size_t xBufferLength )\r
{\r
const portTickType xVeryShortDelay = 2UL;\r
\r
if( xBufferLength > 0 )\r
{\r
- MSS_UART_irq_tx( ( mss_uart_instance_t * ) pxUART, pcBuffer, xBufferLength );\r
+ MSS_UART_irq_tx( ( mss_uart_instance_t * ) pxUART, ( uint8_t * ) pcBuffer, xBufferLength );\r
\r
/* Ensure any previous transmissions have completed. The default UART\r
interrupt does not provide an event based method of signally the end of a Tx\r
\r
static void prvUARTRxNotificationHandler( mss_uart_instance_t * pxUART )\r
{\r
-uint8_t cRxed;\r
+char cRxed;\r
portBASE_TYPE xHigherPriorityTaskWoken;\r
\r
/* The command console receives data very slowly (at the speed of somebody\r
typing), therefore it is ok to just handle one character at a time and use\r
a queue to send the characters to the task. */\r
- if( MSS_UART_get_rx( pxUART, &cRxed, sizeof( cRxed ) ) == sizeof( cRxed ) )\r
+ if( MSS_UART_get_rx( pxUART, ( uint8_t * ) &cRxed, sizeof( cRxed ) ) == sizeof( cRxed ) )\r
{\r
xHigherPriorityTaskWoken = pdFALSE;\r
xQueueSendFromISR( xRxedChars, &cRxed, &xHigherPriorityTaskWoken );\r