]> git.sur5r.net Git - freertos/commitdiff
Update FreeRTOS+ demos that use FreeRTOS+CLI to remove casting to int8_t * from strings.
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 30 Dec 2013 16:07:34 +0000 (16:07 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 30 Dec 2013 16:07:34 +0000 (16:07 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2154 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/File-Related-CLI-commands.c
FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/Sample-CLI-commands.c
FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/UDP-Related-CLI-commands.c
FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/CLI-commands.c
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/CLI-commands.c
FreeRTOS-Plus/Demo/FreeRTOS_Plus_FAT_SL_and_CLI_Windows_Simulator/File-Releated-CLI-commands.c
FreeRTOS-Plus/Demo/FreeRTOS_Plus_FAT_SL_and_CLI_Windows_Simulator/Sample-CLI-commands.c
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CLI-commands.c
FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c
FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h

index d1c9a13cdacd648403b035c115a3da0c274f9730..828d7e26c74b6a28286249cfe7fe3e63101abdf2 100644 (file)
 /*\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
@@ -145,8 +145,8 @@ static const CLI_Command_Definition_t xDIR =
 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
@@ -155,8 +155,8 @@ static const CLI_Command_Definition_t xCD =
 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
@@ -164,8 +164,8 @@ static const CLI_Command_Definition_t xTYPE =
 /* 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
@@ -173,8 +173,8 @@ static const CLI_Command_Definition_t xDEL =
 /* 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
@@ -193,9 +193,9 @@ void vRegisterFileSystemCLICommands( void )
 }\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
@@ -219,12 +219,12 @@ size_t xColumns = 50U;
        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
@@ -249,7 +249,7 @@ size_t xColumns = 50U;
                        }\r
                        else\r
                        {\r
-                               pcWriteBuffer[ xByte ] = ( int8_t ) iChar;\r
+                               pcWriteBuffer[ xByte ] = ( char ) iChar;\r
                        }\r
                }\r
        }\r
@@ -261,51 +261,51 @@ size_t xColumns = 50U;
                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
@@ -335,12 +335,12 @@ portBASE_TYPE xReturn = pdFALSE;
                        }\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
@@ -365,15 +365,15 @@ portBASE_TYPE 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 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
@@ -381,12 +381,12 @@ unsigned char ucReturned;
        ( 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
@@ -396,43 +396,43 @@ unsigned char ucReturned;
 \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 = 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
@@ -445,7 +445,7 @@ long lSourceLength, lDestinationLength = 0;
 \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
@@ -454,7 +454,7 @@ long lSourceLength, lDestinationLength = 0;
 \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
@@ -464,25 +464,25 @@ long lSourceLength, lDestinationLength = 0;
        {\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
@@ -543,7 +543,7 @@ portBASE_TYPE xReturn = pdPASS;
 }\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
@@ -564,5 +564,5 @@ const char * pcAttrib;
 \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
index 7050c65c83dc97f17264695d3e0855febc5e5302..39939347ec5901375f5a6e8b1c0bc5a76eeee2a4 100644 (file)
 /*\r
  * Implements the task-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 run-time-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
@@ -131,8 +131,8 @@ static const CLI_Command_Definition_t xRunTimeStats =
 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
@@ -142,8 +142,8 @@ takes exactly three parameters that the command simply echos back one at a
 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
@@ -153,8 +153,8 @@ takes a variable number of parameters that the command simply echos back one at
 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
@@ -164,8 +164,8 @@ static const CLI_Command_Definition_t xParameterEcho =
        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
@@ -189,9 +189,9 @@ void vRegisterSampleCLICommands( void )
 }\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 int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stack      #\r\n************************************************\r\n";\r
+const char *const pcHeader = "Task          State  Priority  Stack     #\r\n************************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -201,8 +201,8 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
        configASSERT( pcWriteBuffer );\r
 \r
        /* Generate a table of task stats. */\r
-       strcpy( ( char * ) pcWriteBuffer, ( char * ) 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
@@ -210,9 +210,9 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
 }\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 int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Time\r\n****************************************\r\n";\r
+const char * const pcHeader = "Task            Abs Time      % Time\r\n****************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -222,8 +222,8 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
        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
@@ -231,9 +231,9 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
 }\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
@@ -248,7 +248,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -261,21 +261,21 @@ static portBASE_TYPE lParameterNumber = 0;
        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, ( const char * ) 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
@@ -298,9 +298,9 @@ static portBASE_TYPE lParameterNumber = 0;
 }\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
@@ -315,7 +315,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -328,20 +328,20 @@ static portBASE_TYPE lParameterNumber = 0;
        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
@@ -367,9 +367,9 @@ static portBASE_TYPE lParameterNumber = 0;
 \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
@@ -380,12 +380,12 @@ static portBASE_TYPE lParameterNumber = 0;
                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
@@ -398,17 +398,17 @@ static portBASE_TYPE lParameterNumber = 0;
                        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
index 11fe1c41d8b71a2e76ff68e781f61a2706bb1c8f..311e756df000269912e4be5237dda84b60baf00d 100644 (file)
@@ -91,23 +91,23 @@ commands. */
 /*\r
  * Defines a command that prints out IP address information.\r
  */\r
-static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /*\r
  * Defines a command that prints out the gathered demo debug stats.\r
  */\r
-static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /*\r
  * Defines a command that sends an ICMP ping request to an IP address.\r
  */\r
-static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /* Structure that defines the "ip-config" command line command. */\r
 static const CLI_Command_Definition_t xIPConfig =\r
 {\r
-       ( const int8_t * const ) "ip-config",\r
-       ( const int8_t * const ) "ip-config:\r\n Displays IP address configuration\r\n\r\n",\r
+       "ip-config",\r
+       "ip-config:\r\n Displays IP address configuration\r\n\r\n",\r
        prvDisplayIPConfig,\r
        0\r
 };\r
@@ -116,8 +116,8 @@ static const CLI_Command_Definition_t xIPConfig =
        /* Structure that defines the "ip-debug-stats" command line command. */\r
        static const CLI_Command_Definition_t xIPDebugStats =\r
        {\r
-               ( const int8_t * const ) "ip-debug-stats", /* The command string to type. */\r
-               ( const int8_t * const ) "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",\r
+               "ip-debug-stats", /* The command string to type. */\r
+               "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",\r
                prvDisplayIPDebugStats, /* The function to run. */\r
                0 /* No parameters are expected. */\r
        };\r
@@ -130,8 +130,8 @@ static const CLI_Command_Definition_t xIPConfig =
        parameters. */\r
        static const CLI_Command_Definition_t xPing =\r
        {\r
-               ( const int8_t * const ) "ping",\r
-               ( const int8_t * const ) "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",\r
+               "ping",\r
+               "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",\r
                prvPingCommand, /* The function to run. */\r
                -1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */\r
        };\r
@@ -162,13 +162,13 @@ void vRegisterUDPCLICommands( void )
 \r
 #if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
 \r
-       static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
        {\r
-       int8_t * pcParameter;\r
+       const char * pcParameter;\r
        portBASE_TYPE lParameterStringLength, xReturn;\r
        uint32_t ulIPAddress, ulBytesToPing;\r
        const uint32_t ulDefaultBytesToPing = 8UL;\r
-       int8_t cBuffer[ 16 ];\r
+       char cBuffer[ 16 ];\r
 \r
                /* Remove compile time warnings about unused parameters, and check the\r
                write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -181,12 +181,12 @@ void vRegisterUDPCLICommands( void )
                pcWriteBuffer[ 0 ] = 0x00;\r
 \r
                /* Obtain the number of bytes to ping. */\r
-               pcParameter = ( int8_t * ) 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 = 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
@@ -199,12 +199,12 @@ void vRegisterUDPCLICommands( void )
                }\r
 \r
                /* Obtain the IP address 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
@@ -225,7 +225,7 @@ void vRegisterUDPCLICommands( void )
                }\r
 \r
                /* Convert IP address, which may have come from a DNS lookup, to string. */\r
-               FreeRTOS_inet_ntoa( ulIPAddress, ( char * ) cBuffer );\r
+               FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );\r
 \r
                if( ulIPAddress != 0 )\r
                {\r
@@ -238,11 +238,11 @@ void vRegisterUDPCLICommands( void )
 \r
                if( xReturn == pdFALSE )\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "%s", "Could not send ping request\r\n" );\r
+                       sprintf( pcWriteBuffer, "%s", "Could not send ping request\r\n" );\r
                }\r
                else\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, ( int ) xReturn );\r
+                       sprintf( pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, ( int ) xReturn );\r
                }\r
 \r
                return pdFALSE;\r
@@ -253,7 +253,7 @@ void vRegisterUDPCLICommands( void )
 \r
 #if configINCLUDE_DEMO_DEBUG_STATS != 0\r
 \r
-       static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
        {\r
        static portBASE_TYPE xIndex = -1;\r
        extern xExampleDebugStatEntry_t xIPTraceValues[];\r
@@ -270,7 +270,7 @@ void vRegisterUDPCLICommands( void )
 \r
                if( xIndex < xExampleDebugStatEntries() )\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "%s %d\r\n", ( char * ) xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );\r
+                       sprintf( pcWriteBuffer, "%s %d\r\n", ( char * ) xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );\r
                        xReturn = pdPASS;\r
                }\r
                else\r
@@ -289,7 +289,7 @@ void vRegisterUDPCLICommands( void )
 \r
 #endif /* configINCLUDE_DEMO_DEBUG_STATS */\r
 \r
-static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
 {\r
 static portBASE_TYPE xIndex = 0;\r
 portBASE_TYPE xReturn;\r
@@ -306,35 +306,35 @@ uint32_t ulAddress;
        {\r
                case 0 :\r
                        FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nIP address " );\r
+                       sprintf( pcWriteBuffer, "\r\nIP address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 1 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nNet mask " );\r
+                       sprintf( pcWriteBuffer, "\r\nNet mask " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 2 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nGateway address " );\r
+                       sprintf( pcWriteBuffer, "\r\nGateway address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 3 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nDNS server address " );\r
+                       sprintf( pcWriteBuffer, "\r\nDNS server address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                default :\r
                        ulAddress = 0;\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\n\r\n" );\r
+                       sprintf( pcWriteBuffer, "\r\n\r\n" );\r
                        xReturn = pdFALSE;\r
                        xIndex = 0;\r
                        break;\r
@@ -342,7 +342,7 @@ uint32_t ulAddress;
 \r
        if( ulAddress != 0 )\r
        {\r
-               FreeRTOS_inet_ntoa( ulAddress, ( ( char * ) &( pcWriteBuffer[ strlen( ( char * ) pcWriteBuffer ) ] ) ) );\r
+               FreeRTOS_inet_ntoa( ulAddress, ( &( pcWriteBuffer[ strlen( pcWriteBuffer ) ] ) ) );\r
        }\r
 \r
        return xReturn;\r
index 23c9292a6a267dde6ee435fb95d3ba8a08e57862..8446604cb61425aa1a3bf8bc84b694af6b8e4685 100644 (file)
@@ -96,50 +96,50 @@ commands. */
 /*\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
  * Defines a command that prints out IP address information.\r
  */\r
-static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /*\r
  * Defines a command that prints out the gathered demo debug stats.\r
  */\r
-static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /*\r
  * Defines a command that sends an ICMP ping request to an IP address.\r
  */\r
-static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvPingCommand( 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 "ip-config" command line command. */\r
 static const CLI_Command_Definition_t xIPConfig =\r
 {\r
-       ( const int8_t * const ) "ip-config",\r
-       ( const int8_t * const ) "ip-config:\r\n Displays IP address configuration\r\n\r\n",\r
+       "ip-config",\r
+       "ip-config:\r\n Displays IP address configuration\r\n\r\n",\r
        prvDisplayIPConfig,\r
        0\r
 };\r
@@ -148,8 +148,8 @@ static const CLI_Command_Definition_t xIPConfig =
        /* Structure that defines the "ip-debug-stats" command line command. */\r
        static const CLI_Command_Definition_t xIPDebugStats =\r
        {\r
-               ( const int8_t * const ) "ip-debug-stats", /* The command string to type. */\r
-               ( const int8_t * const ) "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",\r
+               "ip-debug-stats", /* The command string to type. */\r
+               "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",\r
                prvDisplayIPDebugStats, /* The function to run. */\r
                0 /* No parameters are expected. */\r
        };\r
@@ -159,8 +159,8 @@ static const CLI_Command_Definition_t xIPConfig =
 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 ) "run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",\r
+       "run-time-stats", /* The command string to type. */\r
+       "run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",\r
        prvRunTimeStatsCommand, /* The function to run. */\r
        0 /* No parameters are expected. */\r
 };\r
@@ -169,8 +169,8 @@ static const CLI_Command_Definition_t xRunTimeStats =
 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 ) "task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",\r
+       "task-stats", /* The command string to type. */\r
+       "task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",\r
        prvTaskStatsCommand, /* The function to run. */\r
        0 /* No parameters are expected. */\r
 };\r
@@ -180,8 +180,8 @@ takes exactly three parameters that the command simply echos back one at a
 time. */\r
 static const CLI_Command_Definition_t xThreeParameterEcho =\r
 {\r
-       ( const int8_t * const ) "echo-3-parameters",\r
-       ( const int8_t * const ) "echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",\r
+       "echo-3-parameters",\r
+       "echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",\r
        prvThreeParameterEchoCommand, /* The function to run. */\r
        3 /* Three parameters are expected, which can take any value. */\r
 };\r
@@ -191,8 +191,8 @@ takes a variable number of parameters that the command simply echos back one at
 a time. */\r
 static const CLI_Command_Definition_t xParameterEcho =\r
 {\r
-       ( const int8_t * const ) "echo-parameters",\r
-       ( const int8_t * const ) "echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",\r
+       "echo-parameters",\r
+       "echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",\r
        prvParameterEchoCommand, /* The function to run. */\r
        -1 /* The user can enter any number of commands. */\r
 };\r
@@ -204,8 +204,8 @@ static const CLI_Command_Definition_t xParameterEcho =
        parameters. */\r
        static const CLI_Command_Definition_t xPing =\r
        {\r
-               ( const int8_t * const ) "ping",\r
-               ( const int8_t * const ) "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",\r
+               "ping",\r
+               "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",\r
                prvPingCommand, /* The function to run. */\r
                -1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */\r
        };\r
@@ -217,8 +217,8 @@ static const CLI_Command_Definition_t xParameterEcho =
        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 ) "trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",\r
