mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
Start to remove unnecessary 'signed char *' casts from strings that are now just plain char * types.
This commit is contained in:
parent
b4116a7c7d
commit
da93f1fc4b
261 changed files with 2822 additions and 2815 deletions
|
@ -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
|
||||
|
||||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
@ -76,10 +76,10 @@
|
|||
* for messages - waking and displaying the messages as they arrive.
|
||||
*
|
||||
* "Check" hook - This only executes every five seconds from the tick hook.
|
||||
* Its main function is to check that all the standard demo tasks are still
|
||||
* operational. Should any unexpected behaviour within a demo task be discovered
|
||||
* the tick hook will write an error to the LCD (via the LCD task). If all the
|
||||
* demo tasks are executing with their expected behaviour then the check task
|
||||
* Its main function is to check that all the standard demo tasks are still
|
||||
* operational. Should any unexpected behaviour within a demo task be discovered
|
||||
* the tick hook will write an error to the LCD (via the LCD task). If all the
|
||||
* demo tasks are executing with their expected behaviour then the check task
|
||||
* writes PASS to the LCD (again via the LCD task), as described above.
|
||||
*
|
||||
* "uIP" task - This is the task that handles the uIP stack. All TCP/IP
|
||||
|
@ -114,7 +114,7 @@
|
|||
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define mainFLASH_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
||||
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
|
||||
/* Constants to setup the PLL. */
|
||||
#define mainPLL_MUL ( ( unsigned portLONG ) ( 8 - 1 ) )
|
||||
|
@ -134,15 +134,15 @@
|
|||
#define mainMAM_TIM_3 ( ( unsigned portCHAR ) 0x03 )
|
||||
#define mainMAM_MODE_FULL ( ( unsigned portCHAR ) 0x02 )
|
||||
|
||||
/*
|
||||
/*
|
||||
* The task that handles the uIP stack. All TCP/IP processing is performed in
|
||||
* this task.
|
||||
*/
|
||||
extern void vuIP_Task( void *pvParameters );
|
||||
|
||||
/*
|
||||
* The LCD is written two by more than one task so is controlled by a
|
||||
* 'gatekeeper' task. This is the only task that is actually permitted to
|
||||
* The LCD is written two by more than one task so is controlled by a
|
||||
* 'gatekeeper' task. This is the only task that is actually permitted to
|
||||
* access the LCD directly. Other tasks wanting to display a message send
|
||||
* the message to the gatekeeper.
|
||||
*/
|
||||
|
@ -159,31 +159,31 @@ xQueueHandle xLCDQueue;
|
|||
int main( void )
|
||||
{
|
||||
prvSetupHardware();
|
||||
|
||||
|
||||
/* Create the queue used by the LCD task. Messages for display on the LCD
|
||||
are received via this queue. */
|
||||
xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( xLCDMessage ) );
|
||||
|
||||
/* Create the uIP task. This uses the lwIP RTOS abstraction layer.*/
|
||||
xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
|
||||
xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
|
||||
|
||||
/* Start the standard demo tasks. */
|
||||
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
|
||||
vCreateBlockTimeTasks();
|
||||
vStartLEDFlashTasks( mainFLASH_PRIORITY );
|
||||
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
|
||||
vStartQueuePeekTasks();
|
||||
vStartQueuePeekTasks();
|
||||
vStartDynamicPriorityTasks();
|
||||
|
||||
/* Start the tasks defined within this file/specific to this demo. */
|
||||
xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
|
||||
xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
|
||||
|
||||
/* Start the scheduler. */
|
||||
vTaskStartScheduler();
|
||||
|
||||
/* Will only get here if there was insufficient memory to create the idle
|
||||
task. */
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -200,7 +200,7 @@ static portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
|||
if( ulTicksSinceLastDisplay >= mainCHECK_DELAY )
|
||||
{
|
||||
ulTicksSinceLastDisplay = 0;
|
||||
|
||||
|
||||
/* Has an error been found in any task? */
|
||||
|
||||
if( xAreBlockingQueuesStillRunning() != pdTRUE )
|
||||
|
@ -217,17 +217,17 @@ static portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
|||
{
|
||||
xMessage.pcMessage = "ERROR - GENQ";
|
||||
}
|
||||
|
||||
|
||||
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xMessage.pcMessage = "ERROR - PEEKQ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xMessage.pcMessage = "ERROR - DYNAMIC";
|
||||
}
|
||||
|
||||
|
||||
xMessage.xColumn++;
|
||||
|
||||
/* Send the message to the LCD gatekeeper for display. */
|
||||
|
@ -244,7 +244,7 @@ xLCDMessage xMessage;
|
|||
/* Initialise the LCD and display a startup message. */
|
||||
LCD_init();
|
||||
LCD_cur_off();
|
||||
LCD_cls();
|
||||
LCD_cls();
|
||||
LCD_gotoxy( 1, 1 );
|
||||
LCD_puts( "www.FreeRTOS.org" );
|
||||
|
||||
|
@ -252,7 +252,7 @@ xLCDMessage xMessage;
|
|||
{
|
||||
/* Wait for a message to arrive that requires displaying. */
|
||||
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );
|
||||
|
||||
|
||||
/* Display the message. Print each message to a different position. */
|
||||
LCD_cls();
|
||||
LCD_gotoxy( ( xMessage.xColumn & 0x07 ) + 1, ( xMessage.xColumn & 0x01 ) + 1 );
|
||||
|
@ -268,17 +268,17 @@ static void prvSetupHardware( void )
|
|||
/* Remap the interrupt vectors to RAM if we are are running from RAM. */
|
||||
SCB_MEMMAP = 2;
|
||||
#endif
|
||||
|
||||
|
||||
/* Disable the PLL. */
|
||||
PLLCON = 0;
|
||||
PLLFEED = mainPLL_FEED_BYTE1;
|
||||
PLLFEED = mainPLL_FEED_BYTE2;
|
||||
|
||||
|
||||
/* Configure clock source. */
|
||||
SCS |= mainOSC_ENABLE;
|
||||
while( !( SCS & mainOSC_STAT ) );
|
||||
CLKSRCSEL = mainOSC_SELECT;
|
||||
|
||||
CLKSRCSEL = mainOSC_SELECT;
|
||||
|
||||
/* Setup the PLL to multiply the XTAL input by 4. */
|
||||
PLLCFG = ( mainPLL_MUL | mainPLL_DIV );
|
||||
PLLFEED = mainPLL_FEED_BYTE1;
|
||||
|
@ -288,20 +288,20 @@ static void prvSetupHardware( void )
|
|||
PLLCON = mainPLL_ENABLE;
|
||||
PLLFEED = mainPLL_FEED_BYTE1;
|
||||
PLLFEED = mainPLL_FEED_BYTE2;
|
||||
CCLKCFG = mainCPU_CLK_DIV;
|
||||
CCLKCFG = mainCPU_CLK_DIV;
|
||||
while( !( PLLSTAT & mainPLL_LOCK ) );
|
||||
|
||||
|
||||
/* Connecting the clock. */
|
||||
PLLCON = mainPLL_CONNECT;
|
||||
PLLFEED = mainPLL_FEED_BYTE1;
|
||||
PLLFEED = mainPLL_FEED_BYTE2;
|
||||
while( !( PLLSTAT & mainPLL_CONNECTED ) );
|
||||
|
||||
/*
|
||||
while( !( PLLSTAT & mainPLL_CONNECTED ) );
|
||||
|
||||
/*
|
||||
This code is commented out as the MAM does not work on the original revision
|
||||
LPC2368 chips. If using Rev B chips then you can increase the speed though
|
||||
the use of the MAM.
|
||||
|
||||
|
||||
Setup and turn on the MAM. Three cycle access is used due to the fast
|
||||
PLL used. It is possible faster overall performance could be obtained by
|
||||
tuning the MAM and PLL settings.
|
||||
|
@ -309,7 +309,7 @@ static void prvSetupHardware( void )
|
|||
MAMTIM = mainMAM_TIM_3;
|
||||
MAMCR = mainMAM_MODE_FULL;
|
||||
*/
|
||||
|
||||
|
||||
/* Setup the led's on the MCB2300 board */
|
||||
vParTestInitialise();
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ PT_THREAD(file_stats(struct httpd_state *s, char *ptr))
|
|||
PSOCK_BEGIN(&s->sout);
|
||||
|
||||
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);
|
||||
|
||||
|
||||
PSOCK_END(&s->sout);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -139,14 +139,14 @@ static const char *states[] = {
|
|||
closing,
|
||||
time_wait,
|
||||
last_ack};
|
||||
|
||||
|
||||
|
||||
static unsigned short
|
||||
generate_tcp_stats(void *arg)
|
||||
{
|
||||
struct uip_conn *conn;
|
||||
struct httpd_state *s = (struct httpd_state *)arg;
|
||||
|
||||
|
||||
conn = &uip_conns[s->count];
|
||||
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
|
||||
"<tr><td>%d</td><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
|
||||
|
@ -166,7 +166,7 @@ generate_tcp_stats(void *arg)
|
|||
static
|
||||
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))
|
||||
{
|
||||
|
||||
|
||||
PSOCK_BEGIN(&s->sout);
|
||||
|
||||
for(s->count = 0; s->count < UIP_CONNS; ++s->count) {
|
||||
|
@ -197,14 +197,14 @@ PT_THREAD(net_stats(struct httpd_state *s, char *ptr))
|
|||
++s->count) {
|
||||
PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);
|
||||
}
|
||||
|
||||
|
||||
#endif /* UIP_STATISTICS */
|
||||
|
||||
|
||||
PSOCK_END(&s->sout);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
extern void vTaskList( signed char *pcWriteBuffer );
|
||||
extern void vTaskList( char *pcWriteBuffer );
|
||||
static char cCountBuf[ 32 ];
|
||||
long lRefreshCount = 0;
|
||||
static unsigned short
|
||||
|
@ -212,9 +212,9 @@ generate_rtos_stats(void *arg)
|
|||
{
|
||||
lRefreshCount++;
|
||||
sprintf( cCountBuf, "<p><br>Refresh count = %ld", lRefreshCount );
|
||||
vTaskList( uip_appdata );
|
||||
vTaskList( ( char * ) uip_appdata );
|
||||
strcat( uip_appdata, cCountBuf );
|
||||
|
||||
|
||||
return strlen( uip_appdata );
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -224,7 +224,7 @@ static
|
|||
PT_THREAD(rtos_stats(struct httpd_state *s, char *ptr))
|
||||
{
|
||||
PSOCK_BEGIN(&s->sout);
|
||||
PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);
|
||||
PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);
|
||||
PSOCK_END(&s->sout);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -253,8 +253,8 @@ static unsigned short generate_io_state( void *arg )
|
|||
"<input type=\"checkbox\" name=\"LED2\" value=\"1\" %s>LED 2.7"\
|
||||
"<p>"\
|
||||
"<input type=\"text\" name=\"LCD\" value=\"Enter LCD text\" size=\"16\">",
|
||||
pcStatus[ 0 ],
|
||||
pcStatus[ 1 ],
|
||||
pcStatus[ 0 ],
|
||||
pcStatus[ 1 ],
|
||||
pcStatus[ 2 ] );
|
||||
|
||||
return strlen( uip_appdata );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue