summaryrefslogtreecommitdiff
path: root/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole
diff options
context:
space:
mode:
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2013-12-30 19:32:29 +0000
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2013-12-30 19:32:29 +0000
commit1e7ec03f67b75d2ff965139a1f3c994a15621b97 (patch)
treefd708961dfeda30d62bf888b1f90f5b1e37099d4 /FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole
parent12ddabe6638d9e56f625cec090404e86675eea5d (diff)
downloadfreertos-1e7ec03f67b75d2ff965139a1f3c994a15621b97.tar.gz
Update FreeRTOS+ more demos that use FreeRTOS+CLI to remove casting to int8_t * from strings.
git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2155 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole')
-rw-r--r--FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/FreeRTOSConfig.h2
-rw-r--r--FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-releated-CLI-commands.c20
-rw-r--r--FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-system-demo.c8
-rw-r--r--FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/Sample-CLI-commands.c74
-rw-r--r--FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/UARTCommandConsole.c10
5 files changed, 57 insertions, 57 deletions
diff --git a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/FreeRTOSConfig.h
index 1638770c6..5178443fe 100644
--- a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/FreeRTOSConfig.h
+++ b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/FreeRTOSConfig.h
@@ -72,7 +72,7 @@
* executed prior to this project being built. Once it has been executed
* remove the #error line below.
*/
-#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.
+//#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.
/*
* Set configCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
diff --git a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-releated-CLI-commands.c b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-releated-CLI-commands.c
index 13d5e1bdb..a39dedf7e 100644
--- a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-releated-CLI-commands.c
+++ b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-releated-CLI-commands.c
@@ -238,7 +238,7 @@ size_t xColumns = 50U;
configASSERT( pcParameter );
/* Attempt to open the requested file. */
- pxFile = f_open( ( const char * ) pcParameter, "r" );
+ pxFile = f_open( pcParameter, "r" );
}
if( pxFile != NULL )
@@ -400,7 +400,7 @@ unsigned char ucReturned;
configASSERT( pcParameter );
/* Attempt to delete the file. */
- ucReturned = f_delete( ( const char * ) pcParameter );
+ ucReturned = f_delete( pcParameter );
if( ucReturned == F_NO_ERROR )
{
@@ -436,12 +436,12 @@ long lSourceLength, lDestinationLength = 0;
configASSERT( pcDestinationFile );
/* Obtain the name of the source file. */
- pcSourceFile = FreeRTOS_CLIGetParameter
- (
- pcCommandString, /* The command string itself. */
- 1, /* Return the first parameter. */
- &xParameterStringLength /* Store the parameter string length. */
- );
+ pcSourceFile = ( char * ) FreeRTOS_CLIGetParameter
+ (
+ pcCommandString, /* The command string itself. */
+ 1, /* Return the first parameter. */
+ &xParameterStringLength /* Store the parameter string length. */
+ );
/* Sanity check something was returned. */
configASSERT( pcSourceFile );
@@ -518,7 +518,7 @@ portBASE_TYPE xReturn = pdPASS;
/* Open the source file, seek past the data that has already been
read from the file, read the next block of data, then close the
file again so the destination file can be opened. */
- pxFile = f_open( ( const char * ) pcSourceFile, "r" );
+ pxFile = f_open( pcSourceFile, "r" );
if( pxFile != NULL )
{
f_seek( pxFile, lBytesRead, F_SEEK_SET );
@@ -533,7 +533,7 @@ portBASE_TYPE xReturn = pdPASS;
/* Open the destination file and write the block of data to the end of
the file. */
- pxFile = f_open( ( const char * ) pcDestinationFile, "a" );
+ pxFile = f_open( pcDestinationFile, "a" );
if( pxFile != NULL )
{
f_write( pxWriteBuffer, lBytesToRead, 1, pxFile );
diff --git a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-system-demo.c b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-system-demo.c
index 31932c799..435143831 100644
--- a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-system-demo.c
+++ b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/File-system-demo.c
@@ -1,5 +1,5 @@
/*
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
All rights reserved
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
@@ -302,7 +302,7 @@ char cFileName[ fsMAX_FILE_NAME_LEN ];
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
printf( "In directory %s\r\n", cRAMBuffer );
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );
/* Generate the file name. */
sprintf( cFileName, "%s.txt", pcDirectory2 );
@@ -331,7 +331,7 @@ char cFileName[ fsMAX_FILE_NAME_LEN ];
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
printf( "Back in root directory %s\r\n", cRAMBuffer );
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcRoot ) == 0 );
+ configASSERT( strcmp( cRAMBuffer, pcRoot ) == 0 );
}
/*-----------------------------------------------------------*/
@@ -349,7 +349,7 @@ char cFileName[ fsMAX_FILE_NAME_LEN ];
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
printf( "Back in directory %s\r\n", cRAMBuffer );
- configASSERT( strcmp( ( const char * ) cRAMBuffer, pcFullPath ) == 0 );
+ configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );
/* Generate the file name. */
sprintf( cFileName, "%s.txt", pcDirectory2 );
diff --git a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/Sample-CLI-commands.c b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/Sample-CLI-commands.c
index 1df4ab16f..025b58b3b 100644
--- a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/Sample-CLI-commands.c
+++ b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/Sample-CLI-commands.c
@@ -209,8 +209,8 @@ const char *const pcHeader = "Task State Priority Stack #\r\n********
configASSERT( pcWriteBuffer );
/* Generate a table of task stats. */
- strcpy( ( char * ) pcWriteBuffer, pcHeader );
- vTaskList( ( char * ) pcWriteBuffer + strlen( pcHeader ) );
+ strcpy( pcWriteBuffer, pcHeader );
+ vTaskList( pcWriteBuffer + strlen( pcHeader ) );
/* There is no more data to return after this single string, so return
pdFALSE. */
@@ -230,7 +230,7 @@ const char * const pcHeader = "Task Abs Time % Time\r\n*********
configASSERT( pcWriteBuffer );
/* Generate a table of task stats. */
- strcpy( ( char * ) pcWriteBuffer, pcHeader );
+ strcpy( pcWriteBuffer, pcHeader );
vTaskGetRunTimeStats( ( char * ) pcWriteBuffer + strlen( pcHeader ) );
/* There is no more data to return after this single string, so return
@@ -241,7 +241,7 @@ const char * const pcHeader = "Task Abs Time % Time\r\n*********
static portBASE_TYPE prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
-int8_t *pcParameter;
+const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0;
@@ -256,7 +256,7 @@ static portBASE_TYPE lParameterNumber = 0;
{
/* The first time the function is called after the command has been
entered just a header string is returned. */
- sprintf( ( char * ) pcWriteBuffer, "The three parameters were:\r\n" );
+ sprintf( pcWriteBuffer, "The three parameters were:\r\n" );
/* Next time the function is called the first parameter will be echoed
back. */
@@ -269,21 +269,21 @@ static portBASE_TYPE lParameterNumber = 0;
else
{
/* Obtain the parameter string. */
- pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter
- (
- pcCommandString, /* The command string itself. */
- lParameterNumber, /* Return the next parameter. */
- &xParameterStringLength /* Store the parameter string length. */
- );
+ pcParameter = FreeRTOS_CLIGetParameter
+ (
+ pcCommandString, /* The command string itself. */
+ lParameterNumber, /* Return the next parameter. */
+ &xParameterStringLength /* Store the parameter string length. */
+ );
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* Return the parameter string. */
memset( pcWriteBuffer, 0x00, xWriteBufferLen );
- sprintf( ( char * ) pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
- strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );
- strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
+ sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );
+ strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
/* If this is the last of the three parameters then there are no more
strings to return after this one. */
@@ -308,7 +308,7 @@ static portBASE_TYPE lParameterNumber = 0;
static portBASE_TYPE prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
-int8_t *pcParameter;
+const char *pcParameter;
portBASE_TYPE xParameterStringLength, xReturn;
static portBASE_TYPE lParameterNumber = 0;
@@ -323,7 +323,7 @@ static portBASE_TYPE lParameterNumber = 0;
{
/* The first time the function is called after the command has been
entered just a header string is returned. */
- sprintf( ( char * ) pcWriteBuffer, "The parameters were:\r\n" );
+ sprintf( pcWriteBuffer, "The parameters were:\r\n" );
/* Next time the function is called the first parameter will be echoed
back. */
@@ -336,20 +336,20 @@ static portBASE_TYPE lParameterNumber = 0;
else
{
/* Obtain the parameter string. */
- pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter
- (
- pcCommandString, /* The command string itself. */
- lParameterNumber, /* Return the next parameter. */
- &xParameterStringLength /* Store the parameter string length. */
- );
+ pcParameter = FreeRTOS_CLIGetParameter
+ (
+ pcCommandString, /* The command string itself. */
+ lParameterNumber, /* Return the next parameter. */
+ &xParameterStringLength /* Store the parameter string length. */
+ );
if( pcParameter != NULL )
{
/* Return the parameter string. */
memset( pcWriteBuffer, 0x00, xWriteBufferLen );
- sprintf( ( char * ) pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
- strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );
- strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
+ sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
+ strncat( pcWriteBuffer, pcParameter, xParameterStringLength );
+ strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
/* There might be more parameters to return after this one. */
xReturn = pdTRUE;
@@ -377,7 +377,7 @@ static portBASE_TYPE lParameterNumber = 0;
static portBASE_TYPE prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
- int8_t *pcParameter;
+ const char *pcParameter;
portBASE_TYPE lParameterStringLength;
/* Remove compile time warnings about unused parameters, and check the
@@ -388,35 +388,35 @@ static portBASE_TYPE lParameterNumber = 0;
configASSERT( pcWriteBuffer );
/* Obtain the parameter string. */
- pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter
- (
- pcCommandString, /* The command string itself. */
- 1, /* Return the first parameter. */
- &lParameterStringLength /* Store the parameter string length. */
- );
+ pcParameter = FreeRTOS_CLIGetParameter
+ (
+ pcCommandString, /* The command string itself. */
+ 1, /* Return the first parameter. */
+ &lParameterStringLength /* Store the parameter string length. */
+ );
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* There are only two valid parameter values. */
- if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )
+ if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )
{
/* Start or restart the trace. */
vTraceStop();
vTraceClear();
vTraceStart();
- sprintf( ( char * ) pcWriteBuffer, "Trace recording (re)started.\r\n" );
+ sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );
}
- else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )
+ else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )
{
/* End the trace, if one is running. */
vTraceStop();
- sprintf( ( char * ) pcWriteBuffer, "Stopping trace recording.\r\n" );
+ sprintf( pcWriteBuffer, "Stopping trace recording.\r\n" );
}
else
{
- sprintf( ( char * ) pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );
+ sprintf( pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );
}
/* There is no more data to return after this single string, so return
diff --git a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/UARTCommandConsole.c b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/UARTCommandConsole.c
index c5555eff3..e1f4cca3b 100644
--- a/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/UARTCommandConsole.c
+++ b/FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo/Full-Demo/UARTCommandConsole.c
@@ -165,7 +165,7 @@ portBASE_TYPE xReturned;
pcOutputString = FreeRTOS_CLIGetOutputBuffer();
/* Send the welcome message. */
- prvSendBuffer( pcWelcomeMessage, strlen( ( char * ) pcWelcomeMessage ) );
+ prvSendBuffer( pcWelcomeMessage, strlen( pcWelcomeMessage ) );
for( ;; )
{
@@ -179,14 +179,14 @@ portBASE_TYPE xReturned;
if( cRxedChar == '\n' || cRxedChar == '\r' )
{
/* Just to space the output from the input. */
- prvSendBuffer( pcNewLine, strlen( ( char * ) pcNewLine ) );
+ prvSendBuffer( pcNewLine, strlen( pcNewLine ) );
/* See if the command is empty, indicating that the last command is
to be executed again. */
if( cInputIndex == 0 )
{
/* Copy the last command back into the input string. */
- strcpy( ( char * ) cInputString, ( char * ) cLastInputString );
+ strcpy( cInputString, cLastInputString );
}
/* Pass the received command to the command interpreter. The
@@ -207,11 +207,11 @@ portBASE_TYPE xReturned;
Clear the input string ready to receive the next command. Remember
the command that was just processed first in case it is to be
processed again. */
- strcpy( ( char * ) cLastInputString, ( char * ) cInputString );
+ strcpy( cLastInputString, cInputString );
cInputIndex = 0;
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );
- prvSendBuffer( pcEndOfOutputMessage, strlen( ( char * ) pcEndOfOutputMessage ) );
+ prvSendBuffer( pcEndOfOutputMessage, strlen( pcEndOfOutputMessage ) );
}
else
{