+               "trace",\r
+               "trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",\r
                prvStartStopTraceCommand, /* The function to run. */\r
                1 /* One parameter is expected.  Valid values are "start" and "stop". */\r
        };\r
@@ -248,9 +248,9 @@ void vRegisterCLICommands( void )
 }\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 int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stack      #\r\n************************************************\r\n";\r
+const char *const pcHeader = "Task          State  Priority  Stack     #\r\n************************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -260,8 +260,8 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
        configASSERT( pcWriteBuffer );\r
 \r
        /* Generate a table of task stats. */\r
-       strcpy( ( char * ) pcWriteBuffer, ( char * ) 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
@@ -269,9 +269,9 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
 }\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 int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Time\r\n****************************************\r\n";\r
+const char * const pcHeader = "Task            Abs Time      % Time\r\n****************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -281,8 +281,8 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
        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
@@ -290,9 +290,9 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
 }\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
@@ -307,7 +307,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -320,21 +320,21 @@ static portBASE_TYPE lParameterNumber = 0;
        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, ( const char * ) 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
@@ -357,9 +357,9 @@ static portBASE_TYPE lParameterNumber = 0;
 }\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
@@ -374,7 +374,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -387,20 +387,20 @@ static portBASE_TYPE lParameterNumber = 0;
        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
@@ -426,13 +426,13 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
 #if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
 \r
-       static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
        {\r
-       int8_t * pcParameter;\r
+       char * pcParameter;\r
        portBASE_TYPE lParameterStringLength, xReturn;\r
        uint32_t ulIPAddress, ulBytesToPing;\r
        const uint32_t ulDefaultBytesToPing = 8UL;\r
-       int8_t cBuffer[ 16 ];\r
+       char cBuffer[ 16 ];\r
 \r
                /* Remove compile time warnings about unused parameters, and check the\r
                write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -445,12 +445,12 @@ static portBASE_TYPE lParameterNumber = 0;
                pcWriteBuffer[ 0 ] = 0x00;\r
 \r
                /* Obtain the number of bytes to ping. */\r
-               pcParameter = ( int8_t * ) 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
@@ -463,12 +463,12 @@ static portBASE_TYPE lParameterNumber = 0;
                }\r
 \r
                /* Obtain the IP address 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 = ( 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
@@ -489,7 +489,7 @@ static portBASE_TYPE lParameterNumber = 0;
                }\r
 \r
                /* Convert IP address, which may have come from a DNS lookup, to string. */\r
-               FreeRTOS_inet_ntoa( ulIPAddress, ( char * ) cBuffer );\r
+               FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );\r
 \r
                if( ulIPAddress != 0 )\r
                {\r
@@ -502,11 +502,11 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
                if( xReturn == pdFALSE )\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "%s", "Could not send ping request\r\n" );\r
+                       sprintf( pcWriteBuffer, "%s", "Could not send ping request\r\n" );\r
                }\r
                else\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );\r
+                       sprintf( pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );\r
                }\r
 \r
                return pdFALSE;\r
@@ -517,7 +517,7 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
 #if configINCLUDE_DEMO_DEBUG_STATS != 0\r
 \r
-       static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
        {\r
        static portBASE_TYPE xIndex = -1;\r
        extern xExampleDebugStatEntry_t xIPTraceValues[];\r
@@ -534,7 +534,7 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
                if( xIndex < xExampleDebugStatEntries() )\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "%s %d\r\n", ( char * ) xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );\r
+                       sprintf( pcWriteBuffer, "%s %d\r\n", xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );\r
                        xReturn = pdPASS;\r
                }\r
                else\r
@@ -553,7 +553,7 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
 #endif /* configINCLUDE_DEMO_DEBUG_STATS */\r
 \r
-static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
 {\r
 static portBASE_TYPE xIndex = 0;\r
 portBASE_TYPE xReturn;\r
@@ -570,35 +570,35 @@ uint32_t ulAddress;
        {\r
                case 0 :\r
                        FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nIP address " );\r
+                       sprintf( pcWriteBuffer, "\r\nIP address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 1 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nNet mask " );\r
+                       sprintf( pcWriteBuffer, "\r\nNet mask " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 2 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nGateway address " );\r
+                       sprintf( pcWriteBuffer, "\r\nGateway address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 3 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nDNS server address " );\r
+                       sprintf( pcWriteBuffer, "\r\nDNS server address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                default :\r
                        ulAddress = 0;\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\n\r\n" );\r
+                       sprintf( pcWriteBuffer, "\r\n\r\n" );\r
                        xReturn = pdFALSE;\r
                        xIndex = 0;\r
                        break;\r
@@ -606,7 +606,7 @@ uint32_t ulAddress;
 \r
        if( ulAddress != 0 )\r
        {\r
-               FreeRTOS_inet_ntoa( ulAddress, ( ( char * ) &( pcWriteBuffer[ strlen( ( char * ) pcWriteBuffer ) ] ) ) );\r
+               FreeRTOS_inet_ntoa( ulAddress,  &( pcWriteBuffer[ strlen( pcWriteBuffer ) ] ) );\r
        }\r
 \r
        return xReturn;\r
@@ -615,9 +615,9 @@ uint32_t ulAddress;
 \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
@@ -628,12 +628,12 @@ uint32_t ulAddress;
                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
@@ -646,17 +646,17 @@ uint32_t ulAddress;
                        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
index 39e130088e9bf358656f7a6f06def17cf1476746..ab5fd80adb319d4040d882f5c40677c9a6fef208 100644 (file)
@@ -83,37 +83,37 @@ static void prvSaveTraceFile( void );
  * Defines a command that returns a table showing the state of each task at the\r
  * time the command is called.\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
  * Defines a command that returns a table showing how much time each task has\r
  * spent in the Running state.\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
  * Defines a command that expects exactly three parameters.  Each of the three\r
  * parameter are echoed back one at a time.\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
  * Defines a command that can take a variable number of parameters.  Each\r
  * parameter is echoes back one at a time.\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
  * Defines a command that starts/stops events being recorded for offline viewing\r
  * in FreeRTOS+Trace.\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
 /* Structure that defines the "run-time-stats" command line command. */\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\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\n",\r
        prvRunTimeStatsCommand, /* The function to run. */\r
        0 /* No parameters are expected. */\r
 };\r
@@ -121,8 +121,8 @@ static const CLI_Command_Definition_t xRunTimeStats =
 /* Structure that defines the "task-stats" command line command. */\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\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\n",\r
        prvTaskStatsCommand, /* The function to run. */\r
        0 /* No parameters are expected. */\r
 };\r
@@ -132,8 +132,8 @@ takes exactly three parameters that the command simply echos back one at a
 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\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\n",\r
        prvThreeParameterEchoCommand, /* The function to run. */\r
        3 /* Three parameters are expected, which can take any value. */\r
 };\r
@@ -143,8 +143,8 @@ takes a variable number of parameters that the command simply echos back one at
 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\n",\r
+       "echo_parameters",\r
+       "\r\necho_parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",\r
        prvParameterEchoCommand, /* The function to run. */\r
        -1 /* The user can enter any number of commands. */\r
 };\r
@@ -153,8 +153,8 @@ static const CLI_Command_Definition_t xParameterEcho =
 parameter, which can be either "start" or "stop". */\r
 static const CLI_Command_Definition_t xStartTrace =\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\n",\r
+       "trace",\r
+       "\r\ntrace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",\r
        prvStartStopTraceCommand, /* The function to run. */\r
        1 /* One parameter is expected.  Valid values are "start" and "stop". */\r
 };\r
@@ -172,9 +172,9 @@ void vRegisterCLICommands( void )
 }\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 int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stack      #\r\n************************************************\r\n";\r
+const char *const pcHeader = "Task          State  Priority  Stack     #\r\n************************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -184,8 +184,8 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
        configASSERT( pcWriteBuffer );\r
 \r
        /* Generate a table of task stats. */\r
-       strcpy( ( char * ) pcWriteBuffer, ( char * ) 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
@@ -193,9 +193,9 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
 }\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 int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Time\r\n****************************************\r\n";\r
+const char * const pcHeader = "Task            Abs Time      % Time\r\n****************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -205,8 +205,8 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
        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
@@ -214,9 +214,9 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
 }\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 lParameterStringLength, xReturn;\r
 static portBASE_TYPE lParameterNumber = 0;\r
 \r
@@ -231,7 +231,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -244,21 +244,21 @@ static portBASE_TYPE lParameterNumber = 0;
        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
-                                                                               &lParameterStringLength /* Store the parameter string length. */\r
-                                                                       );\r
+               pcParameter = FreeRTOS_CLIGetParameter\r
+                                               (\r
+                                                       pcCommandString,                /* The command string itself. */\r
+                                                       lParameterNumber,               /* Return the next parameter. */\r
+                                                       &lParameterStringLength /* 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: ", lParameterNumber );\r
-               strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, lParameterStringLength );\r
-               strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+               sprintf( pcWriteBuffer, "%d: ", lParameterNumber );\r
+               strncat( pcWriteBuffer, ( const char * ) 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
                strings to return after this one. */\r
@@ -281,9 +281,9 @@ static portBASE_TYPE lParameterNumber = 0;
 }\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 lParameterStringLength, xReturn;\r
 static portBASE_TYPE lParameterNumber = 0;\r
 \r
@@ -298,7 +298,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -311,20 +311,20 @@ static portBASE_TYPE lParameterNumber = 0;
        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
-                                                                               &lParameterStringLength /* Store the parameter string length. */\r
-                                                                       );\r
+               pcParameter = FreeRTOS_CLIGetParameter\r
+                                               (\r
+                                                       pcCommandString,                /* The command string itself. */\r
+                                                       lParameterNumber,               /* Return the next parameter. */\r
+                                                       &lParameterStringLength /* 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: ", lParameterNumber );\r
-                       strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, lParameterStringLength );\r
-                       strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+                       sprintf( pcWriteBuffer, "%d: ", lParameterNumber );\r
+                       strncat( pcWriteBuffer, ( const char * ) pcParameter, lParameterStringLength );\r
+                       strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
 \r
                        /* There might be more parameters to return after this one. */\r
                        xReturn = pdTRUE;\r
@@ -348,9 +348,9 @@ static portBASE_TYPE lParameterNumber = 0;
 }\r
 /*-----------------------------------------------------------*/\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
@@ -361,12 +361,12 @@ portBASE_TYPE lParameterStringLength;
        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
@@ -379,18 +379,18 @@ portBASE_TYPE lParameterStringLength;
                vTraceClear();\r
                uiTraceStart();\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 and dumping log to disk.\r\n" );\r
+               sprintf( pcWriteBuffer, "Stopping trace recording and dumping log to disk.\r\n" );\r
                prvSaveTraceFile();\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
index efca7fbccc38ee6563a94f33284045df59023a9d..45d8c074a8d288c20de34761c29561b5954dda74 100644 (file)
@@ -1,5 +1,5 @@
 /*\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
  * 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
+static portBASE_TYPE prvPerformCopy( const char *pcSourceFile,\r
                                                        int32_t lSourceFileLength,\r
-                                                       int8_t *pcDestinationFile,\r
-                                                       int8_t *pxWriteBuffer,\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
 /*\r
  * Implements the TEST command.\r
  */\r
-static portBASE_TYPE prvTESTFSCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvTESTFSCommand( 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
@@ -149,8 +149,8 @@ static const CLI_Command_Definition_t xDIR =
 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
@@ -159,8 +159,8 @@ static const CLI_Command_Definition_t xCD =
 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
@@ -168,8 +168,8 @@ static const CLI_Command_Definition_t xTYPE =
 /* 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
@@ -177,8 +177,8 @@ static const CLI_Command_Definition_t xDEL =
 /* 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
@@ -187,8 +187,8 @@ static const CLI_Command_Definition_t xCOPY =
 file system driver tests. */\r
 static const CLI_Command_Definition_t xTEST_FS =\r
 {\r
-       ( const int8_t * const ) "test-fs", /* The command string to type. */\r
-       ( const int8_t * const ) "\r\ntest-fs:\r\n Executes file system tests.  ALL FILES WILL BE DELETED!!!\r\n",\r
+       "test-fs", /* The command string to type. */\r
+       "\r\ntest-fs:\r\n Executes file system tests.  ALL FILES WILL BE DELETED!!!\r\n",\r
        prvTESTFSCommand, /* The function to run. */\r
        0 /* No parameters are expected. */\r
 };\r
@@ -207,9 +207,9 @@ void vRegisterFileSystemCLICommands( void )
 }\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
@@ -233,12 +233,12 @@ size_t xColumns = 50U;
        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
@@ -263,7 +263,7 @@ size_t xColumns = 50U;
                        }\r
                        else\r
                        {\r
-                               pcWriteBuffer[ xByte ] = ( int8_t ) iChar;\r
+                               pcWriteBuffer[ xByte ] = ( char ) iChar;\r
                        }\r
                }\r
        }\r
@@ -275,51 +275,51 @@ size_t xColumns = 50U;
                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
+               sprintf( pcWriteBuffer, "In: " );\r
                xStringLength = strlen( ( const char * ) pcWriteBuffer );\r
-               f_getcwd( ( char * ) &( pcWriteBuffer[ xStringLength ] ), ( unsigned char ) ( xWriteBufferLen - xStringLength ) );\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
@@ -349,12 +349,12 @@ portBASE_TYPE xReturn = pdFALSE;
                        }\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
@@ -379,15 +379,15 @@ portBASE_TYPE 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 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
@@ -395,12 +395,12 @@ unsigned char ucReturned;
        ( 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
@@ -410,20 +410,20 @@ unsigned char ucReturned;
 \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 prvTESTFSCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvTESTFSCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
 {\r
 unsigned portBASE_TYPE uxOriginalPriority;\r
 \r
@@ -444,31 +444,32 @@ unsigned portBASE_TYPE uxOriginalPriority;
        /* Reset back to the original priority. */\r
        vTaskPrioritySet( NULL, uxOriginalPriority );\r
 \r
-       sprintf( ( char * ) pcWriteBuffer, "%s", "Test results were sent to Windows console" );\r
+       sprintf( pcWriteBuffer, "%s", "Test results were sent to Windows console" );\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;\r
+const char *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 = 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
+       pcSourceFile = ( char * ) FreeRTOS_CLIGetParameter\r
                                                                (\r
                                                                        pcCommandString,                /* The command string itself. */\r
                                                                        1,                                              /* Return the first parameter. */\r
@@ -486,7 +487,7 @@ long lSourceLength, lDestinationLength = 0;
 \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
@@ -495,7 +496,7 @@ long lSourceLength, lDestinationLength = 0;
 \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
@@ -505,25 +506,25 @@ long lSourceLength, lDestinationLength = 0;
        {\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
@@ -584,7 +585,7 @@ portBASE_TYPE xReturn = pdPASS;
 }\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
@@ -605,5 +606,5 @@ const char * pcAttrib;
 \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
index bf55a8d8bb9831ebc6f6df71b6870de1bf1ab946..ece8e2770a090d19a91b9fe6ea1316e7fa4fe783 100644 (file)
 /*\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
@@ -129,8 +129,8 @@ static const CLI_Command_Definition_t xRunTimeStats =
 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
@@ -140,8 +140,8 @@ takes exactly three parameters that the command simply echos back one at a
 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
@@ -151,8 +151,8 @@ takes a variable number of parameters that the command simply echos back one at
 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
@@ -162,8 +162,8 @@ static const CLI_Command_Definition_t xParameterEcho =
        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
@@ -187,9 +187,9 @@ void vRegisterSampleCLICommands( void )
 }\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 int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stack      #\r\n************************************************\r\n";\r
+const char *const pcHeader = "Task          State  Priority  Stack     #\r\n************************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -199,8 +199,8 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
        configASSERT( pcWriteBuffer );\r
 \r
        /* Generate a table of task stats. */\r
-       strcpy( ( char * ) pcWriteBuffer, ( char * ) 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
@@ -208,9 +208,9 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
 }\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 int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Time\r\n****************************************\r\n";\r
+const char * const pcHeader = "Task            Abs Time      % Time\r\n****************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -220,8 +220,8 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
        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
@@ -229,9 +229,9 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
 }\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
@@ -246,7 +246,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -259,21 +259,21 @@ static portBASE_TYPE lParameterNumber = 0;
        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, ( const char * ) 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
@@ -296,9 +296,9 @@ static portBASE_TYPE lParameterNumber = 0;
 }\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
@@ -313,7 +313,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -326,20 +326,20 @@ static portBASE_TYPE lParameterNumber = 0;
        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
@@ -365,9 +365,9 @@ static portBASE_TYPE lParameterNumber = 0;
 \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
@@ -378,12 +378,12 @@ static portBASE_TYPE lParameterNumber = 0;
                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
@@ -396,17 +396,17 @@ static portBASE_TYPE lParameterNumber = 0;
                        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
index 23c9292a6a267dde6ee435fb95d3ba8a08e57862..633c120fbdc0abee5605ad11ee174d06864d07b6 100644 (file)
@@ -96,50 +96,50 @@ commands. */
 /*\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
  * Defines a command that prints out IP address information.\r
  */\r
-static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /*\r
  * Defines a command that prints out the gathered demo debug stats.\r
  */\r
-static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /*\r
  * Defines a command that sends an ICMP ping request to an IP address.\r
  */\r
-static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvPingCommand( 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 "ip-config" command line command. */\r
 static const CLI_Command_Definition_t xIPConfig =\r
 {\r
-       ( const int8_t * const ) "ip-config",\r
-       ( const int8_t * const ) "ip-config:\r\n Displays IP address configuration\r\n\r\n",\r
+       "ip-config",\r
+       "ip-config:\r\n Displays IP address configuration\r\n\r\n",\r
        prvDisplayIPConfig,\r
        0\r
 };\r
@@ -148,8 +148,8 @@ static const CLI_Command_Definition_t xIPConfig =
        /* Structure that defines the "ip-debug-stats" command line command. */\r
        static const CLI_Command_Definition_t xIPDebugStats =\r
        {\r
-               ( const int8_t * const ) "ip-debug-stats", /* The command string to type. */\r
-               ( const int8_t * const ) "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",\r
+               "ip-debug-stats", /* The command string to type. */\r
+               "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",\r
                prvDisplayIPDebugStats, /* The function to run. */\r
                0 /* No parameters are expected. */\r
        };\r
@@ -159,8 +159,8 @@ static const CLI_Command_Definition_t xIPConfig =
 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 ) "run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",\r
+       "run-time-stats", /* The command string to type. */\r
+       "run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",\r
        prvRunTimeStatsCommand, /* The function to run. */\r
        0 /* No parameters are expected. */\r
 };\r
@@ -169,8 +169,8 @@ static const CLI_Command_Definition_t xRunTimeStats =
 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 ) "task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",\r
+       "task-stats", /* The command string to type. */\r
+       "task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",\r
        prvTaskStatsCommand, /* The function to run. */\r
        0 /* No parameters are expected. */\r
 };\r
@@ -180,8 +180,8 @@ takes exactly three parameters that the command simply echos back one at a
 time. */\r
 static const CLI_Command_Definition_t xThreeParameterEcho =\r
 {\r
-       ( const int8_t * const ) "echo-3-parameters",\r
-       ( const int8_t * const ) "echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",\r
+       "echo-3-parameters",\r
+       "echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",\r
        prvThreeParameterEchoCommand, /* The function to run. */\r
        3 /* Three parameters are expected, which can take any value. */\r
 };\r
@@ -191,8 +191,8 @@ takes a variable number of parameters that the command simply echos back one at
 a time. */\r
 static const CLI_Command_Definition_t xParameterEcho =\r
 {\r
-       ( const int8_t * const ) "echo-parameters",\r
-       ( const int8_t * const ) "echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",\r
+       "echo-parameters",\r
+       "echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",\r
        prvParameterEchoCommand, /* The function to run. */\r
        -1 /* The user can enter any number of commands. */\r
 };\r
@@ -204,8 +204,8 @@ static const CLI_Command_Definition_t xParameterEcho =
        parameters. */\r
        static const CLI_Command_Definition_t xPing =\r
        {\r
-               ( const int8_t * const ) "ping",\r
-               ( const int8_t * const ) "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",\r
+               "ping",\r
+               "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",\r
                prvPingCommand, /* The function to run. */\r
                -1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */\r
        };\r
@@ -217,8 +217,8 @@ static const CLI_Command_Definition_t xParameterEcho =
        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 ) "trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",\r
+               "trace",\r
+               "trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",\r
                prvStartStopTraceCommand, /* The function to run. */\r
                1 /* One parameter is expected.  Valid values are "start" and "stop". */\r
        };\r
@@ -248,9 +248,9 @@ void vRegisterCLICommands( void )
 }\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 int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stack      #\r\n************************************************\r\n";\r
+const char *const pcHeader = "Task          State  Priority  Stack     #\r\n************************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -260,8 +260,8 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
        configASSERT( pcWriteBuffer );\r
 \r
        /* Generate a table of task stats. */\r
-       strcpy( ( char * ) pcWriteBuffer, ( char * ) 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
@@ -269,9 +269,9 @@ const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stac
 }\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 int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Time\r\n****************************************\r\n";\r
+const char * const pcHeader = "Task            Abs Time      % Time\r\n****************************************\r\n";\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
        write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -281,8 +281,8 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
        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
@@ -290,9 +290,9 @@ const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Ti
 }\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
@@ -307,7 +307,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -320,21 +320,21 @@ static portBASE_TYPE lParameterNumber = 0;
        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, ( const char * ) 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
@@ -357,9 +357,9 @@ static portBASE_TYPE lParameterNumber = 0;
 }\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
@@ -374,7 +374,7 @@ static portBASE_TYPE lParameterNumber = 0;
        {\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
@@ -387,20 +387,20 @@ static portBASE_TYPE lParameterNumber = 0;
        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
@@ -426,13 +426,13 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
 #if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
 \r
-       static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       static portBASE_TYPE prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
        {\r
-       int8_t * pcParameter;\r
+       char * pcParameter;\r
        portBASE_TYPE lParameterStringLength, xReturn;\r
        uint32_t ulIPAddress, ulBytesToPing;\r
        const uint32_t ulDefaultBytesToPing = 8UL;\r
-       int8_t cBuffer[ 16 ];\r
+       char cBuffer[ 16 ];\r
 \r
                /* Remove compile time warnings about unused parameters, and check the\r
                write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
@@ -445,12 +445,12 @@ static portBASE_TYPE lParameterNumber = 0;
                pcWriteBuffer[ 0 ] = 0x00;\r
 \r
                /* Obtain the number of bytes to ping. */\r
-               pcParameter = ( int8_t * ) 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
@@ -459,16 +459,16 @@ static portBASE_TYPE lParameterNumber = 0;
                }\r
                else\r
                {\r
-                       ulBytesToPing = atol( ( const char * ) pcParameter );\r
+                       ulBytesToPing = atol( pcParameter );\r
                }\r
 \r
                /* Obtain the IP address 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 = ( 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
@@ -489,7 +489,7 @@ static portBASE_TYPE lParameterNumber = 0;
                }\r
 \r
                /* Convert IP address, which may have come from a DNS lookup, to string. */\r
-               FreeRTOS_inet_ntoa( ulIPAddress, ( char * ) cBuffer );\r
+               FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );\r
 \r
                if( ulIPAddress != 0 )\r
                {\r
@@ -502,11 +502,11 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
                if( xReturn == pdFALSE )\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "%s", "Could not send ping request\r\n" );\r
+                       sprintf( pcWriteBuffer, "%s", "Could not send ping request\r\n" );\r
                }\r
                else\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );\r
+                       sprintf( pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );\r
                }\r
 \r
                return pdFALSE;\r
@@ -517,7 +517,7 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
 #if configINCLUDE_DEMO_DEBUG_STATS != 0\r
 \r
-       static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       static portBASE_TYPE prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
        {\r
        static portBASE_TYPE xIndex = -1;\r
        extern xExampleDebugStatEntry_t xIPTraceValues[];\r
@@ -534,7 +534,7 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
                if( xIndex < xExampleDebugStatEntries() )\r
                {\r
-                       sprintf( ( char * ) pcWriteBuffer, "%s %d\r\n", ( char * ) xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );\r
+                       sprintf( pcWriteBuffer, "%s %d\r\n", xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );\r
                        xReturn = pdPASS;\r
                }\r
                else\r
@@ -553,7 +553,7 @@ static portBASE_TYPE lParameterNumber = 0;
 \r
 #endif /* configINCLUDE_DEMO_DEBUG_STATS */\r
 \r
-static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
 {\r
 static portBASE_TYPE xIndex = 0;\r
 portBASE_TYPE xReturn;\r
@@ -570,35 +570,35 @@ uint32_t ulAddress;
        {\r
                case 0 :\r
                        FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nIP address " );\r
+                       sprintf( pcWriteBuffer, "\r\nIP address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 1 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nNet mask " );\r
+                       sprintf( pcWriteBuffer, "\r\nNet mask " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 2 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nGateway address " );\r
+                       sprintf( pcWriteBuffer, "\r\nGateway address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                case 3 :\r
                        FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\nDNS server address " );\r
+                       sprintf( pcWriteBuffer, "\r\nDNS server address " );\r
                        xReturn = pdTRUE;\r
                        xIndex++;\r
                        break;\r
 \r
                default :\r
                        ulAddress = 0;\r
-                       sprintf( ( char * ) pcWriteBuffer, "\r\n\r\n" );\r
+                       sprintf( pcWriteBuffer, "\r\n\r\n" );\r
                        xReturn = pdFALSE;\r
                        xIndex = 0;\r
                        break;\r
@@ -606,7 +606,7 @@ uint32_t ulAddress;
 \r
        if( ulAddress != 0 )\r
        {\r
-               FreeRTOS_inet_ntoa( ulAddress, ( ( char * ) &( pcWriteBuffer[ strlen( ( char * ) pcWriteBuffer ) ] ) ) );\r
+               FreeRTOS_inet_ntoa( ulAddress,  &( pcWriteBuffer[ strlen( pcWriteBuffer ) ] ) );\r
        }\r
 \r
        return xReturn;\r
@@ -615,9 +615,9 @@ uint32_t ulAddress;
 \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
@@ -628,12 +628,12 @@ uint32_t ulAddress;
                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
@@ -646,17 +646,17 @@ uint32_t ulAddress;
                        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
index c1bf496f3f7a7ed011b899206e87065c88ce5152..66b593f6ffc5dd31d6838a575776edf0cc49911b 100644 (file)
@@ -1,14 +1,14 @@
 /*\r
  * FreeRTOS+CLI V1.0.2 (C) 2013 Real Time Engineers ltd.  All rights reserved.\r
  *\r
- * This file is part of the FreeRTOS+CLI distribution.  The FreeRTOS+CLI license \r
+ * This file is part of the FreeRTOS+CLI distribution.  The FreeRTOS+CLI license\r
  * terms are different to the FreeRTOS license terms.\r
  *\r
- * FreeRTOS+CLI 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+CLI is also distributed under the same GPL V2 license terms.  \r
+ * FreeRTOS+CLI 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+CLI is also distributed under the same GPL V2 license terms.\r
  * Details of both license options follow:\r
  *\r
  * - Open source licensing -\r
@@ -61,19 +61,19 @@ typedef struct xCOMMAND_INPUT_LIST
  * The callback function that is executed when "help" is entered.  This is the\r
  * only default command that is always present.\r
  */\r
-static portBASE_TYPE prvHelpCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+static portBASE_TYPE prvHelpCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /*\r
  * Return the number of parameters that follow the command name.\r
  */\r
-static int8_t prvGetNumberOfParameters( const int8_t * pcCommandString );\r
+static int8_t prvGetNumberOfParameters( const char *pcCommandString );\r
 \r
 /* The definition of the "help" command.  This command is always at the front\r
 of the list of registered commands. */\r
 static const CLI_Command_Definition_t xHelpCommand =\r
 {\r
-       ( const int8_t * const ) "help",\r
-       ( const int8_t * const ) "\r\nhelp:\r\n Lists all the registered commands\r\n\r\n",\r
+       "help",\r
+       "\r\nhelp:\r\n Lists all the registered commands\r\n\r\n",\r
        prvHelpCommand,\r
        0\r
 };\r
@@ -94,7 +94,7 @@ to save RAM.  Note, however, that the command console itself is not re-entrant,
 so only one command interpreter interface can be used at any one time.  For that\r
 reason, no attempt at providing mutual exclusion to the cOutputBuffer array is\r
 attempted. */\r
-static int8_t cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];\r
+static char cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -139,11 +139,11 @@ portBASE_TYPE xReturn = pdFAIL;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-portBASE_TYPE FreeRTOS_CLIProcessCommand( const int8_t * const pcCommandInput, int8_t * pcWriteBuffer, size_t xWriteBufferLen  )\r
+portBASE_TYPE FreeRTOS_CLIProcessCommand( const char * const pcCommandInput, char * pcWriteBuffer, size_t xWriteBufferLen  )\r
 {\r
 static const CLI_Definition_List_Item_t *pxCommand = NULL;\r
 portBASE_TYPE xReturn = pdTRUE;\r
-const int8_t *pcRegisteredCommandString;\r
+const char *pcRegisteredCommandString;\r
 size_t xCommandStringLength;\r
 \r
        /* Note:  This function is not re-entrant.  It must not be called from more\r
@@ -155,7 +155,7 @@ size_t xCommandStringLength;
                for( pxCommand = &xRegisteredCommands; pxCommand != NULL; pxCommand = pxCommand->pxNext )\r
                {\r
                        pcRegisteredCommandString = pxCommand->pxCommandLineDefinition->pcCommand;\r
-                       xCommandStringLength = strlen( ( const char * ) pcRegisteredCommandString );\r
+                       xCommandStringLength = strlen( pcRegisteredCommandString );\r
 \r
                        /* To ensure the string lengths match exactly, so as not to pick up\r
                        a sub-string of a longer command, check the byte after the expected\r
@@ -163,7 +163,7 @@ size_t xCommandStringLength;
                        a parameter. */\r
                        if( ( pcCommandInput[ xCommandStringLength ] == ' ' ) || ( pcCommandInput[ xCommandStringLength ] == 0x00 ) )\r
                        {\r
-                               if( strncmp( ( const char * ) pcCommandInput, ( const char * ) pcRegisteredCommandString, xCommandStringLength ) == 0 )\r
+                               if( strncmp( pcCommandInput, pcRegisteredCommandString, xCommandStringLength ) == 0 )\r
                                {\r
                                        /* The command has been found.  Check it has the expected\r
                                        number of parameters.  If cExpectedNumberOfParameters is -1,\r
@@ -187,7 +187,7 @@ size_t xCommandStringLength;
        {\r
                /* The command was found, but the number of parameters with the command\r
                was incorrect. */\r
-               strncpy( ( char * ) pcWriteBuffer, "Incorrect command parameter(s).  Enter \"help\" to view a list of available commands.\r\n\r\n", xWriteBufferLen );\r
+               strncpy( pcWriteBuffer, "Incorrect command parameter(s).  Enter \"help\" to view a list of available commands.\r\n\r\n", xWriteBufferLen );\r
                pxCommand = NULL;\r
        }\r
        else if( pxCommand != NULL )\r
@@ -206,7 +206,7 @@ size_t xCommandStringLength;
        else\r
        {\r
                /* pxCommand was NULL, the command was not found. */\r
-               strncpy( ( char * ) pcWriteBuffer, ( const char * const ) "Command not recognised.  Enter 'help' to view a list of available commands.\r\n\r\n", xWriteBufferLen );\r
+               strncpy( pcWriteBuffer, "Command not recognised.  Enter 'help' to view a list of available commands.\r\n\r\n", xWriteBufferLen );\r
                xReturn = pdFALSE;\r
        }\r
 \r
@@ -214,16 +214,16 @@ size_t xCommandStringLength;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-int8_t *FreeRTOS_CLIGetOutputBuffer( void )\r
+char *FreeRTOS_CLIGetOutputBuffer( void )\r
 {\r
        return cOutputBuffer;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-const int8_t *FreeRTOS_CLIGetParameter( const int8_t *pcCommandString, unsigned portBASE_TYPE uxWantedParameter, portBASE_TYPE *pxParameterStringLength )\r
+const char *FreeRTOS_CLIGetParameter( const char *pcCommandString, unsigned portBASE_TYPE uxWantedParameter, portBASE_TYPE *pxParameterStringLength )\r
 {\r
 unsigned portBASE_TYPE uxParametersFound = 0;\r
-const int8_t *pcReturn = NULL;\r
+const char *pcReturn = NULL;\r
 \r
        *pxParameterStringLength = 0;\r
 \r
@@ -276,7 +276,7 @@ const int8_t *pcReturn = NULL;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static portBASE_TYPE prvHelpCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+static portBASE_TYPE prvHelpCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
 {\r
 static const CLI_Definition_List_Item_t * pxCommand = NULL;\r
 signed portBASE_TYPE xReturn;\r
@@ -291,7 +291,7 @@ signed portBASE_TYPE xReturn;
 \r
        /* Return the next command help string, before moving the pointer on to\r
        the next command in the list. */\r
-       strncpy( ( char * ) pcWriteBuffer, ( const char * ) pxCommand->pxCommandLineDefinition->pcHelpString, xWriteBufferLen );\r
+       strncpy( pcWriteBuffer, pxCommand->pxCommandLineDefinition->pcHelpString, xWriteBufferLen );\r
        pxCommand = pxCommand->pxNext;\r
 \r
        if( pxCommand == NULL )\r
@@ -309,7 +309,7 @@ signed portBASE_TYPE xReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static int8_t prvGetNumberOfParameters( const int8_t * pcCommandString )\r
+static int8_t prvGetNumberOfParameters( const char *pcCommandString )\r
 {\r
 int8_t cParameters = 0;\r
 portBASE_TYPE xLastCharacterWasSpace = pdFALSE;\r
index 45cba4579f64ca33a51024eed82c4813ed4316d3..06ca88dfe8342085d8aa96eae6c21e1a12569707 100644 (file)
@@ -1,14 +1,14 @@
 /*\r
  * FreeRTOS+CLI V1.0.2 (C) 2013 Real Time Engineers ltd. All rights reserved.\r
  *\r
- * This file is part of the FreeRTOS+CLI distribution.  The FreeRTOS+CLI license \r
+ * This file is part of the FreeRTOS+CLI distribution.  The FreeRTOS+CLI license\r
  * terms are different to the FreeRTOS license terms.\r
  *\r
- * FreeRTOS+CLI 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+CLI is also distributed under the same GPL V2 license terms.  \r
+ * FreeRTOS+CLI 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+CLI is also distributed under the same GPL V2 license terms.\r
  * Details of both license options follow:\r
  *\r
  * - Open source licensing -\r
 #define COMMAND_INTERPRETER_H\r
 \r
 /* The prototype to which callback functions used to process command line\r
-commands must comply.  pcWriteBuffer is a buffer into which the output from \r
-executing the command can be written, xWriteBufferLen is the length, in bytes of \r
+commands must comply.  pcWriteBuffer is a buffer into which the output from\r
+executing the command can be written, xWriteBufferLen is the length, in bytes of\r
 the pcWriteBuffer buffer, and pcCommandString is the entire string as input by\r
 the user (from which parameters can be extracted).*/\r
-typedef portBASE_TYPE (*pdCOMMAND_LINE_CALLBACK)( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t * pcCommandString );\r
+typedef portBASE_TYPE (*pdCOMMAND_LINE_CALLBACK)( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
 \r
 /* The structure that defines command line commands.  A command line command\r
 should be defined by declaring a const structure of this type. */\r
 typedef struct xCOMMAND_LINE_INPUT\r
 {\r
-       const int8_t * const pcCommand;                         /* The command that causes pxCommandInterpreter to be executed.  For example "help".  Must be all lower case. */\r
-       const int8_t * const pcHelpString;                      /* String that describes how to use the command.  Should start with the command itself, and end with "\r\n".  For example "help: Returns a list of all the commands\r\n". */\r
+       const char * const pcCommand;                           /* The command that causes pxCommandInterpreter to be executed.  For example "help".  Must be all lower case. */\r
+       const char * const pcHelpString;                        /* String that describes how to use the command.  Should start with the command itself, and end with "\r\n".  For example "help: Returns a list of all the commands\r\n". */\r
        const pdCOMMAND_LINE_CALLBACK pxCommandInterpreter;     /* A pointer to the callback function that will return the output generated by the command. */\r
        int8_t cExpectedNumberOfParameters;                     /* Commands expect a fixed number of parameters, which may be zero. */\r
 } CLI_Command_Definition_t;\r
@@ -82,7 +82,7 @@ portBASE_TYPE FreeRTOS_CLIRegisterCommand( const CLI_Command_Definition_t * cons
  * pcCmdIntProcessCommand is not reentrant.  It must not be called from more\r
  * than one task - or at least - by more than one task at a time.\r
  */\r
-portBASE_TYPE FreeRTOS_CLIProcessCommand( const int8_t * const pcCommandInput, int8_t * pcWriteBuffer, size_t xWriteBufferLen  );\r
+portBASE_TYPE FreeRTOS_CLIProcessCommand( const char * const pcCommandInput, char * pcWriteBuffer, size_t xWriteBufferLen  );\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -97,12 +97,12 @@ portBASE_TYPE FreeRTOS_CLIProcessCommand( const int8_t * const pcCommandInput, i
  *\r
  * FreeRTOS_CLIGetOutputBuffer() returns the address of the output buffer.\r
  */\r
-int8_t *FreeRTOS_CLIGetOutputBuffer( void );\r
+char *FreeRTOS_CLIGetOutputBuffer( void );\r
 \r
 /*\r
  * Return a pointer to the xParameterNumber'th word in pcCommandString.\r
  */\r
-const int8_t *FreeRTOS_CLIGetParameter( const int8_t *pcCommandString, unsigned portBASE_TYPE uxWantedParameter, portBASE_TYPE *pxParameterStringLength );\r
+const char *FreeRTOS_CLIGetParameter( const char *pcCommandString, unsigned portBASE_TYPE uxWantedParameter, portBASE_TYPE *pxParameterStringLength );\r
 \r
 #endif /* COMMAND_INTERPRETER_H */\r
 \r