/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
1 tab == 4 spaces!\r
*/\r
\r
-/* \r
+/*\r
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
- The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+ The processor MUST be in supervisor mode when vTaskStartScheduler is\r
called. The demo applications included in the FreeRTOS.org download switch\r
to supervisor mode prior to main being called. If you are not using one of\r
these demo application projects then ensure Supervisor mode is used.\r
/*\r
* Creates all the demo application tasks, then starts the scheduler. The WEB\r
* documentation provides more details of the demo application tasks.\r
- * \r
- * Main.c also creates a task called "Check". This only executes every three \r
- * seconds but has the highest priority so is guaranteed to get processor time. \r
+ *\r
+ * Main.c also creates a task called "Check". This only executes every three\r
+ * seconds but has the highest priority so is guaranteed to get processor time.\r
* Its main function is to check that all the other tasks are still operational.\r
- * Each task (other than the "flash" tasks) maintains a unique count that is \r
- * incremented each time the task successfully completes its function. Should \r
- * any error occur within such a task the count is permanently halted. The \r
+ * Each task (other than the "flash" tasks) maintains a unique count that is\r
+ * incremented each time the task successfully completes its function. Should\r
+ * any error occur within such a task the count is permanently halted. The\r
* check task inspects the count of each task to ensure it has changed since\r
- * the last time the check task executed. If all the count variables have \r
+ * the last time the check task executed. If all the count variables have\r
* changed all the tasks are still executing error free, and the check task\r
- * toggles the onboard LED. Should any task contain an error at any time \r
+ * toggles the onboard LED. Should any task contain an error at any time\r
* the LED toggle rate will change from 3 seconds to 500ms.\r
*\r
- * To check the operation of the memory allocator the check task also \r
- * dynamically creates a task before delaying, and deletes it again when it \r
+ * To check the operation of the memory allocator the check task also\r
+ * dynamically creates a task before delaying, and deletes it again when it\r
* wakes. If memory cannot be allocated for the new task the call to xTaskCreate\r
* will fail and an error is signalled. The dynamically created task itself\r
* allocates and frees memory just to give the allocator a bit more exercise.\r
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
\r
-/* The rate at which the on board LED will toggle when there is/is not an \r
+/* The rate at which the on board LED will toggle when there is/is not an\r
error. */\r
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )\r
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )\r
static long prvCheckOtherTasksAreStillRunning( unsigned long ulMemCheckTaskCount );\r
\r
/*\r
- * The task that executes at the highest priority and calls \r
+ * The task that executes at the highest priority and calls\r
* prvCheckOtherTasksAreStillRunning(). See the description at the top\r
* of the file.\r
*/\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * Starts all the other tasks, then starts the scheduler. \r
+ * Starts all the other tasks, then starts the scheduler.\r
*/\r
int main( void )\r
{\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartMathTasks( tskIDLE_PRIORITY );\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
- vStartDynamicPriorityTasks(); \r
+ vStartDynamicPriorityTasks();\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
\r
/* Start the check task - which is defined in this file. */\r
- xTaskCreate( vErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Now all the tasks have been started - start the scheduler.\r
\r
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
- The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+ The processor MUST be in supervisor mode when vTaskStartScheduler is\r
called. The demo applications included in the FreeRTOS.org download switch\r
to supervisor mode prior to main being called. If you are not using one of\r
these demo application projects then ensure Supervisor mode is used here. */\r
/* Cycle for ever, delaying then checking all the other tasks are still\r
operating without error. If an error is detected then the delay period\r
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so\r
- the on board LED flash rate will increase. \r
- \r
+ the on board LED flash rate will increase.\r
+\r
In addition to the standard tests the memory allocator is tested through\r
- the dynamic creation and deletion of a task each cycle. Each time the \r
+ the dynamic creation and deletion of a task each cycle. Each time the\r
task is created memory must be allocated for its stack. When the task is\r
- deleted this memory is returned to the heap. If the task cannot be created \r
+ deleted this memory is returned to the heap. If the task cannot be created\r
then it is likely that the memory allocation failed. */\r
\r
for( ;; )\r
{\r
- /* Reset xCreatedTask. This is modified by the task about to be \r
+ /* Reset xCreatedTask. This is modified by the task about to be\r
created so we can tell if it is executing correctly or not. */\r
xCreatedTask = mainNO_TASK;\r
\r
- /* Dynamically create a task - passing ulMemCheckTaskRunningCount as a \r
+ /* Dynamically create a task - passing ulMemCheckTaskRunningCount as a\r
parameter. */\r
- ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE; \r
- if( xTaskCreate( vMemCheckTask, ( signed char * ) "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
+ ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE;\r
+ if( xTaskCreate( vMemCheckTask, "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
{\r
/* Could not create the task - we have probably run out of heap. */\r
xDelayPeriod = mainERROR_FLASH_PERIOD;\r
vTaskDelete( xCreatedTask );\r
}\r
\r
- /* Check all the standard demo application tasks are executing without \r
+ /* Check all the standard demo application tasks are executing without\r
error. ulMemCheckTaskRunningCount is checked to ensure it was\r
modified by the task just deleted. */\r
if( prvCheckOtherTasksAreStillRunning( ulMemCheckTaskRunningCount ) != pdPASS )\r
ulCSRWaitValue = WaitState5;\r
\r
AT91C_BASE_EBI->EBI_CSR[ 0 ] = ulCSRWaitValue | DataBus16 | WaitStateEnable\r
- | PageSize1M | tDF_0cycle \r
+ | PageSize1M | tDF_0cycle\r
| ByteWriteAccessType | CSEnable\r
| 0x00000000 /* Base Address */;\r
}\r
/* Clear all interrupts at the AIC level initially... */\r
AT91C_BASE_AIC->AIC_ICCR = 0xFFFFFFFF;\r
\r
- /* Perform 8 "End Of Interrupt" cmds to make sure AIC will not Lock out \r
+ /* Perform 8 "End Of Interrupt" cmds to make sure AIC will not Lock out\r
nIRQ */\r
for( lCount = 0; lCount < 8; lCount++ )\r
{\r
vErrorChecks task to check the operation of the memory allocator. Each time\r
the task is created memory is allocated for the stack and TCB. Each time\r
the task is deleted this memory is returned to the heap. This task itself\r
- exercises the allocator by allocating and freeing blocks. \r
- \r
- The task executes at the idle priority so does not require a delay. \r
- \r
+ exercises the allocator by allocating and freeing blocks.\r
+\r
+ The task executes at the idle priority so does not require a delay.\r
+\r
pulMemCheckTaskRunningCounter is incremented each cycle to indicate to the\r
vErrorChecks() task that this task is still executing without error. */\r
\r
}\r
else\r
{\r
- /* There has been an error so reset the counter so the check task \r
+ /* There has been an error so reset the counter so the check task\r
can tell that an error occurred. */\r
*pulMemCheckTaskRunningCounter = mainCOUNT_INITIAL_VALUE;\r
}\r
\r
- /* Allocate some memory - just to give the allocator some extra \r
+ /* Allocate some memory - just to give the allocator some extra\r
exercise. This has to be in a critical section to ensure the\r
task does not get deleted while it has memory allocated. */\r
vTaskSuspendAll();\r
PSOCK_BEGIN(&s->sout);\r
\r
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);\r
- \r
+\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
closing,\r
time_wait,\r
last_ack};\r
- \r
+\r
\r
static unsigned short\r
generate_tcp_stats(void *arg)\r
{\r
struct uip_conn *conn;\r
struct httpd_state *s = (struct httpd_state *)arg;\r
- \r
+\r
conn = &uip_conns[s->count];\r
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,\r
"<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",\r
static\r
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))\r
{\r
- \r
+\r
PSOCK_BEGIN(&s->sout);\r
\r
for(s->count = 0; s->count < UIP_CONNS; ++s->count) {\r
++s->count) {\r
PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);\r
}\r
- \r
+\r
#endif /* UIP_STATISTICS */\r
- \r
+\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
static unsigned short\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %ld", lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
- \r
+\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
PT_THREAD(rtos_stats(struct httpd_state *s, char *ptr))\r
{\r
PSOCK_BEGIN(&s->sout);\r
- PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL); \r
+ PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
sprintf( uip_appdata,\r
"<input type=\"checkbox\" name=\"LED0\" value=\"1\" %s>LED DS4,"\\r
"<p>",\r
- pcStatus ); \r
+ pcStatus );\r
\r
return strlen( uip_appdata );\r
}\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
1 tab == 4 spaces!\r
*/\r
\r
-/* \r
+/*\r
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
- The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+ The processor MUST be in supervisor mode when vTaskStartScheduler is\r
called. The demo applications included in the FreeRTOS.org download switch\r
to supervisor mode prior to main being called. If you are not using one of\r
these demo application projects then ensure Supervisor mode is used.\r
/*\r
* Creates all the demo application tasks, then starts the scheduler. The WEB\r
* documentation provides more details of the demo application tasks.\r
- * \r
- * Main.c also creates a task called "Check". This only executes every three \r
- * seconds but has the highest priority so is guaranteed to get processor time. \r
+ *\r
+ * Main.c also creates a task called "Check". This only executes every three\r
+ * seconds but has the highest priority so is guaranteed to get processor time.\r
* Its main function is to check that all the other tasks are still operational.\r
- * Each task (other than the "flash" tasks) maintains a unique count that is \r
- * incremented each time the task successfully completes its function. Should \r
- * any error occur within such a task the count is permanently halted. The \r
+ * Each task (other than the "flash" tasks) maintains a unique count that is\r
+ * incremented each time the task successfully completes its function. Should\r
+ * any error occur within such a task the count is permanently halted. The\r
* check task inspects the count of each task to ensure it has changed since\r
- * the last time the check task executed. If all the count variables have \r
+ * the last time the check task executed. If all the count variables have\r
* changed all the tasks are still executing error free, and the check task\r
- * toggles the onboard LED. Should any task contain an error at any time \r
+ * toggles the onboard LED. Should any task contain an error at any time\r
* the LED toggle rate will change from 3 seconds to 500ms.\r
*\r
- * To check the operation of the memory allocator the check task also \r
- * dynamically creates a task before delaying, and deletes it again when it \r
+ * To check the operation of the memory allocator the check task also\r
+ * dynamically creates a task before delaying, and deletes it again when it\r
* wakes. If memory cannot be allocated for the new task the call to xTaskCreate\r
* will fail and an error is signalled. The dynamically created task itself\r
* allocates and frees memory just to give the allocator a bit more exercise.\r
*\r
*/\r
\r
-/* \r
+/*\r
Changes from V2.4.2\r
\r
+ The vErrorChecks() task now dynamically creates then deletes a task each\r
cycle. This tests the operation of the memory allocator.\r
\r
Changes from V2.5.2\r
- \r
- + vParTestInitialise() is called during initialisation to ensure all the \r
+\r
+ + vParTestInitialise() is called during initialisation to ensure all the\r
LED's start off.\r
*/\r
\r
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 0 )\r
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
\r
-/* The rate at which the on board LED will toggle when there is/is not an \r
+/* The rate at which the on board LED will toggle when there is/is not an\r
error. */\r
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )\r
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )\r
\r
/*\r
* The Olimex demo board has a single built in LED. This function simply\r
- * toggles its state. \r
+ * toggles its state.\r
*/\r
void prvToggleOnBoardLED( void );\r
\r
static long prvCheckOtherTasksAreStillRunning( unsigned long ulMemCheckTaskCount );\r
\r
/*\r
- * The task that executes at the highest priority and calls \r
+ * The task that executes at the highest priority and calls\r
* prvCheckOtherTasksAreStillRunning(). See the description at the top\r
* of the file.\r
*/\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * Starts all the other tasks, then starts the scheduler. \r
+ * Starts all the other tasks, then starts the scheduler.\r
*/\r
int main( void )\r
{\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
\r
/* Start the check task - which is defined in this file. */\r
- xTaskCreate( vErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Now all the tasks have been started - start the scheduler.\r
\r
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
- The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+ The processor MUST be in supervisor mode when vTaskStartScheduler is\r
called. The demo applications included in the FreeRTOS.org download switch\r
to supervisor mode prior to main being called. If you are not using one of\r
these demo application projects then ensure Supervisor mode is used here. */\r
/* Cycle for ever, delaying then checking all the other tasks are still\r
operating without error. If an error is detected then the delay period\r
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so\r
- the on board LED flash rate will increase. \r
- \r
+ the on board LED flash rate will increase.\r
+\r
In addition to the standard tests the memory allocator is tested through\r
- the dynamic creation and deletion of a task each cycle. Each time the \r
+ the dynamic creation and deletion of a task each cycle. Each time the\r
task is created memory must be allocated for its stack. When the task is\r
- deleted this memory is returned to the heap. If the task cannot be created \r
+ deleted this memory is returned to the heap. If the task cannot be created\r
then it is likely that the memory allocation failed. */\r
\r
for( ;; )\r
{\r
- /* Dynamically create a task - passing ulMemCheckTaskRunningCount as a \r
+ /* Dynamically create a task - passing ulMemCheckTaskRunningCount as a\r
parameter. */\r
ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE;\r
xCreatedTask = mainNO_TASK;\r
\r
- if( xTaskCreate( vMemCheckTask, ( signed char * ) "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
+ if( xTaskCreate( vMemCheckTask, "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
{\r
/* Could not create the task - we have probably run out of heap. */\r
xDelayPeriod = mainERROR_FLASH_PERIOD;\r
\r
/* Delay until it is time to execute again. */\r
vTaskDelay( xDelayPeriod );\r
- \r
+\r
/* Delete the dynamically created task. */\r
if( xCreatedTask != mainNO_TASK )\r
{\r
vTaskDelete( xCreatedTask );\r
}\r
\r
- /* Check all the standard demo application tasks are executing without \r
+ /* Check all the standard demo application tasks are executing without\r
error. ulMemCheckTaskRunningCount is checked to ensure it was\r
modified by the task just deleted. */\r
if( prvCheckOtherTasksAreStillRunning( ulMemCheckTaskRunningCount ) != pdPASS )\r
PCB_PINSEL0 |= mainTX_ENABLE;\r
PCB_PINSEL0 |= mainRX_ENABLE;\r
\r
- /* Set all GPIO to output other than the P0.14 (BSL), and the JTAG pins. \r
- The JTAG pins are left as input as I'm not sure what will happen if the \r
+ /* Set all GPIO to output other than the P0.14 (BSL), and the JTAG pins.\r
+ The JTAG pins are left as input as I'm not sure what will happen if the\r
Wiggler is connected after powerup - not that it would be a good idea to\r
do that anyway. */\r
GPIO_IODIR = ~( mainP0_14 + mainJTAG_PORT );\r
\r
/* Setup the peripheral bus to be the same as the PLL output. */\r
SCB_VPBDIV = mainBUS_CLK_FULL;\r
- \r
+\r
/* Initialise LED outputs. */\r
vParTestInitialise();\r
}\r
else\r
{\r
GPIO_IOSET = mainON_BOARD_LED_BIT;\r
- } \r
+ }\r
}\r
/*-----------------------------------------------------------*/\r
\r
vErrorChecks task to check the operation of the memory allocator. Each time\r
the task is created memory is allocated for the stack and TCB. Each time\r
the task is deleted this memory is returned to the heap. This task itself\r
- exercises the allocator by allocating and freeing blocks. \r
- \r
- The task executes at the idle priority so does not require a delay. \r
- \r
+ exercises the allocator by allocating and freeing blocks.\r
+\r
+ The task executes at the idle priority so does not require a delay.\r
+\r
pulMemCheckTaskRunningCounter is incremented each cycle to indicate to the\r
vErrorChecks() task that this task is still executing without error. */\r
\r
( *pulMemCheckTaskRunningCounter )++;\r
}\r
\r
- /* Allocate some memory - just to give the allocator some extra \r
+ /* Allocate some memory - just to give the allocator some extra\r
exercise. This has to be in a critical section to ensure the\r
task does not get deleted while it has memory allocated. */\r
vTaskSuspendAll();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vStartRecursiveMutexTasks();\r
\r
/* Start the tasks defined within this file. */\r
- xTaskCreate( vLEDTask, ( signed char * ) "LED", configMINIMAL_STACK_SIZE, NULL, mainLED_TASK_PRIORITY, NULL );\r
- xTaskCreate( vCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
- xTaskCreate( vPrintTask, ( signed char * ) "Print", configMINIMAL_STACK_SIZE, NULL, mainPRINT_TASK_PRIORITY, NULL );\r
- xTaskCreate( vButtonHandlerTask, ( signed char * ) "Button", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vLEDTask, "LED", configMINIMAL_STACK_SIZE, NULL, mainLED_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vPrintTask, "Print", configMINIMAL_STACK_SIZE, NULL, mainPRINT_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vButtonHandlerTask, "Button", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
\r
static void vButtonHandlerTask( void *pvParameters )\r
{\r
-static signed char cListBuffer[ mainLIST_BUFFER_SIZE ];\r
-const signed char *pcList = &( cListBuffer[ 0 ] );\r
+static char cListBuffer[ mainLIST_BUFFER_SIZE ];\r
+const char *pcList = &( cListBuffer[ 0 ] );\r
const char * const pcHeader = "\nTask State Priority Stack #\n************************************************";\r
extern void (vButtonISRWrapper) ( void );\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* for messages - waking and displaying the messages as they arrive.\r
*\r
* "Check" hook - This only executes every five seconds from the tick hook.\r
- * Its main function is to check that all the standard demo tasks are still \r
- * operational. Should any unexpected behaviour within a demo task be discovered \r
- * the tick hook will write an error to the LCD (via the LCD task). If all the \r
- * demo tasks are executing with their expected behaviour then the check task \r
+ * Its main function is to check that all the standard demo tasks are still\r
+ * operational. Should any unexpected behaviour within a demo task be discovered\r
+ * the tick hook will write an error to the LCD (via the LCD task). If all the\r
+ * demo tasks are executing with their expected behaviour then the check task\r
* writes PASS to the LCD (again via the LCD task), as described above.\r
*\r
* "uIP" task - This is the task that handles the uIP stack. All TCP/IP\r
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainFLASH_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )\r
-#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY ) \r
+#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
\r
/* Constants to setup the PLL. */\r
#define mainPLL_MUL ( ( unsigned portLONG ) ( 8 - 1 ) )\r
#define mainMAM_TIM_3 ( ( unsigned portCHAR ) 0x03 )\r
#define mainMAM_MODE_FULL ( ( unsigned portCHAR ) 0x02 )\r
\r
-/* \r
+/*\r
* The task that handles the uIP stack. All TCP/IP processing is performed in\r
* this task.\r
*/\r
extern void vuIP_Task( void *pvParameters );\r
\r
/*\r
- * The LCD is written two by more than one task so is controlled by a \r
- * 'gatekeeper' task. This is the only task that is actually permitted to \r
+ * The LCD is written two by more than one task so is controlled by a\r
+ * 'gatekeeper' task. This is the only task that is actually permitted to\r
* access the LCD directly. Other tasks wanting to display a message send\r
* the message to the gatekeeper.\r
*/\r
int main( void )\r
{\r
prvSetupHardware();\r
- \r
+\r
/* Create the queue used by the LCD task. Messages for display on the LCD\r
are received via this queue. */\r
xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( xLCDMessage ) );\r
\r
/* Create the uIP task. This uses the lwIP RTOS abstraction layer.*/\r
- xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
\r
/* Start the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vCreateBlockTimeTasks();\r
vStartLEDFlashTasks( mainFLASH_PRIORITY );\r
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
- vStartQueuePeekTasks(); \r
+ vStartQueuePeekTasks();\r
vStartDynamicPriorityTasks();\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
\r
/* Will only get here if there was insufficient memory to create the idle\r
task. */\r
- return 0; \r
+ return 0;\r
}\r
/*-----------------------------------------------------------*/\r
\r
if( ulTicksSinceLastDisplay >= mainCHECK_DELAY )\r
{\r
ulTicksSinceLastDisplay = 0;\r
- \r
+\r
/* Has an error been found in any task? */\r
\r
if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR - GENQ";\r
}\r
- \r
+\r
if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR - PEEKQ";\r
- } \r
- \r
+ }\r
+\r
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR - DYNAMIC";\r
}\r
- \r
+\r
xMessage.xColumn++;\r
\r
/* Send the message to the LCD gatekeeper for display. */\r
/* Initialise the LCD and display a startup message. */\r
LCD_init();\r
LCD_cur_off();\r
- LCD_cls(); \r
+ LCD_cls();\r
LCD_gotoxy( 1, 1 );\r
LCD_puts( "www.FreeRTOS.org" );\r
\r
{\r
/* Wait for a message to arrive that requires displaying. */\r
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );\r
- \r
+\r
/* Display the message. Print each message to a different position. */\r
LCD_cls();\r
LCD_gotoxy( ( xMessage.xColumn & 0x07 ) + 1, ( xMessage.xColumn & 0x01 ) + 1 );\r
/* Remap the interrupt vectors to RAM if we are are running from RAM. */\r
SCB_MEMMAP = 2;\r
#endif\r
- \r
+\r
/* Disable the PLL. */\r
PLLCON = 0;\r
PLLFEED = mainPLL_FEED_BYTE1;\r
PLLFEED = mainPLL_FEED_BYTE2;\r
- \r
+\r
/* Configure clock source. */\r
SCS |= mainOSC_ENABLE;\r
while( !( SCS & mainOSC_STAT ) );\r
- CLKSRCSEL = mainOSC_SELECT; \r
- \r
+ CLKSRCSEL = mainOSC_SELECT;\r
+\r
/* Setup the PLL to multiply the XTAL input by 4. */\r
PLLCFG = ( mainPLL_MUL | mainPLL_DIV );\r
PLLFEED = mainPLL_FEED_BYTE1;\r
PLLCON = mainPLL_ENABLE;\r
PLLFEED = mainPLL_FEED_BYTE1;\r
PLLFEED = mainPLL_FEED_BYTE2;\r
- CCLKCFG = mainCPU_CLK_DIV; \r
+ CCLKCFG = mainCPU_CLK_DIV;\r
while( !( PLLSTAT & mainPLL_LOCK ) );\r
- \r
+\r
/* Connecting the clock. */\r
PLLCON = mainPLL_CONNECT;\r
PLLFEED = mainPLL_FEED_BYTE1;\r
PLLFEED = mainPLL_FEED_BYTE2;\r
- while( !( PLLSTAT & mainPLL_CONNECTED ) ); \r
- \r
- /* \r
+ while( !( PLLSTAT & mainPLL_CONNECTED ) );\r
+\r
+ /*\r
This code is commented out as the MAM does not work on the original revision\r
LPC2368 chips. If using Rev B chips then you can increase the speed though\r
the use of the MAM.\r
- \r
+\r
Setup and turn on the MAM. Three cycle access is used due to the fast\r
PLL used. It is possible faster overall performance could be obtained by\r
tuning the MAM and PLL settings.\r
MAMTIM = mainMAM_TIM_3;\r
MAMCR = mainMAM_MODE_FULL;\r
*/\r
- \r
+\r
/* Setup the led's on the MCB2300 board */\r
vParTestInitialise();\r
}\r
PSOCK_BEGIN(&s->sout);\r
\r
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);\r
- \r
+\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
closing,\r
time_wait,\r
last_ack};\r
- \r
+\r
\r
static unsigned short\r
generate_tcp_stats(void *arg)\r
{\r
struct uip_conn *conn;\r
struct httpd_state *s = (struct httpd_state *)arg;\r
- \r
+\r
conn = &uip_conns[s->count];\r
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,\r
"<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",\r
static\r
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))\r
{\r
- \r
+\r
PSOCK_BEGIN(&s->sout);\r
\r
for(s->count = 0; s->count < UIP_CONNS; ++s->count) {\r
++s->count) {\r
PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);\r
}\r
- \r
+\r
#endif /* UIP_STATISTICS */\r
- \r
+\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
static unsigned short\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %ld", lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
- \r
+\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
PT_THREAD(rtos_stats(struct httpd_state *s, char *ptr))\r
{\r
PSOCK_BEGIN(&s->sout);\r
- PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL); \r
+ PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
"<input type=\"checkbox\" name=\"LED2\" value=\"1\" %s>LED 2.7"\\r
"<p>"\\r
"<input type=\"text\" name=\"LCD\" value=\"Enter LCD text\" size=\"16\">",\r
- pcStatus[ 0 ], \r
- pcStatus[ 1 ], \r
+ pcStatus[ 0 ],\r
+ pcStatus[ 1 ],\r
pcStatus[ 2 ] );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
static void vCheckTask( void *pvParameters );\r
\r
-/* \r
+/*\r
* The task that handles the uIP stack. All TCP/IP processing is performed in\r
* this task.\r
*/\r
extern void vuIP_Task( void *pvParameters );\r
\r
/*\r
- * The LCD is written two by more than one task so is controlled by a \r
- * 'gatekeeper' task. This is the only task that is actually permitted to \r
+ * The LCD is written two by more than one task so is controlled by a\r
+ * 'gatekeeper' task. This is the only task that is actually permitted to\r
* access the LCD directly. Other tasks wanting to display a message send\r
* the message to the gatekeeper.\r
*/\r
xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( xLCDMessage ) );\r
\r
/* Create the lwIP task. This uses the lwIP RTOS abstraction layer.*/\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
\r
/* Start the standard demo tasks - these serve no useful purpose other than\r
to demonstrate the FreeRTOS API being used and to test the port. */\r
vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( vCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
- xTaskCreate( vLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
\r
/* Will only get here if there was insufficient memory to create the idle\r
task. */\r
- return 0; \r
+ return 0;\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Initialise the LCD and display a startup message. */\r
LCD_init();\r
LCD_cur_off();\r
- LCD_cls(); \r
+ LCD_cls();\r
LCD_gotoxy( 1, 1 );\r
LCD_puts( ( signed char * ) "www.FreeRTOS.org" );\r
\r
{\r
/* Wait for a message to arrive that requires displaying. */\r
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );\r
- \r
+\r
/* Display the message. Print each message to a different position. */\r
LCD_cls();\r
LCD_gotoxy( ( xMessage.xColumn & 0x07 ) + 1, ( xMessage.xColumn & 0x01 ) + 1 );\r
PSOCK_BEGIN(&s->sout);\r
\r
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);\r
- \r
+\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
closing,\r
time_wait,\r
last_ack};\r
- \r
+\r
\r
static unsigned short\r
generate_tcp_stats(void *arg)\r
{\r
struct uip_conn *conn;\r
struct httpd_state *s = (struct httpd_state *)arg;\r
- \r
+\r
conn = &uip_conns[s->count];\r
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,\r
"<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",\r
static\r
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))\r
{\r
- \r
+\r
PSOCK_BEGIN(&s->sout);\r
\r
for(s->count = 0; s->count < UIP_CONNS; ++s->count) {\r
++s->count) {\r
PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);\r
}\r
- \r
+\r
#endif /* UIP_STATISTICS */\r
- \r
+\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
static unsigned short\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
- \r
+\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
PT_THREAD(rtos_stats(struct httpd_state *s, char *ptr))\r
{\r
PSOCK_BEGIN(&s->sout);\r
- PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL); \r
+ PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
"<input type=\"checkbox\" name=\"LED2\" value=\"1\" %s>LED 2.7"\\r
"<p>"\\r
"<input type=\"text\" name=\"LCD\" value=\"Enter LCD text\" size=\"16\">",\r
- pcStatus[ 0 ], \r
- pcStatus[ 1 ], \r
+ pcStatus[ 0 ],\r
+ pcStatus[ 1 ],\r
pcStatus[ 2 ] );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vParTestInitialise();\r
\r
/* Create the queue used to communicate with the LCD print task. */\r
- xLCDQueue = xQueueCreate( mainLCD_QUEUE_LENGTH, sizeof( LCDMessage ) ); \r
- \r
+ xLCDQueue = xQueueCreate( mainLCD_QUEUE_LENGTH, sizeof( LCDMessage ) );\r
+\r
/* Create the standard demo application tasks. See the WEB documentation\r
for more information on these tasks. */\r
vCreateBlockTimeTasks();\r
vStartDynamicPriorityTasks();\r
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
- \r
+\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( vPrintTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );\r
- xTaskCreate( vCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
- \r
+ xTaskCreate( vPrintTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+\r
vTaskStartScheduler();\r
- \r
+\r
/* Execution will only reach here if there was insufficient heap to\r
start the scheduler. */\r
return 0;\r
\r
static void vCheckTask( void *pvParameters )\r
{\r
-static unsigned long ulErrorDetected = pdFALSE; \r
+static unsigned long ulErrorDetected = pdFALSE;\r
portTickType xLastExecutionTime;\r
unsigned char *ucErrorMessage = ( unsigned char * )" FAIL";\r
unsigned char *ucSuccessMessage = ( unsigned char * )" PASS";\r
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_TASK_CYCLE_TIME );\r
\r
/* Has an error been found in any of the standard demo tasks? */\r
- \r
+\r
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
{\r
ulErrorDetected = pdTRUE;\r
{\r
ulErrorDetected = pdTRUE;\r
}\r
- \r
+\r
if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
ulErrorDetected = pdTRUE;\r
- } \r
- \r
+ }\r
+\r
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
{\r
ulErrorDetected = pdTRUE;\r
- } \r
- \r
+ }\r
+\r
/* Calculate the LCD line on which we would like the message to\r
be displayed. The column variable is used for convenience as\r
it is incremented each cycle anyway. */\r
/* The message displayed depends on whether an error was found or\r
not. Any discovered error is latched. Here the column variable\r
is used as an index into the text string as a simple way of moving\r
- the text from column to column. */ \r
+ the text from column to column. */\r
if( ulErrorDetected == pdFALSE )\r
{\r
xMessage.pucString = ucSuccessMessage + uxColumn;\r
}\r
else\r
{\r
- xMessage.pucString = ucErrorMessage + uxColumn; \r
- } \r
+ xMessage.pucString = ucErrorMessage + uxColumn;\r
+ }\r
\r
/* Send the message to the print task for display. */\r
xQueueSend( xLCDQueue, ( void * ) &xMessage, mainNO_DELAY );\r
- \r
+\r
/* Make sure the message is printed in a different column the next\r
time around. */\r
uxColumn--;\r
{\r
/* Wait until a message arrives. */\r
while( xQueueReceive( xLCDQueue, ( void * ) &xMessage, portMAX_DELAY ) != pdPASS );\r
- \r
+\r
/* The message contains the text to display, and the line on which the\r
text should be displayed. */\r
LCD_Clear();\r
\r
static void prvSetupHardware(void)\r
{\r
-ErrorStatus OSC4MStartUpStatus01; \r
+ErrorStatus OSC4MStartUpStatus01;\r
\r
/* ST provided routine. */\r
\r
/* MRCC system reset */\r
MRCC_DeInit();\r
- \r
+\r
/* Wait for OSC4M start-up */\r
OSC4MStartUpStatus01 = MRCC_WaitForOSC4MStartUp();\r
- \r
+\r
if(OSC4MStartUpStatus01 == SUCCESS)\r
{\r
/* Set HCLK to 60MHz */\r
MRCC_HCLKConfig(MRCC_CKSYS_Div1);\r
- \r
+\r
/* Set CKTIM to 60MHz */\r
MRCC_CKTIMConfig(MRCC_HCLK_Div1);\r
- \r
+\r
/* Set PCLK to 30MHz */\r
MRCC_PCLKConfig(MRCC_CKTIM_Div2);\r
- \r
+\r
/* Enable Flash Burst mode */\r
CFG_FLASHBurstConfig(CFG_FLASHBurst_Enable);\r
- \r
+\r
/* Set CK_SYS to 60 MHz */\r
MRCC_CKSYSConfig(MRCC_CKSYS_OSC4MPLL, MRCC_PLL_Mul_15);\r
}\r
- \r
+\r
/* GPIO pins optimized for 3V3 operation */\r
MRCC_IOVoltageRangeConfig(MRCC_IOVoltageRange_3V3);\r
- \r
+\r
/* GPIO clock source enable */\r
MRCC_PeripheralClockConfig(MRCC_Peripheral_GPIO, ENABLE);\r
- \r
+\r
/* EXTIT clock source enable */\r
MRCC_PeripheralClockConfig(MRCC_Peripheral_EXTIT, ENABLE);\r
/* TB clock source enable */\r
MRCC_PeripheralClockConfig(MRCC_Peripheral_TB, ENABLE);\r
- \r
+\r
/* Initialize the demonstration menu */\r
LCD_Init();\r
- \r
+\r
LCD_DisplayString(Line1, ( unsigned char * ) "www.FreeRTOS.org", BlackText);\r
LCD_DisplayString(Line2, ( unsigned char * ) " STR750 Demo ", BlackText);\r
- \r
+\r
EIC_IRQCmd(ENABLE);\r
}\r
/*-----------------------------------------------------------*/\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vParTestInitialise();\r
\r
/* Create the queue used to communicate with the LCD print task. */\r
- xLCDQueue = xQueueCreate( mainLCD_QUEUE_LENGTH, sizeof( LCDMessage ) ); \r
- \r
+ xLCDQueue = xQueueCreate( mainLCD_QUEUE_LENGTH, sizeof( LCDMessage ) );\r
+\r
/* Create the standard demo application tasks. See the WEB documentation\r
for more information on these tasks. */\r
vCreateBlockTimeTasks();\r
vStartDynamicPriorityTasks();\r
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
- \r
+\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( vPrintTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );\r
- xTaskCreate( vCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
- \r
+ xTaskCreate( vPrintTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+\r
vTaskStartScheduler();\r
- \r
+\r
/* Execution will only reach here if there was insufficient heap to\r
start the scheduler. */\r
}\r
\r
static void vCheckTask( void *pvParameters )\r
{\r
-static unsigned long ulErrorDetected = pdFALSE; \r
+static unsigned long ulErrorDetected = pdFALSE;\r
portTickType xLastExecutionTime;\r
unsigned char *cErrorMessage = " FAIL";\r
unsigned char *cSuccessMessage = " PASS";\r
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_TASK_CYCLE_TIME );\r
\r
/* Has an error been found in any of the standard demo tasks? */\r
- \r
+\r
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
{\r
ulErrorDetected = pdTRUE;\r
{\r
ulErrorDetected = pdTRUE;\r
}\r
- \r
+\r
if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
ulErrorDetected = pdTRUE;\r
- } \r
- \r
+ }\r
+\r
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
{\r
ulErrorDetected = pdTRUE;\r
- } \r
- \r
+ }\r
+\r
/* Calculate the LCD line on which we would like the message to\r
be displayed. The column variable is used for convenience as\r
it is incremented each cycle anyway. */\r
/* The message displayed depends on whether an error was found or\r
not. Any discovered error is latched. Here the column variable\r
is used as an index into the text string as a simple way of moving\r
- the text from column to column. */ \r
+ the text from column to column. */\r
if( ulErrorDetected == pdFALSE )\r
{\r
xMessage.pucString = cSuccessMessage + uxColumn;\r
}\r
else\r
{\r
- xMessage.pucString = cErrorMessage + uxColumn; \r
- } \r
+ xMessage.pucString = cErrorMessage + uxColumn;\r
+ }\r
\r
/* Send the message to the print task for display. */\r
xQueueSend( xLCDQueue, ( void * ) &xMessage, mainNO_DELAY );\r
- \r
+\r
/* Make sure the message is printed in a different column the next\r
time around. */\r
uxColumn--;\r
{\r
/* Wait until a message arrives. */\r
while( xQueueReceive( xLCDQueue, ( void * ) &xMessage, portMAX_DELAY ) != pdPASS );\r
- \r
+\r
/* The message contains the text to display, and the line on which the\r
text should be displayed. */\r
LCD_Clear();\r
\r
static void prvSetupHardware(void)\r
{\r
-ErrorStatus OSC4MStartUpStatus01; \r
+ErrorStatus OSC4MStartUpStatus01;\r
\r
/* ST provided routine. */\r
\r
/* MRCC system reset */\r
MRCC_DeInit();\r
- \r
+\r
/* Wait for OSC4M start-up */\r
OSC4MStartUpStatus01 = MRCC_WaitForOSC4MStartUp();\r
- \r
+\r
if(OSC4MStartUpStatus01 == SUCCESS)\r
{\r
/* Set HCLK to 60MHz */\r
MRCC_HCLKConfig(MRCC_CKSYS_Div1);\r
- \r
+\r
/* Set CKTIM to 60MHz */\r
MRCC_CKTIMConfig(MRCC_HCLK_Div1);\r
- \r
+\r
/* Set PCLK to 30MHz */\r
MRCC_PCLKConfig(MRCC_CKTIM_Div2);\r
- \r
+\r
/* Enable Flash Burst mode */\r
CFG_FLASHBurstConfig(CFG_FLASHBurst_Enable);\r
- \r
+\r
/* Set CK_SYS to 60 MHz */\r
MRCC_CKSYSConfig(MRCC_CKSYS_OSC4MPLL, MRCC_PLL_Mul_15);\r
}\r
- \r
+\r
/* GPIO pins optimized for 3V3 operation */\r
MRCC_IOVoltageRangeConfig(MRCC_IOVoltageRange_3V3);\r
- \r
+\r
/* GPIO clock source enable */\r
MRCC_PeripheralClockConfig(MRCC_Peripheral_GPIO, ENABLE);\r
- \r
+\r
/* EXTIT clock source enable */\r
MRCC_PeripheralClockConfig(MRCC_Peripheral_EXTIT, ENABLE);\r
/* TB clock source enable */\r
MRCC_PeripheralClockConfig(MRCC_Peripheral_TB, ENABLE);\r
- \r
+\r
/* Initialize the demonstration menu */\r
LCD_Init();\r
- \r
+\r
LCD_DisplayString(Line1, "www.FreeRTOS.org", BlackText);\r
LCD_DisplayString(Line2, " STR750 Demo ", BlackText);\r
- \r
+\r
EIC_IRQCmd(ENABLE);\r
}\r
/*-----------------------------------------------------------*/\r
{\r
msg = &dummyptr;\r
}\r
- \r
+\r
if( timeout != 0 )\r
{\r
if(pdTRUE == xQueueReceive( mbox, &(*msg), timeout ) )\r
{\r
Elapsed = 1;\r
}\r
- return ( Elapsed ); // return time blocked TBD test \r
+ return ( Elapsed ); // return time blocked TBD test\r
}\r
}\r
\r
{\r
Elapsed = 1;\r
}\r
- return (Elapsed); // return time blocked TBD test \r
+ return (Elapsed); // return time blocked TBD test\r
}\r
else\r
{\r
Elapsed = 1;\r
}\r
\r
- return ( Elapsed ); // return time blocked \r
- \r
+ return ( Elapsed ); // return time blocked\r
+\r
}\r
}\r
\r
\r
// keep track of how many threads have been created\r
nextthread = 0;\r
- \r
+\r
s_sys_arch_state.nTaskCount = 0;\r
sys_set_default_state();\r
}\r
xTaskHandle CreatedTask;\r
int result;\r
\r
- result = xTaskCreate(thread, ( signed char * ) s_sys_arch_state.cTaskName, s_sys_arch_state.nStackDepth, arg, prio, &CreatedTask );\r
+ result = xTaskCreate(thread, s_sys_arch_state.cTaskName, s_sys_arch_state.nStackDepth, arg, prio, &CreatedTask );\r
\r
// For each task created, store the task handle (pid) in the timers array.\r
// This scheme doesn't allow for threads to be deleted\r
if(result == pdPASS)\r
{\r
++s_sys_arch_state.nTaskCount;\r
- \r
+\r
return CreatedTask;\r
}\r
else\r
ENET_InitClocksGPIO();\r
ENET_Init();\r
ENET_Start();\r
- \r
+\r
portENTER_CRITICAL();\r
{\r
/*set MAC physical*/\r
ENET_MAC->MAH = (MAC_ADDR5<<8) + MAC_ADDR4;\r
ENET_MAC->MAL = (MAC_ADDR3<<24) + (MAC_ADDR2<<16) + (MAC_ADDR1<<8) + MAC_ADDR0;\r
- \r
+\r
VIC_Config( ENET_ITLine, VIC_IRQ, 1 );\r
- VIC_ITCmd( ENET_ITLine, ENABLE ); \r
+ VIC_ITCmd( ENET_ITLine, ENABLE );\r
ENET_DMA->ISR = DMI_RX_CURRENT_DONE;\r
ENET_DMA->IER = DMI_RX_CURRENT_DONE;\r
}\r
portEXIT_CRITICAL();\r
\r
/* Create the task that handles the EMAC. */\r
- xTaskCreate( ethernetif_input, ( signed char * ) "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );\r
-} \r
+ xTaskCreate( ethernetif_input, "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );\r
+}\r
\r
\r
/*\r
do\r
{\r
ethernetif = s_pxNetIf->state;\r
- \r
+\r
/* move received packet into a new pbuf */\r
p = low_level_input( s_pxNetIf );\r
- \r
+\r
if( p == NULL )\r
{\r
/* No packet could be read. Wait a for an interrupt to tell us\r
there is more data available. */\r
vEMACWaitForInput();\r
}\r
- \r
+\r
} while( p == NULL );\r
\r
/* points to packet payload, which starts with an Ethernet header */\r
/* pass to network layer */\r
s_pxNetIf->input(p, s_pxNetIf);\r
break;\r
- \r
+\r
case ETHTYPE_ARP:\r
/* pass p to ARP module */\r
etharp_arp_input(s_pxNetIf, ethernetif->ethaddr, p);\r
break;\r
- \r
+\r
default:\r
pbuf_free(p);\r
p = NULL;\r
netif->ifoutnucastpkts = 0;\r
netif->ifoutdiscards = 0;\r
#endif\r
- \r
+\r
netif->state = ethernetif;\r
netif->name[0] = IFNAME0;\r
netif->name[1] = IFNAME1;\r
\r
/* Give the semaphore in case the lwIP task needs waking. */\r
xSemaphoreGiveFromISR( s_xSemaphore, &xHigherPriorityTaskWoken );\r
- \r
+\r
/* Clear the interrupt. */\r
ENET_DMA->ISR = DMI_RX_CURRENT_DONE;\r
- \r
- /* Switch tasks if necessary. */ \r
+\r
+ /* Switch tasks if necessary. */\r
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r
/*-----------------------------------------------------------*/\r
PSOCK_BEGIN(&s->sout);\r
\r
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);\r
- \r
+\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
closing,\r
time_wait,\r
last_ack};\r
- \r
+\r
\r
static unsigned short\r
generate_tcp_stats(void *arg)\r
{\r
struct uip_conn *conn;\r
struct httpd_state *s = (struct httpd_state *)arg;\r
- \r
+\r
conn = &uip_conns[s->count];\r
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,\r
"<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",\r
static\r
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))\r
{\r
- \r
+\r
PSOCK_BEGIN(&s->sout);\r
\r
for(s->count = 0; s->count < UIP_CONNS; ++s->count) {\r
++s->count) {\r
PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);\r
}\r
- \r
+\r
#endif /* UIP_STATISTICS */\r
- \r
+\r
PSOCK_END(&s->sout);\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
static unsigned short\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
- \r
+\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
PSOCK_BEGIN(&s->sout);\r
// for( s->count = 0; s->count < 4; ++s->count )\r
// {\r
- PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL); \r
+ PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);\r
// }\r
PSOCK_END(&s->sout);\r
}\r
*****************************************************************************/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
task as described at the top of this file. */\r
xTaskCreate(\r
vErrorChecks\r
- , (const signed portCHAR *)"ErrCheck"\r
+ , "ErrCheck"\r
, configMINIMAL_STACK_SIZE\r
, NULL\r
, mainCHECK_TASK_PRIORITY\r
ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE;\r
\r
if( xTaskCreate( vMemCheckTask,\r
- ( signed portCHAR * ) "MEM_CHECK",\r
+ "MEM_CHECK",\r
configMINIMAL_STACK_SIZE,\r
( void * ) &ulMemCheckTaskRunningCount,\r
tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
* Creates all the demo application tasks, then starts the scheduler. The WEB\r
* documentation provides more details of the demo application tasks.\r
- * \r
- * Main. c also creates a task called "Check". This only executes every three \r
- * seconds but has the highest priority so is guaranteed to get processor time. \r
- * Its main function is to check that all the other tasks are still operational. \r
- * Each task that does not flash an LED maintains a unique count that is \r
- * incremented each time the task successfully completes its function. Should \r
- * any error occur within such a task the count is permanently halted. The \r
+ *\r
+ * Main. c also creates a task called "Check". This only executes every three\r
+ * seconds but has the highest priority so is guaranteed to get processor time.\r
+ * Its main function is to check that all the other tasks are still operational.\r
+ * Each task that does not flash an LED maintains a unique count that is\r
+ * incremented each time the task successfully completes its function. Should\r
+ * any error occur within such a task the count is permanently halted. The\r
* check task inspects the count of each task to ensure it has changed since\r
- * the last time the check task executed. If all the count variables have \r
+ * the last time the check task executed. If all the count variables have\r
* changed all the tasks are still executing error free, and the check task\r
* toggles an LED. Should any task contain an error at any time the LED toggle\r
* will stop.\r
\r
/*\r
Changes from V1.2.0\r
- \r
+\r
+ Changed the baud rate for the serial test from 19200 to 57600.\r
\r
Changes from V1.2.3\r
\r
- + The integer and comtest tasks are now used when the cooperative scheduler \r
+ + The integer and comtest tasks are now used when the cooperative scheduler\r
is being used. Previously they were only used with the preemptive\r
scheduler.\r
\r
\r
#ifdef GCC_MEGA_AVR\r
/* EEPROM routines used only with the WinAVR compiler. */\r
- #include <avr/eeprom.h> \r
+ #include <avr/eeprom.h>\r
#endif\r
\r
/* Scheduler include files. */\r
\r
/*\r
* Checks the unique counts of other tasks to ensure they are still operational.\r
- * Flashes an LED if everything is okay. \r
+ * Flashes an LED if everything is okay.\r
*/\r
static void prvCheckOtherTasksAreStillRunning( void );\r
\r
/*\r
- * Called on boot to increment a count stored in the EEPROM. This is used to \r
+ * Called on boot to increment a count stored in the EEPROM. This is used to\r
* ensure the CPU does not reset unexpectedly.\r
*/\r
static void prvIncrementResetCount( void );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartRegTestTasks();\r
- \r
+\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( vErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Create the co-routines that flash the LED's. */\r
vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );\r
- \r
- /* In this port, to use preemptive scheduler define configUSE_PREEMPTION \r
- as 1 in portmacro.h. To use the cooperative scheduler define \r
+\r
+ /* In this port, to use preemptive scheduler define configUSE_PREEMPTION\r
+ as 1 in portmacro.h. To use the cooperative scheduler define\r
configUSE_PREEMPTION as 0. */\r
vTaskStartScheduler();\r
\r
{\r
vTaskDelay( mainCHECK_PERIOD );\r
\r
- /* Perform a bit of 32bit maths to ensure the registers used by the \r
- integer tasks get some exercise. The result here is not important - \r
+ /* Perform a bit of 32bit maths to ensure the registers used by the\r
+ integer tasks get some exercise. The result here is not important -\r
see the demo application documentation for more info. */\r
ulDummyVariable *= 3;\r
- \r
+\r
prvCheckOtherTasksAreStillRunning();\r
}\r
}\r
{\r
xErrorHasOccurred = pdTRUE;\r
}\r
- \r
+\r
if( xErrorHasOccurred == pdFALSE )\r
{\r
/* Toggle the LED if everything is okay so we know if an error occurs even if not\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
void vStartRegTestTasks( void )\r
{\r
- xTaskCreate( prvRegisterCheck1, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegisterCheck2, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); \r
+ xTaskCreate( prvRegisterCheck1, "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegisterCheck2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
xReturn = pdFALSE;\r
}\r
- \r
+\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
for( ;; )\r
{\r
- asm( "LDI r31, 5" ); \r
+ asm( "LDI r31, 5" );\r
asm( "MOV r0, r31" );\r
asm( "LDI r31, 6" );\r
asm( "MOV r1, r31" );\r
\r
for( ;; )\r
{\r
- asm( "LDI r31, 1" ); \r
+ asm( "LDI r31, 1" );\r
asm( "MOV r0, r31" );\r
asm( "LDI r31, 2" );\r
asm( "MOV r1, r31" );\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
pcStatus = "";\r
}\r
\r
- usRawVoltage = ( unsigned short ) ACE_get_ppe_sample( xVoltageChannel ); \r
+ usRawVoltage = ( unsigned short ) ACE_get_ppe_sample( xVoltageChannel );\r
sprintf( uip_appdata, "<input type=\"checkbox\" name=\"LED0\" value=\"1\" %s>LED<p><p><p>Raw voltage input is %d", pcStatus, usRawVoltage );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static unsigned short generate_runtime_stats( void *arg )\r
{\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
- vTaskGetRunTimeStats( uip_appdata );\r
+\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- vLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ vLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Start the tasks and timer running. */\r
{\r
/* Start the three application specific demo tasks, as described in the\r
comments at the top of this file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvOLEDTask, ( signed char * ) "OLED", configMINIMAL_STACK_SIZE, NULL, mainOLED_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvOLEDTask, "OLED", configMINIMAL_STACK_SIZE, NULL, mainOLED_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* Create a lot of 'standard demo' tasks. */\r
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
\r
/* Create the web server task. */\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be created last, as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
xEMACEventQueue = xQueueCreate( uipEVENT_QUEUE_LENGTH, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( signed char * ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( signed char * ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 500UL / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
pcStatus = "";\r
}\r
\r
- usRawVoltage = ( unsigned short ) ACE_get_ppe_sample( xVoltageChannel ); \r
+ usRawVoltage = ( unsigned short ) ACE_get_ppe_sample( xVoltageChannel );\r
sprintf( uip_appdata, "<input type=\"checkbox\" name=\"LED0\" value=\"1\" %s>LED<p><p><p>Raw voltage input is %d", pcStatus, usRawVoltage );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static unsigned short generate_runtime_stats( void *arg )\r
{\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
- vTaskGetRunTimeStats( uip_appdata );\r
+\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- vLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( 5000 / portTICK_RATE_MS ),/* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ vLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Start the tasks and timer running. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Start the three application specific demo tasks, as described in the\r
comments at the top of this file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvOLEDTask, ( signed char * ) "OLED", configMINIMAL_STACK_SIZE, NULL, mainOLED_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvOLEDTask, "OLED", configMINIMAL_STACK_SIZE, NULL, mainOLED_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* Create a lot of 'standard demo' tasks. */\r
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
\r
/* Create the web server task. */\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
- \r
+ xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
+\r
/* The suicide tasks must be created last, as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
or not the correct/expected number of tasks are running at any given\r
\r
/* The timer command queue will have been filled when the timer test tasks\r
were created in main() (this is part of the test they perform). Therefore,\r
- while the check timer can be created in main(), it cannot be started from \r
- main(). Once the scheduler has started, the timer service task will drain \r
+ while the check timer can be created in main(), it cannot be started from\r
+ main(). Once the scheduler has started, the timer service task will drain\r
the command queue, and now the check timer can be started successfully. */\r
xTimerStart( xCheckTimer, portMAX_DELAY );\r
\r
{\r
/* Wait until it is time to update the OLED again. */\r
vTaskDelayUntil( &xLastScrollTime, mainOLED_PERIOD_MS );\r
- \r
+\r
xOLEDData.char_offset1 = ucOffset1++;\r
xOLEDData.char_offset2 = ucOffset2++;\r
- \r
+\r
OLED_write_data( &xOLEDData, BOTH_LINES );\r
}\r
}\r
static void prvSetupHardware( void )\r
{\r
SystemCoreClockUpdate();\r
- \r
+\r
/* Disable the Watch Dog Timer */\r
MSS_WD_disable( );\r
\r
/* Configure the GPIO for the LEDs. */\r
vParTestInitialise();\r
- \r
+\r
/* ACE Initialization */\r
ACE_init();\r
\r
\r
pulHighWord = ( unsigned long * ) &ullCurrentValue;\r
pulLowWord = pulHighWord++;\r
- \r
+\r
MSS_TIM64_get_current_value( ( uint32_t * ) pulHighWord, ( uint32_t * ) pulLowWord );\r
- \r
+\r
/* Convert the down count into an upcount. */\r
ullCurrentValue = ulMax64BitValue - ullCurrentValue;\r
- \r
+\r
/* Scale to a 32bit number of suitable frequency. */\r
ullCurrentValue >>= 13;\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
if( ( lPacketLength > 0 ) && ( uip_buf != NULL ) )\r
{\r
uip_len = ( u16_t ) lPacketLength;\r
- \r
+\r
/* Standard uIP loop taken from the uIP manual. */\r
if( xHeader->type == htons( UIP_ETHTYPE_IP ) )\r
{\r
for( i = 0; i < UIP_CONNS; i++ )\r
{\r
uip_periodic( i );\r
- \r
+\r
/* If the above function invocation resulted in data that\r
should be sent out on the network, the global variable\r
uip_len is set to a value > 0. */\r
xEMACEventQueue = xQueueCreate( uipEVENT_QUEUE_LENGTH, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( signed char * ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( signed char * ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 500UL / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
\r
/* Only interested in processing form input if this is the IO page. */\r
c = strstr( pcInputString, "io.shtml" );\r
- \r
+\r
if( c )\r
{\r
/* Is there a command in the string? */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
- configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
- NULL, /* The parameter passed to the task - not used in this case. */\r
- mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
- NULL ); /* The task handle is not required, so NULL is passed. */\r
-\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
+ NULL, /* The parameter passed to the task - not used in this case. */\r
+ mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
+ NULL ); /* The task handle is not required, so NULL is passed. */\r
+\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
\r
static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *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
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
- vTaskList( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+ strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
+ vTaskList( pcWriteBuffer + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
\r
static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *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
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
- vTaskGetRunTimeStats( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+ strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
+ vTaskGetRunTimeStats( ( ( char * ) pcWriteBuffer ) + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Create the register check tasks, as described at the top of this\r
file */\r
- xTaskCreate( prvRegTestTaskEntry1, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTestTaskEntry2, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTaskEntry1, "Reg1", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTaskEntry2, "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the task that performs the 'check' functionality, as described at\r
the top of this file. */\r
- xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The set of tasks created by the following function call have to be\r
created last as they keep account of the number of tasks they expect to see\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
port and provide some APU usage examples. */\r
vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );\r
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
- vStartRecursiveMutexTasks(); \r
+ vStartRecursiveMutexTasks();\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vCreateBlockTimeTasks();\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
- vStartQueuePeekTasks(); \r
- vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); \r
+ vStartQueuePeekTasks();\r
+ vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_RATE, mainCOM_TEST_LED );\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( prvLCDTask, ( signed char * ) "LCD", mainLCD_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvLCDTask, "LCD", mainLCD_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
if( ulTicksSinceLastDisplay >= mainCHECK_DELAY )\r
{\r
ulTicksSinceLastDisplay = 0;\r
- \r
+\r
/* Has an error been found in any task? */\r
if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
{\r
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR IN PEEK Q";\r
- } \r
+ }\r
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR IN REC MUTEX";\r
- } \r
+ }\r
else if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR IN COMTEST";\r
}\r
- \r
+\r
/* Send the message to the LCD gatekeeper for display. */\r
xHigherPriorityTaskWoken = pdFALSE;\r
xQueueSendFromISR( xLCDQueue, &xMessage, &xHigherPriorityTaskWoken );\r
\r
/* Initialize LCD. */\r
LCDD_Initialize();\r
- LCDD_Start(); \r
+ LCDD_Start();\r
LCDD_Fill( ( void * ) BOARD_LCD_BASE, COLOR_WHITE );\r
LCDD_DrawString( ( void * ) BOARD_LCD_BASE, 1, ulY + 3, " www.FreeRTOS.org", COLOR_BLACK );\r
- \r
+\r
for( ;; )\r
{\r
/* Wait for a message from the check function (which is executed in\r
\r
/* Clear the space where the old message was. */\r
LCDD_DrawRectangle( ( void * ) BOARD_LCD_BASE, 0, ulY, ulWidth, ulHeight, COLOR_WHITE );\r
- \r
+\r
/* Increment to the next drawing position. */\r
ulY += ulYIncrement;\r
- \r
+\r
/* Have the Y position moved past the end of the LCD? */\r
if( ulY >= ulMaxY )\r
{\r
\r
/* Draw a new rectangle, in which the message will be written. */\r
LCDD_DrawRectangle( ( void * ) BOARD_LCD_BASE, 0, ulY, ulWidth, ulHeight, COLOR_GREEN );\r
- \r
+\r
/* Write the message. */\r
LCDD_DrawString( ( void * ) BOARD_LCD_BASE, ulX, ulY + 3, xMessage.pcMessage, COLOR_BLACK );\r
}\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
xSerialPortInitMinimal( ulBaudRate, comBUFFER_LEN );\r
\r
/* The Tx task is spawned with a lower priority than the Rx task. */\r
- xTaskCreate( vComTxTask, ( signed char * ) "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );\r
- xTaskCreate( vComRxTask, ( signed char * ) "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vComTxTask, "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
the queue empty. */\r
#define mainQUEUE_LENGTH ( 1 )\r
\r
-/* Values passed to the two tasks just to check the task parameter \r
+/* Values passed to the two tasks just to check the task parameter\r
functionality. */\r
#define mainQUEUE_SEND_PARAMETER ( 0x1111UL )\r
#define mainQUEUE_RECEIVE_PARAMETER ( 0x22UL )\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
******************************************************************************\r
*\r
* main_full() creates all the demo application tasks and a software timer, then\r
- * starts the scheduler. The web documentation provides more details of the \r
- * standard demo application tasks, which provide no particular functionality, \r
+ * starts the scheduler. The web documentation provides more details of the\r
+ * standard demo application tasks, which provide no particular functionality,\r
* but do provide a good example of how to use the FreeRTOS API.\r
*\r
* In addition to the standard demo tasks, the following tasks and tests are\r
*\r
* "Check" timer - The check software timer period is initially set to three\r
* seconds. The callback function associated with the check software timer\r
- * checks that all the standard demo tasks are not only still executing, but \r
- * are executing without reporting any errors. If the check software timer \r
- * discovers that a task has either stalled, or reported an error, then it \r
- * changes its own execution period from the initial three seconds, to just \r
- * 200ms. The check software timer callback function also toggles the green \r
- * LED each time it is called. This provides a visual indication of the system \r
- * status: If the green LED toggles every three seconds, then no issues have \r
- * been discovered. If the green LED toggles every 200ms, then an issue has \r
+ * checks that all the standard demo tasks are not only still executing, but\r
+ * are executing without reporting any errors. If the check software timer\r
+ * discovers that a task has either stalled, or reported an error, then it\r
+ * changes its own execution period from the initial three seconds, to just\r
+ * 200ms. The check software timer callback function also toggles the green\r
+ * LED each time it is called. This provides a visual indication of the system\r
+ * status: If the green LED toggles every three seconds, then no issues have\r
+ * been discovered. If the green LED toggles every 200ms, then an issue has\r
* been discovered with at least one task.\r
*\r
* See the documentation page for this demo on the FreeRTOS.org web site for\r
- * full information, including hardware setup requirements. \r
+ * full information, including hardware setup requirements.\r
*/\r
\r
/* Standard includes. */\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
vStartLEDFlashTimers( mainNUMBER_OF_FLASH_TIMERS_LEDS );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
- \r
+\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
if( xCheckTimer != NULL )\r
{\r
xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
}\r
\r
- /* The set of tasks created by the following function call have to be \r
- created last as they keep account of the number of tasks they expect to see \r
+ /* The set of tasks created by the following function call have to be\r
+ created last as they keep account of the number of tasks they expect to see\r
running. */\r
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* If all is well, the scheduler will now be running, and the following line\r
will never be reached. If the following line does execute, then there was\r
insufficient FreeRTOS heap memory available for the idle and/or timer tasks\r
to be created. See the memory management section on the FreeRTOS web site\r
for more details. */\r
- for( ;; ); \r
+ for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
ulErrorFound = pdTRUE;\r
}\r
- \r
+\r
if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
ulErrorFound = pdTRUE;\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
vParTestToggleLED( mainCHECK_LED );\r
- \r
+\r
/* Have any errors been latch in ulErrorFound? If so, shorten the\r
period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.\r
This will result in an increase in the rate at which mainCHECK_LED\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
+\r
/* This call to xTimerChangePeriod() uses a zero block time.\r
Functions called from inside of a timer callback function must\r
*never* attempt to block. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
xSerialPortInitMinimal( ulBaudRate, comBUFFER_LEN );\r
\r
/* The Tx task is spawned with a lower priority than the Rx task. */\r
- xTaskCreate( vComTxTask, ( signed char * ) "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );\r
- xTaskCreate( vComRxTask, ( signed char * ) "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vComTxTask, "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
the queue empty. */\r
#define mainQUEUE_LENGTH ( 1 )\r
\r
-/* Values passed to the two tasks just to check the task parameter \r
+/* Values passed to the two tasks just to check the task parameter\r
functionality. */\r
#define mainQUEUE_SEND_PARAMETER ( 0x1111UL )\r
#define mainQUEUE_RECEIVE_PARAMETER ( 0x22UL )\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
******************************************************************************\r
*\r
* main_full() creates all the demo application tasks and a software timer, then\r
- * starts the scheduler. The web documentation provides more details of the \r
- * standard demo application tasks, which provide no particular functionality, \r
+ * starts the scheduler. The web documentation provides more details of the\r
+ * standard demo application tasks, which provide no particular functionality,\r
* but do provide a good example of how to use the FreeRTOS API.\r
*\r
* In addition to the standard demo tasks, the following tasks and tests are\r
*\r
* "Check" timer - The check software timer period is initially set to three\r
* seconds. The callback function associated with the check software timer\r
- * checks that all the standard demo tasks are not only still executing, but \r
- * are executing without reporting any errors. If the check software timer \r
- * discovers that a task has either stalled, or reported an error, then it \r
- * changes its own execution period from the initial three seconds, to just \r
- * 200ms. The check software timer callback function also toggles the green \r
- * LED each time it is called. This provides a visual indication of the system \r
- * status: If the green LED toggles every three seconds, then no issues have \r
- * been discovered. If the green LED toggles every 200ms, then an issue has \r
+ * checks that all the standard demo tasks are not only still executing, but\r
+ * are executing without reporting any errors. If the check software timer\r
+ * discovers that a task has either stalled, or reported an error, then it\r
+ * changes its own execution period from the initial three seconds, to just\r
+ * 200ms. The check software timer callback function also toggles the green\r
+ * LED each time it is called. This provides a visual indication of the system\r
+ * status: If the green LED toggles every three seconds, then no issues have\r
+ * been discovered. If the green LED toggles every 200ms, then an issue has\r
* been discovered with at least one task.\r
*\r
* See the documentation page for this demo on the FreeRTOS.org web site for\r
- * full information, including hardware setup requirements. \r
+ * full information, including hardware setup requirements.\r
*/\r
\r
/* Standard includes. */\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
vStartLEDFlashTimers( mainNUMBER_OF_FLASH_TIMERS_LEDS );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
- \r
+\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
if( xCheckTimer != NULL )\r
{\r
xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
}\r
\r
- /* The set of tasks created by the following function call have to be \r
- created last as they keep account of the number of tasks they expect to see \r
+ /* The set of tasks created by the following function call have to be\r
+ created last as they keep account of the number of tasks they expect to see\r
running. */\r
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* If all is well, the scheduler will now be running, and the following line\r
will never be reached. If the following line does execute, then there was\r
insufficient FreeRTOS heap memory available for the idle and/or timer tasks\r
to be created. See the memory management section on the FreeRTOS web site\r
for more details. */\r
- for( ;; ); \r
+ for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
ulErrorFound = pdTRUE;\r
}\r
- \r
+\r
if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
ulErrorFound = pdTRUE;\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
vParTestToggleLED( mainCHECK_LED );\r
- \r
+\r
/* Have any errors been latch in ulErrorFound? If so, shorten the\r
period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.\r
This will result in an increase in the rate at which mainCHECK_LED\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
+\r
/* This call to xTimerChangePeriod() uses a zero block time.\r
Functions called from inside of a timer callback function must\r
*never* attempt to block. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
* The Check task periodical interrogates each of the running tests to\r
* ensure that they are still executing correctly.\r
- * If all the tests pass, then the LCD is updated with Pass, the number of \r
+ * If all the tests pass, then the LCD is updated with Pass, the number of\r
* iterations and the Jitter time calculated but the Fast Interrupt Test.\r
* If any one of the tests fail, it is indicated with an error code printed on\r
* the display. This indicator won't disappear until the device is reset.\r
vStartInterruptQueueTasks();\r
\r
/* Start the error checking task. */\r
- ( void ) xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ ( void ) xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
\r
/* Start the UART. */\r
UART_1_Start();\r
- \r
+\r
/* Initialise the LEDs. */\r
vParTestInitialise();\r
- \r
+\r
/* Start the PWM modules that drive the IntQueue tests. */\r
High_Frequency_PWM_0_Start();\r
High_Frequency_PWM_1_Start();\r
- \r
+\r
/* Start the timers for the Jitter test. */\r
Timer_20KHz_Start();\r
Timer_48MHz_Start();\r
\r
/* Intialise the sleeper. */\r
xDelay = xTaskGetTickCount();\r
- \r
+\r
for( ;; )\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
vTaskDelayUntil( &xDelay, mainCHECK_DELAY );\r
- \r
+\r
/* Check that all of the Demo tasks are still running. */\r
if( pdTRUE != xAreBlockingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x1;\r
}\r
- \r
+\r
if( pdTRUE != xAreBlockTimeTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x2;\r
}\r
- \r
+\r
if( pdTRUE != xAreCountingSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x4;\r
}\r
- \r
+\r
if( pdTRUE != xIsCreateTaskStillRunning() )\r
{\r
usErrorCode |= 0x8;\r
}\r
- \r
+\r
if( pdTRUE != xAreDynamicPriorityTasksStillRunning() )\r
{\r
usErrorCode |= 0x10;\r
}\r
- \r
+\r
if( pdTRUE != xAreMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x20;\r
}\r
- \r
+\r
if( pdTRUE != xAreGenericQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x40;\r
}\r
- \r
+\r
if( pdTRUE != xAreIntegerMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x80;\r
}\r
- \r
+\r
if( pdTRUE != xArePollingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x100;\r
}\r
- \r
+\r
if( pdTRUE != xAreQueuePeekTasksStillRunning() )\r
{\r
usErrorCode |= 0x200;\r
}\r
- \r
+\r
if( pdTRUE != xAreSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x400;\r
}\r
- \r
+\r
if( pdTRUE != xAreComTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x800;\r
}\r
- \r
+\r
if( pdTRUE != xAreIntQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x1000;\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
* The Check task periodical interrogates each of the running tests to\r
* ensure that they are still executing correctly.\r
- * If all the tests pass, then the LCD is updated with Pass, the number of \r
+ * If all the tests pass, then the LCD is updated with Pass, the number of\r
* iterations and the Jitter time calculated but the Fast Interrupt Test.\r
* If any one of the tests fail, it is indicated with an error code printed on\r
* the display. This indicator won't disappear until the device is reset.\r
vStartInterruptQueueTasks();\r
\r
/* Start the error checking task. */\r
- ( void ) xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ ( void ) xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
\r
/* Start the UART. */\r
UART_1_Start();\r
- \r
+\r
/* Initialise the LEDs. */\r
vParTestInitialise();\r
- \r
+\r
/* Start the PWM modules that drive the IntQueue tests. */\r
High_Frequency_PWM_0_Start();\r
High_Frequency_PWM_1_Start();\r
- \r
+\r
/* Start the timers for the Jitter test. */\r
Timer_20KHz_Start();\r
Timer_48MHz_Start();\r
\r
/* Intialise the sleeper. */\r
xDelay = xTaskGetTickCount();\r
- \r
+\r
for( ;; )\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
vTaskDelayUntil( &xDelay, mainCHECK_DELAY );\r
- \r
+\r
/* Check that all of the Demo tasks are still running. */\r
if( pdTRUE != xAreBlockingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x1;\r
}\r
- \r
+\r
if( pdTRUE != xAreBlockTimeTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x2;\r
}\r
- \r
+\r
if( pdTRUE != xAreCountingSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x4;\r
}\r
- \r
+\r
if( pdTRUE != xIsCreateTaskStillRunning() )\r
{\r
usErrorCode |= 0x8;\r
}\r
- \r
+\r
if( pdTRUE != xAreDynamicPriorityTasksStillRunning() )\r
{\r
usErrorCode |= 0x10;\r
}\r
- \r
+\r
if( pdTRUE != xAreMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x20;\r
}\r
- \r
+\r
if( pdTRUE != xAreGenericQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x40;\r
}\r
- \r
+\r
if( pdTRUE != xAreIntegerMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x80;\r
}\r
- \r
+\r
if( pdTRUE != xArePollingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x100;\r
}\r
- \r
+\r
if( pdTRUE != xAreQueuePeekTasksStillRunning() )\r
{\r
usErrorCode |= 0x200;\r
}\r
- \r
+\r
if( pdTRUE != xAreSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x400;\r
}\r
- \r
+\r
if( pdTRUE != xAreComTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x800;\r
}\r
- \r
+\r
if( pdTRUE != xAreIntQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x1000;\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
* The Check task periodical interrogates each of the running tests to\r
* ensure that they are still executing correctly.\r
- * If all the tests pass, then the LCD is updated with Pass, the number of \r
+ * If all the tests pass, then the LCD is updated with Pass, the number of\r
* iterations and the Jitter time calculated but the Fast Interrupt Test.\r
* If any one of the tests fail, it is indicated with an error code printed on\r
* the display. This indicator won't disappear until the device is reset.\r
vStartInterruptQueueTasks();\r
\r
/* Start the error checking task. */\r
- ( void ) xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ ( void ) xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
\r
/* Start the UART. */\r
UART_1_Start();\r
- \r
+\r
/* Initialise the LEDs. */\r
vParTestInitialise();\r
- \r
+\r
/* Start the PWM modules that drive the IntQueue tests. */\r
High_Frequency_PWM_0_Start();\r
High_Frequency_PWM_1_Start();\r
- \r
+\r
/* Start the timers for the Jitter test. */\r
Timer_20KHz_Start();\r
Timer_48MHz_Start();\r
\r
/* Intialise the sleeper. */\r
xDelay = xTaskGetTickCount();\r
- \r
+\r
for( ;; )\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
vTaskDelayUntil( &xDelay, mainCHECK_DELAY );\r
- \r
+\r
/* Check that all of the Demo tasks are still running. */\r
if( pdTRUE != xAreBlockingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x1;\r
}\r
- \r
+\r
if( pdTRUE != xAreBlockTimeTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x2;\r
}\r
- \r
+\r
if( pdTRUE != xAreCountingSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x4;\r
}\r
- \r
+\r
if( pdTRUE != xIsCreateTaskStillRunning() )\r
{\r
usErrorCode |= 0x8;\r
}\r
- \r
+\r
if( pdTRUE != xAreDynamicPriorityTasksStillRunning() )\r
{\r
usErrorCode |= 0x10;\r
}\r
- \r
+\r
if( pdTRUE != xAreMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x20;\r
}\r
- \r
+\r
if( pdTRUE != xAreGenericQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x40;\r
}\r
- \r
+\r
if( pdTRUE != xAreIntegerMathsTaskStillRunning() )\r
{\r
usErrorCode |= 0x80;\r
}\r
- \r
+\r
if( pdTRUE != xArePollingQueuesStillRunning() )\r
{\r
usErrorCode |= 0x100;\r
}\r
- \r
+\r
if( pdTRUE != xAreQueuePeekTasksStillRunning() )\r
{\r
usErrorCode |= 0x200;\r
}\r
- \r
+\r
if( pdTRUE != xAreSemaphoreTasksStillRunning() )\r
{\r
usErrorCode |= 0x400;\r
}\r
- \r
+\r
if( pdTRUE != xAreComTestTasksStillRunning() )\r
{\r
usErrorCode |= 0x800;\r
}\r
- \r
+\r
if( pdTRUE != xAreIntQueueTasksStillRunning() )\r
{\r
usErrorCode |= 0x1000;\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* main-full.c (this file) defines a comprehensive demo that creates many\r
* tasks, queues, semaphores and timers. It also demonstrates how Cortex-M3\r
* interrupts can interact with FreeRTOS tasks/timers, a simple web server, and\r
- * run time statistics gathering functionality. ***IF YOU ARE LOOKING FOR A \r
+ * run time statistics gathering functionality. ***IF YOU ARE LOOKING FOR A\r
* SIMPLER STARTING POINT THEN USE THE "BLINKY" BUILD CONFIGURATION FIRST.***\r
*\r
- * If the Ethernet functionality is excluded, then this demo will run 'stand \r
- * alone' (without the rest of the tower system) on the TWR-K60N512 tower \r
+ * If the Ethernet functionality is excluded, then this demo will run 'stand\r
+ * alone' (without the rest of the tower system) on the TWR-K60N512 tower\r
* module. If the Ethernet functionality is included, then the full Freescale\r
- * K60 tower kit, including both the TWR-K60N512 and TWR-SER modules, is \r
- * required (as the Ethernet connector is on the TWR-SER). The TWR-K60N512 is \r
+ * K60 tower kit, including both the TWR-K60N512 and TWR-SER modules, is\r
+ * required (as the Ethernet connector is on the TWR-SER). The TWR-K60N512 is\r
* populated with a K60N512 Cortex-M4 microcontroller.\r
*\r
* The main() Function:\r
* main() creates four demo specific software timers, and one demo specific\r
* task (the web server task). It also creates a whole host of 'standard\r
- * demo' tasks/queues/semaphores/timers, before starting the scheduler. The \r
- * demo specific tasks and timers are described in the comments here. The \r
+ * demo' tasks/queues/semaphores/timers, before starting the scheduler. The\r
+ * demo specific tasks and timers are described in the comments here. The\r
* standard demo tasks are described on the FreeRTOS.org web site.\r
*\r
* The standard demo tasks provide no specific functionality. They are\r
*\r
* The Demo Specific "LED" Timers and Callback Function:\r
* Two very simple LED timers are created. All they do is toggle an LED each\r
- * when the timer callback function is executed. The two timers share a \r
- * callback function, so the callback function parameter is used to determine \r
- * which timer actually expired, and therefore, which LED to toggle. Both \r
- * timers use a different frequency, one toggles the blue LED and the other the \r
+ * when the timer callback function is executed. The two timers share a\r
+ * callback function, so the callback function parameter is used to determine\r
+ * which timer actually expired, and therefore, which LED to toggle. Both\r
+ * timers use a different frequency, one toggles the blue LED and the other the\r
* green LED.\r
*\r
* The LED/Button Software Timer and the Button Interrupt:\r
* The user button SW2 is configured to generate an interrupt each time it is\r
- * pressed. The interrupt service routine switches the orange/yellow LED on, \r
- * and resets the LED software timer. The LED timer has a 5000 millisecond (5 \r
- * second) period, and uses a callback function that is defined to just turn the \r
- * LED off again. Therefore, pressing the user button will turn the LED on, and \r
- * the LED will remain on until a full five seconds pass without the button \r
+ * pressed. The interrupt service routine switches the orange/yellow LED on,\r
+ * and resets the LED software timer. The LED timer has a 5000 millisecond (5\r
+ * second) period, and uses a callback function that is defined to just turn the\r
+ * LED off again. Therefore, pressing the user button will turn the LED on, and\r
+ * the LED will remain on until a full five seconds pass without the button\r
* being pressed.\r
*\r
* The Demo Specific "Check" Timer and Callback Function:\r
- * The check timer period is initially set to three seconds. The check timer \r
- * callback function checks that all the standard demo tasks are not only still \r
- * executing, but are executing without reporting any errors. If the check \r
- * timer discovers that a task has either stalled, or reported an error, then it \r
- * changes its own period from the initial three seconds, to just 200ms. The \r
- * check timer callback function also toggles the orange/red LED each time it is \r
- * called. This provides a visual indication of the system status: If the LED \r
- * toggles every three seconds, then no issues have been discovered. If the LED \r
- * toggles every 200ms, then an issue has been discovered with at least one \r
- * task. The last reported issue is latched into the pcStatusMessage variable, \r
- * and displayed at the bottom of the "task stats" web page served by the \r
+ * The check timer period is initially set to three seconds. The check timer\r
+ * callback function checks that all the standard demo tasks are not only still\r
+ * executing, but are executing without reporting any errors. If the check\r
+ * timer discovers that a task has either stalled, or reported an error, then it\r
+ * changes its own period from the initial three seconds, to just 200ms. The\r
+ * check timer callback function also toggles the orange/red LED each time it is\r
+ * called. This provides a visual indication of the system status: If the LED\r
+ * toggles every three seconds, then no issues have been discovered. If the LED\r
+ * toggles every 200ms, then an issue has been discovered with at least one\r
+ * task. The last reported issue is latched into the pcStatusMessage variable,\r
+ * and displayed at the bottom of the "task stats" web page served by the\r
* embedded web server task.\r
*\r
* The web server task:\r
* The Demo Specific Tick Hook Function:\r
* The tick hook function is used to test the interrupt safe software timer\r
* functionality.\r
- * \r
+ *\r
*/\r
\r
/* Kernel includes. */\r
in ticks using the portTICK_RATE_MS constant. */\r
#define mainERROR_CHECK_TIMER_PERIOD_MS ( 200UL / portTICK_RATE_MS )\r
\r
-/* The LED that is turned on by pressing SW2 remains on until the button has not \r
+/* The LED that is turned on by pressing SW2 remains on until the button has not\r
been pushed for a full 5000ms. */\r
#define mainBUTTON_LED_TIMER_PERIOD_MS ( 5000UL / portTICK_RATE_MS )\r
\r
static void prvCreateDemoSpecificTimers( void );\r
\r
/*\r
- * The LED/button timer callback function. This does nothing but switch an LED \r
+ * The LED/button timer callback function. This does nothing but switch an LED\r
* off.\r
*/\r
static void prvButtonLEDTimerCallback( xTimerHandle xTimer );\r
\r
/*-----------------------------------------------------------*/\r
\r
-/* The LED/Button software timer. This uses prvButtonLEDTimerCallback() as it's \r
+/* The LED/Button software timer. This uses prvButtonLEDTimerCallback() as it's\r
callback function. */\r
static xTimerHandle xLEDButtonTimer = NULL;\r
\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartCountingSemaphoreTasks();\r
vStartDynamicPriorityTasks();\r
- \r
+\r
/* The web server task. */\r
xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
\r
{\r
pcStatusMessage = "Error: CountSem\n";\r
}\r
- \r
+\r
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
{\r
pcStatusMessage = "Error: DynamicPriority\n";\r
}\r
- \r
+\r
/* Toggle the check LED to give an indication of the system status. If\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
- /* This call to xTimerChangePeriod() uses a zero block time. \r
- Functions called from inside of a timer callback function must \r
+\r
+ /* This call to xTimerChangePeriod() uses a zero block time.\r
+ Functions called from inside of a timer callback function must\r
*never* attempt to block. */\r
xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );\r
}\r
taskDISABLE_INTERRUPTS();\r
PORTE_PCR26 = PORT_PCR_MUX( 1 ) | PORT_PCR_IRQC( 0xA ) | PORT_PCR_PE_MASK | PORT_PCR_PS_MASK;\r
enable_irq( mainGPIO_E_VECTOR );\r
- \r
+\r
/* The interrupt calls an interrupt safe API function - so its priority must\r
be equal to or lower than configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY. */\r
set_irq_priority( mainGPIO_E_VECTOR, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );\r
- \r
+\r
/* Configure the LED outputs. */\r
vParTestInitialise();\r
}\r
static void prvCreateDemoSpecificTimers( void )\r
{\r
/* This function creates the timers, but does not start them. This is\r
- because the standard demo timer test is started from main(), after this \r
- function is called. The standard demo timer test will deliberately fill the \r
- timer command queue - and will fail the test if the command queue already \r
- holds start commands for the timers created here. Instead, the timers \r
- created in this function are started from the idle task, at which time, the \r
- timer service/daemon task will be running, and will have drained the timer \r
+ because the standard demo timer test is started from main(), after this\r
+ function is called. The standard demo timer test will deliberately fill the\r
+ timer command queue - and will fail the test if the command queue already\r
+ holds start commands for the timers created here. Instead, the timers\r
+ created in this function are started from the idle task, at which time, the\r
+ timer service/daemon task will be running, and will have drained the timer\r
command queue. */\r
- \r
+\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDButtonTimer = xTimerCreate( ( const signed char * ) "ButtonLEDTimer", /* A text name, purely to help debugging. */\r
- ( mainBUTTON_LED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvButtonLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDButtonTimer = xTimerCreate( "ButtonLEDTimer", /* A text name, purely to help debugging. */\r
+ ( mainBUTTON_LED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvButtonLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
- \r
+\r
/* Create the software timers used to simply flash LEDs. These two timers\r
share a callback function, so the callback parameter is used to pass in the\r
LED that should be toggled. */\r
- xLED1Timer = xTimerCreate( ( const signed char * ) "LED1Timer",/* A text name, purely to help debugging. */\r
- ( mainLED1_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) mainLED0, /* The ID is used to pass in the number of the LED to be toggled. */\r
- prvLEDTimerCallback /* The callback function simply toggles the LED specified by its parameter. */\r
+ xLED1Timer = xTimerCreate( "LED1Timer", /* A text name, purely to help debugging. */\r
+ ( mainLED1_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) mainLED0, /* The ID is used to pass in the number of the LED to be toggled. */\r
+ prvLEDTimerCallback /* The callback function simply toggles the LED specified by its parameter. */\r
);\r
\r
- xLED2Timer = xTimerCreate( ( const signed char * ) "LED2Timer",/* A text name, purely to help debugging. */\r
- ( mainLED2_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) mainLED1, /* The ID is used to pass in the number of the LED to be toggled. */\r
- prvLEDTimerCallback /* The callback function simply toggles the LED specified by its parameter. */\r
+ xLED2Timer = xTimerCreate( "LED2Timer", /* A text name, purely to help debugging. */\r
+ ( mainLED2_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) mainLED1, /* The ID is used to pass in the number of the LED to be toggled. */\r
+ prvLEDTimerCallback /* The callback function simply toggles the LED specified by its parameter. */\r
);\r
}\r
/*-----------------------------------------------------------*/\r
xTimerStart( xCheckTimer, portMAX_DELAY );\r
xTimerStart( xLED1Timer, portMAX_DELAY );\r
xTimerStart( xLED2Timer, portMAX_DELAY );\r
- \r
+\r
xFreeHeapSpace = xPortGetFreeHeapSize();\r
- \r
+\r
if( xFreeHeapSpace > 100 )\r
{\r
/* By now, the kernel has allocated everything it is going to, so\r
/* Call the periodic timer test, which tests the timer API functions that\r
can be called from an ISR. */\r
vTimerPeriodicISRTests();\r
-} \r
+}\r
/*-----------------------------------------------------------*/\r
\r
char *pcGetTaskStatusMessage( void )\r
{\r
- /* A simple GET function used by a CGI script so it can display the \r
+ /* A simple GET function used by a CGI script so it can display the\r
execution status at the bottom of the task stats web page served by the\r
embedded web server. */\r
if( pcStatusMessage == NULL )\r
/* The SysTick is a down counter. How many clocks have passed since it was\r
last reloaded? */\r
ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;\r
- \r
+\r
/* How many times has it overflowed? */\r
ulTickCount = xTaskGetTickCountFromISR();\r
\r
section, and the ISR safe critical sections are not designed to nest,\r
so reset the critical section. */\r
portSET_INTERRUPT_MASK_FROM_ISR();\r
- \r
+\r
/* Is there a SysTick interrupt pending? */\r
if( ( *pulInterruptCTRLState & ulSysTickPendingBit ) != 0UL )\r
{\r
/* There is a SysTick interrupt pending, so the SysTick has overflowed\r
but the tick count not yet incremented. */\r
ulTickCount++;\r
- \r
+\r
/* Read the SysTick again, as the overflow might have occurred since\r
it was read last. */\r
ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;\r
- } \r
- \r
+ }\r
+\r
/* Convert the tick count into tenths of a millisecond. THIS ASSUMES\r
configTICK_RATE_HZ is 1000! */\r
ulReturn = ( ulTickCount * 10UL ) ;\r
- \r
+\r
/* Add on the number of tenths of a millisecond that have passed since the\r
tick count last got updated. */\r
ulReturn += ( ulSysTickCounts / ulClocksPer10thOfAMilliSecond );\r
- \r
- return ulReturn; \r
+\r
+ return ulReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* in this file. prvQueueReceiveTask() sits in a loop that causes it to\r
* repeatedly attempt to read data from the queue that was created within\r
* main(). When data is received, the task checks the value of the data, and\r
- * if the value equals the expected 100, toggles the blue LED. The 'block \r
- * time' parameter passed to the queue receive function specifies that the task \r
- * should be held in the Blocked state indefinitely to wait for data to be \r
- * available on the queue. The queue receive task will only leave the Blocked \r
- * state when the queue send task writes to the queue. As the queue send task \r
- * writes to the queue every 200 milliseconds, the queue receive task leaves the \r
- * Blocked state every 200 milliseconds, and therefore toggles the blue LED \r
+ * if the value equals the expected 100, toggles the blue LED. The 'block\r
+ * time' parameter passed to the queue receive function specifies that the task\r
+ * should be held in the Blocked state indefinitely to wait for data to be\r
+ * available on the queue. The queue receive task will only leave the Blocked\r
+ * state when the queue send task writes to the queue. As the queue send task\r
+ * writes to the queue every 200 milliseconds, the queue receive task leaves the\r
+ * Blocked state every 200 milliseconds, and therefore toggles the blue LED\r
* every 200 milliseconds.\r
*\r
* The LED Software Timer and the Button Interrupt:\r
* The user button SW2 is configured to generate an interrupt each time it is\r
- * pressed. The interrupt service routine switches the green LED on, and \r
- * resets the LED software timer. The LED timer has a 5000 millisecond (5 \r
- * second) period, and uses a callback function that is defined to just turn the \r
- * LED off again. Therefore, pressing the user button will turn the LED on, and \r
- * the LED will remain on until a full five seconds pass without the button \r
+ * pressed. The interrupt service routine switches the green LED on, and\r
+ * resets the LED software timer. The LED timer has a 5000 millisecond (5\r
+ * second) period, and uses a callback function that is defined to just turn the\r
+ * LED off again. Therefore, pressing the user button will turn the LED on, and\r
+ * the LED will remain on until a full five seconds pass without the button\r
* being pressed.\r
*/\r
\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xButtonLEDTimer = xTimerCreate( ( const signed char * ) "ButtonLEDTimer", /* A text name, purely to help debugging. */\r
- mainBUTTON_LED_TIMER_PERIOD_MS, /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvButtonLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xButtonLEDTimer = xTimerCreate( "ButtonLEDTimer", /* A text name, purely to help debugging. */\r
+ mainBUTTON_LED_TIMER_PERIOD_MS, /* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvButtonLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Start the tasks and timer running. */\r
/* Enable the interrupt on SW1. */\r
PORTE_PCR26 = PORT_PCR_MUX( 1 ) | PORT_PCR_IRQC( 0xA ) | PORT_PCR_PE_MASK | PORT_PCR_PS_MASK;\r
enable_irq( mainGPIO_E_VECTOR );\r
- \r
+\r
/* The interrupt calls an interrupt safe API function - so its priority must\r
be equal to or lower than configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY. */\r
set_irq_priority( mainGPIO_E_VECTOR, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );\r
- \r
+\r
/* Set PTA10, PTA11, PTA28, and PTA29 (connected to LED's) for GPIO\r
functionality. */\r
PORTA_PCR10 = ( 0 | PORT_PCR_MUX( 1 ) );\r
PORTA_PCR11 = ( 0 | PORT_PCR_MUX( 1 ) );\r
PORTA_PCR28 = ( 0 | PORT_PCR_MUX( 1 ) );\r
PORTA_PCR29 = ( 0 | PORT_PCR_MUX( 1 ) );\r
- \r
+\r
/* Change PTA10, PTA29 to outputs. */\r
- GPIOA_PDDR=GPIO_PDDR_PDD( mainTASK_CONTROLLED_LED | mainTIMER_CONTROLLED_LED ); \r
+ GPIOA_PDDR=GPIO_PDDR_PDD( mainTASK_CONTROLLED_LED | mainTIMER_CONTROLLED_LED );\r
\r
/* Start with LEDs off. */\r
GPIOA_PTOR = ~0U;\r
void vMainConfigureTimerForRunTimeStats( void ) {}\r
unsigned long ulMainGetRunTimeCounterValue( void ) { return 0UL; }\r
\r
-/* A tick hook is used by the "Full" build configuration. The Full and blinky \r
-build configurations share a FreeRTOSConfig.h header file, so this simple build \r
-configuration also has to define a tick hook - even though it does not actually \r
+/* A tick hook is used by the "Full" build configuration. The Full and blinky\r
+build configurations share a FreeRTOSConfig.h header file, so this simple build\r
+configuration also has to define a tick hook - even though it does not actually\r
use it for anything. */\r
void vApplicationTickHook( void ) {}\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
if( ( usPacketLength > 0U ) && ( uip_buf != NULL ) )\r
{\r
uip_len = usPacketLength;\r
- \r
+\r
if( xHeader->type == htons( UIP_ETHTYPE_IP ) )\r
{\r
uip_arp_ipin();\r
for( i = 0; i < UIP_CONNS; i++ )\r
{\r
uip_periodic( i );\r
- \r
+\r
/* If the above function invocation resulted in data that\r
should be sent out on the network, the global variable\r
uip_len is set to a value > 0. */\r
xEMACEventQueue = xQueueCreate( uipEVENT_QUEUE_LENGTH, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( signed char * ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( signed char * ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 500UL / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
\r
/* Only interested in processing form input if this is the IO page. */\r
c = strstr( pcInputString, "io.shtml" );\r
- \r
+\r
if( c )\r
{\r
/* Is there a command in the string? */\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
static unsigned short generate_runtime_stats( void *arg )\r
{\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
PHY. */\r
if( SysCtlPeripheralPresent( SYSCTL_PERIPH_ETH ) )\r
{\r
- xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
}\r
\r
/* Start the standard demo tasks. */\r
vStartInterruptQueueTasks();\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( vOLEDTask, ( signed portCHAR * ) "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vOLEDTask, "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
{\r
xMessage.pcMessage = "ERROR IN INT QUEUE";\r
}\r
- \r
+\r
\r
/* Send the message to the OLED gatekeeper for display. */\r
xHigherPriorityTaskWoken = pdFALSE;\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
ulRxLength[ ulTemp ] = 0;\r
}\r
- \r
+\r
/* Create the queue and task used to defer the MAC processing to the\r
task level. */\r
vSemaphoreCreateBinary( xMACInterruptSemaphore );\r
xSemaphoreTake( xMACInterruptSemaphore, 0 );\r
- xReturn = xTaskCreate( vMACHandleTask, ( signed portCHAR * ) "MAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
+ xReturn = xTaskCreate( vMACHandleTask, "MAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
vTaskDelay( macNEGOTIATE_DELAY );\r
- \r
+\r
/* We are only interested in Rx interrupts. */\r
IntPrioritySet( INT_ETH, configKERNEL_INTERRUPT_PRIORITY );\r
IntEnable( INT_ETH );\r
{\r
/* Leave room for the size at the start of the buffer. */\r
uip_buf = &( ucRxBuffers[ ulNextRxBuffer ][ 2 ] );\r
- \r
+\r
ulRxLength[ ulNextRxBuffer ] = 0;\r
- \r
+\r
ulNextRxBuffer++;\r
if( ulNextRxBuffer >= emacNUM_RX_BUFFERS )\r
{\r
{\r
vTaskDelay( macWAIT_SEND_TIME );\r
}\r
- \r
- pulSource = ( unsigned portLONG * ) pus; \r
- \r
+\r
+ pulSource = ( unsigned portLONG * ) pus;\r
+\r
for( ulNextWord = 0; ulNextWord < ulNextTxSpace; ulNextWord += sizeof( unsigned portLONG ) )\r
{\r
HWREG(ETH_BASE + MAC_O_DATA) = *pulSource;\r
/* Clear the interrupt. */\r
ulTemp = EthernetIntStatus( ETH_BASE, pdFALSE );\r
EthernetIntClear( ETH_BASE, ulTemp );\r
- \r
+\r
/* Was it an Rx interrupt? */\r
if( ulTemp & ETH_INT_RX )\r
{\r
xSemaphoreGiveFromISR( xMACInterruptSemaphore, &xHigherPriorityTaskWoken );\r
EthernetIntDisable( ETH_BASE, ETH_INT_RX );\r
}\r
- \r
+\r
/* Switch to the uIP task. */\r
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r
{\r
/* Wait for something to do. */\r
xSemaphoreTake( xMACInterruptSemaphore, portMAX_DELAY );\r
- \r
+\r
while( ( ulInt = ( EthernetIntStatus( ETH_BASE, pdFALSE ) & ETH_INT_RX ) ) != 0 )\r
- { \r
+ {\r
ulLength = HWREG( ETH_BASE + MAC_O_DATA );\r
- \r
+\r
/* Leave room at the start of the buffer for the size. */\r
- pulBuffer = ( unsigned long * ) &( ucRxBuffers[ ulNextRxBuffer ][ 2 ] ); \r
+ pulBuffer = ( unsigned long * ) &( ucRxBuffers[ ulNextRxBuffer ][ 2 ] );\r
*pulBuffer = ( ulLength >> 16 );\r
\r
- /* Get the size of the data. */ \r
- pulBuffer = ( unsigned long * ) &( ucRxBuffers[ ulNextRxBuffer ][ 4 ] ); \r
+ /* Get the size of the data. */\r
+ pulBuffer = ( unsigned long * ) &( ucRxBuffers[ ulNextRxBuffer ][ 4 ] );\r
ulLength &= 0xFFFF;\r
- \r
+\r
if( ulLength > 4 )\r
{\r
ulLength -= 4;\r
- \r
+\r
if( ulLength >= UIP_BUFSIZE )\r
{\r
/* The data won't fit in our buffer. Ensure we don't\r
*pulBuffer = HWREG( ETH_BASE + MAC_O_DATA );\r
pulBuffer++;\r
}\r
- \r
+\r
/* Store the length of the data into the separate array. */\r
ulRxLength[ ulNextRxBuffer ] = ulLength;\r
- \r
+\r
/* Use the next buffer the next time through. */\r
ulNextRxBuffer++;\r
if( ulNextRxBuffer >= emacNUM_RX_BUFFERS )\r
{\r
ulNextRxBuffer = 0;\r
}\r
- \r
+\r
/* Ensure the uIP task is not blocked as data has arrived. */\r
xSemaphoreGive( xEMACSemaphore );\r
}\r
}\r
- \r
+\r
EthernetIntEnable( ETH_BASE, ETH_INT_RX );\r
}\r
}\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
static unsigned short\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
static unsigned short\r
generate_runtime_stats(void *arg)\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
PHY. */\r
if( SysCtlPeripheralPresent( SYSCTL_PERIPH_ETH ) )\r
{\r
- xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
}\r
}\r
#endif\r
\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( vOLEDTask, ( signed portCHAR * ) "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vOLEDTask, "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
ulRxLength[ ulTemp ] = 0;\r
}\r
- \r
+\r
/* Create the queue and task used to defer the MAC processing to the\r
task level. */\r
vSemaphoreCreateBinary( xMACInterruptSemaphore );\r
xSemaphoreTake( xMACInterruptSemaphore, 0 );\r
- xReturn = xTaskCreate( vMACHandleTask, ( signed portCHAR * ) "MAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
+ xReturn = xTaskCreate( vMACHandleTask, "MAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
vTaskDelay( macNEGOTIATE_DELAY );\r
- \r
+\r
/* We are only interested in Rx interrupts. */\r
IntPrioritySet( INT_ETH, configKERNEL_INTERRUPT_PRIORITY );\r
IntEnable( INT_ETH );\r
{\r
/* Leave room for the size at the start of the buffer. */\r
uip_buf = &( uxRxBuffers.ucRxBuffers[ ulNextRxBuffer ][ 2 ] );\r
- \r
+\r
ulRxLength[ ulNextRxBuffer ] = 0;\r
- \r
+\r
ulNextRxBuffer++;\r
if( ulNextRxBuffer >= emacNUM_RX_BUFFERS )\r
{\r
{\r
vTaskDelay( macWAIT_SEND_TIME );\r
}\r
- \r
- pulSource = ( unsigned portLONG * ) pus; \r
- \r
+\r
+ pulSource = ( unsigned portLONG * ) pus;\r
+\r
for( ulNextWord = 0; ulNextWord < ulNextTxSpace; ulNextWord += sizeof( unsigned portLONG ) )\r
{\r
HWREG(ETH_BASE + MAC_O_DATA) = *pulSource;\r
/* Clear the interrupt. */\r
ulTemp = EthernetIntStatus( ETH_BASE, pdFALSE );\r
EthernetIntClear( ETH_BASE, ulTemp );\r
- \r
+\r
/* Was it an Rx interrupt? */\r
if( ulTemp & ETH_INT_RX )\r
{\r
xSemaphoreGiveFromISR( xMACInterruptSemaphore, &xHigherPriorityTaskWoken );\r
EthernetIntDisable( ETH_BASE, ETH_INT_RX );\r
}\r
- \r
+\r
/* Switch to the uIP task. */\r
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r
{\r
/* Wait for something to do. */\r
xSemaphoreTake( xMACInterruptSemaphore, portMAX_DELAY );\r
- \r
+\r
while( ( ulInt = ( EthernetIntStatus( ETH_BASE, pdFALSE ) & ETH_INT_RX ) ) != 0 )\r
- { \r
+ {\r
ulLength = HWREG( ETH_BASE + MAC_O_DATA );\r
- \r
+\r
/* Leave room at the start of the buffer for the size. */\r
- pulBuffer = ( unsigned long * ) &( uxRxBuffers.ucRxBuffers[ ulNextRxBuffer ][ 2 ] ); \r
+ pulBuffer = ( unsigned long * ) &( uxRxBuffers.ucRxBuffers[ ulNextRxBuffer ][ 2 ] );\r
*pulBuffer = ( ulLength >> 16 );\r
\r
- /* Get the size of the data. */ \r
- pulBuffer = ( unsigned long * ) &( uxRxBuffers.ucRxBuffers[ ulNextRxBuffer ][ 4 ] ); \r
+ /* Get the size of the data. */\r
+ pulBuffer = ( unsigned long * ) &( uxRxBuffers.ucRxBuffers[ ulNextRxBuffer ][ 4 ] );\r
ulLength &= 0xFFFF;\r
- \r
+\r
if( ulLength > 4 )\r
{\r
ulLength -= 4;\r
- \r
+\r
if( ulLength >= UIP_BUFSIZE )\r
{\r
/* The data won't fit in our buffer. Ensure we don't\r
*pulBuffer = HWREG( ETH_BASE + MAC_O_DATA );\r
pulBuffer++;\r
}\r
- \r
+\r
/* Store the length of the data into the separate array. */\r
ulRxLength[ ulNextRxBuffer ] = ulLength;\r
- \r
+\r
/* Use the next buffer the next time through. */\r
ulNextRxBuffer++;\r
if( ulNextRxBuffer >= emacNUM_RX_BUFFERS )\r
{\r
ulNextRxBuffer = 0;\r
}\r
- \r
+\r
/* Ensure the uIP task is not blocked as data has arrived. */\r
xSemaphoreGive( xEMACSemaphore );\r
}\r
}\r
- \r
+\r
EthernetIntEnable( ETH_BASE, ETH_INT_RX );\r
- \r
+\r
( void ) ulInt;\r
}\r
}\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
static unsigned short\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
PHY. */\r
if( SysCtlPeripheralPresent( SYSCTL_PERIPH_ETH ) )\r
{\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
}\r
\r
/* Start the standard demo tasks. */\r
vStartQueueSetTasks();\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( vOLEDTask, ( signed char * ) "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vOLEDTask, "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
task level. */\r
vSemaphoreCreateBinary( xMACInterruptSemaphore );\r
xSemaphoreTake( xMACInterruptSemaphore, 0 );\r
- xReturn = xTaskCreate( vMACHandleTask, ( signed char * ) "MAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
+ xReturn = xTaskCreate( vMACHandleTask, "MAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
vTaskDelay( macNEGOTIATE_DELAY );\r
\r
/* We are only interested in Rx interrupts. */\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
static unsigned short\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
static unsigned short\r
generate_runtime_stats(void *arg)\r
{\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*\r
* "uIP" task - This is the task that handles the uIP stack. All TCP/IP\r
* processing is performed in this task.\r
- * \r
+ *\r
* "USB" task - Enumerates the USB device as a CDC class, then echoes back all\r
* received characters with a configurable offset (for example, if the offset\r
* is 1 and 'A' is received then 'B' will be sent back). A dumb terminal such\r
vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY );\r
\r
/* Create the USB task. */\r
- xTaskCreate( vUSBTask, ( signed char * ) "USB", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- \r
- /* Display the IP address, then create the uIP task. The WEB server runs \r
+ xTaskCreate( vUSBTask, "USB", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+\r
+ /* Display the IP address, then create the uIP task. The WEB server runs\r
in this task. */\r
LCDdriver_initialisation();\r
LCD_PrintString( 5, 10, "FreeRTOS.org", 14, COLOR_GREEN);\r
sprintf( cIPAddress, "%d.%d.%d.%d", configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );\r
LCD_PrintString( 5, 30, cIPAddress, 14, COLOR_RED);\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
}\r
- \r
+\r
/* Disable PLL, disconnected. */\r
LPC_SC->PLL0CON = 0;\r
LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable main OSC. */\r
LPC_SC->SCS |= 0x20;\r
while( !( LPC_SC->SCS & 0x40 ) );\r
- \r
+\r
/* select main OSC, 12MHz, as the PLL clock source. */\r
LPC_SC->CLKSRCSEL = 0x1;\r
- \r
+\r
LPC_SC->PLL0CFG = 0x20031;\r
LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable PLL, disconnected. */\r
LPC_SC->PLL0CON = 1;\r
LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Set clock divider. */\r
LPC_SC->CCLKCFG = 0x03;\r
- \r
+\r
/* Configure flash accelerator. */\r
LPC_SC->FLASHCFG = 0x403a;\r
- \r
+\r
/* Check lock bit status. */\r
while( ( ( LPC_SC->PLL0STAT & ( 1 << 26 ) ) == 0 ) );\r
- \r
+\r
/* Enable and connect. */\r
LPC_SC->PLL0CON = 3;\r
LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
while( ( ( LPC_SC->PLL0STAT & ( 1 << 25 ) ) == 0 ) );\r
\r
- \r
- \r
- \r
+\r
+\r
+\r
/* Configure the clock for the USB. */\r
- \r
+\r
if( LPC_SC->PLL1STAT & ( 1 << 9 ) )\r
{\r
/* Enable PLL, disconnected. */\r
LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
}\r
- \r
+\r
/* Disable PLL, disconnected. */\r
LPC_SC->PLL1CON = 0;\r
LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
- \r
+\r
LPC_SC->PLL1CFG = 0x23;\r
LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable PLL, disconnected. */\r
LPC_SC->PLL1CON = 1;\r
LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
while( ( ( LPC_SC->PLL1STAT & ( 1 << 10 ) ) == 0 ) );\r
- \r
+\r
/* Enable and connect. */\r
LPC_SC->PLL1CON = 3;\r
LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[ 128 ];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", (int)lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
static unsigned short\r
generate_runtime_stats(void *arg)\r
{\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", (int)lRefreshCount );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*\r
* "uIP" task - This is the task that handles the uIP stack. All TCP/IP\r
* processing is performed in this task.\r
- * \r
+ *\r
* "USB" task - Enumerates the USB device as a CDC class, then echoes back all\r
* received characters with a configurable offset (for example, if the offset\r
* is 1 and 'A' is received then 'B' will be sent back). A dumb terminal such\r
vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY );\r
\r
/* Create the USB task. */\r
- xTaskCreate( vUSBTask, ( signed char * ) "USB", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- \r
+ xTaskCreate( vUSBTask, "USB", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+\r
/* Create the uIP task. The WEB server runs in this task. */\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[ 128 ];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", (int)lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
static unsigned short\r
generate_runtime_stats(void *arg)\r
{\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", (int)lRefreshCount );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vStartRecursiveMutexTasks();\r
\r
/* Create the simple LED flash task. */\r
- xTaskCreate( prvFlashTask, ( signed char * ) "Flash", configMINIMAL_STACK_SIZE, ( void * ) NULL, mainFLASH_TASK_PRIORITY, NULL );\r
- \r
+ xTaskCreate( prvFlashTask, "Flash", configMINIMAL_STACK_SIZE, ( void * ) NULL, mainFLASH_TASK_PRIORITY, NULL );\r
+\r
/* Create the USB task. */\r
- xTaskCreate( vUSBTask, ( signed char * ) "USB", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- \r
+ xTaskCreate( vUSBTask, "USB", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+\r
/* Create the uIP task. The WEB server runs in this task. */\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
if ( SC->PLL0STAT & ( 1 << 25 ) )\r
{\r
/* Enable PLL, disconnected. */\r
- SC->PLL0CON = 1; \r
+ SC->PLL0CON = 1;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
}\r
- \r
+\r
/* Disable PLL, disconnected. */\r
- SC->PLL0CON = 0; \r
+ SC->PLL0CON = 0;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable main OSC. */\r
- SC->SCS |= 0x20; \r
+ SC->SCS |= 0x20;\r
while( !( SC->SCS & 0x40 ) );\r
- \r
+\r
/* select main OSC, 12MHz, as the PLL clock source. */\r
- SC->CLKSRCSEL = 0x1; \r
- \r
+ SC->CLKSRCSEL = 0x1;\r
+\r
SC->PLL0CFG = 0x20031;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable PLL, disconnected. */\r
- SC->PLL0CON = 1; \r
+ SC->PLL0CON = 1;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Set clock divider. */\r
SC->CCLKCFG = 0x03;\r
- \r
+\r
/* Configure flash accelerator. */\r
SC->FLASHCFG = 0x403a;\r
- \r
+\r
/* Check lock bit status. */\r
- while( ( ( SC->PLL0STAT & ( 1 << 26 ) ) == 0 ) ); \r
- \r
+ while( ( ( SC->PLL0STAT & ( 1 << 26 ) ) == 0 ) );\r
+\r
/* Enable and connect. */\r
- SC->PLL0CON = 3; \r
+ SC->PLL0CON = 3;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- while( ( ( SC->PLL0STAT & ( 1 << 25 ) ) == 0 ) ); \r
+ while( ( ( SC->PLL0STAT & ( 1 << 25 ) ) == 0 ) );\r
+\r
+\r
+\r
\r
- \r
- \r
- \r
/* Configure the clock for the USB. */\r
- \r
+\r
if( SC->PLL1STAT & ( 1 << 9 ) )\r
{\r
/* Enable PLL, disconnected. */\r
- SC->PLL1CON = 1; \r
+ SC->PLL1CON = 1;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
}\r
- \r
+\r
/* Disable PLL, disconnected. */\r
- SC->PLL1CON = 0; \r
+ SC->PLL1CON = 0;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
- \r
+\r
SC->PLL1CFG = 0x23;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable PLL, disconnected. */\r
- SC->PLL1CON = 1; \r
+ SC->PLL1CON = 1;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
while( ( ( SC->PLL1STAT & ( 1 << 10 ) ) == 0 ) );\r
- \r
+\r
/* Enable and connect. */\r
- SC->PLL1CON = 3; \r
+ SC->PLL1CON = 3;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
while( ( ( SC->PLL1STAT & ( 1 << 9 ) ) == 0 ) );\r
- \r
+\r
/* Setup the peripheral bus to be the same as the PLL output (64 MHz). */\r
SC->PCLKSEL0 = 0x05555555;\r
\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[ 128 ];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", (int)lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
static unsigned short\r
generate_runtime_stats(void *arg)\r
{\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", (int)lRefreshCount );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
\r
static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *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
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
- vTaskList( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+ strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
+ vTaskList( ( char * ) pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
\r
static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *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
\r
/* Generate a table of task stats. */\r
strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
- vTaskGetRunTimeStats( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+ vTaskGetRunTimeStats( ( char * ) pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
\r
/* Create that task that handles the console itself. */\r
xTaskCreate( prvUARTCommandConsoleTask, /* The task that implements the command console. */\r
- ( const int8_t * const ) "CLI", /* Text name assigned to the task. This is just to assist debugging. The kernel does not use this name itself. */\r
+ "CLI", /* Text name assigned to the task. This is just to assist debugging. The kernel does not use this name itself. */\r
usStackSize, /* The size of the stack allocated to the task. */\r
NULL, /* The parameter is not used, so NULL is passed. */\r
uxPriority, /* The priority allocated to the task. */\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
These are naked functions that don't use any stack. A stack still has\r
to be allocated to hold the task context. */\r
xTaskCreate( vRegTest1Task, /* Function that implements the task. */\r
- ( signed char * ) "Reg1", /* Text name of the task. */\r
+ "Reg1", /* Text name of the task. */\r
xRegTestStackSize, /* Stack allocated to the task. */\r
NULL, /* The task parameter is not used. */\r
tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
NULL ); /* Don't receive a handle back, it is not needed. */\r
\r
xTaskCreate( vRegTest2Task, /* Function that implements the task. */\r
- ( signed char * ) "Reg2", /* Text name of the task. */\r
+ "Reg2", /* Text name of the task. */\r
xRegTestStackSize, /* Stack allocated to the task. */\r
NULL, /* The task parameter is not used. */\r
tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* containing an unexpected value is indicative of an error in the context\r
* switching mechanism.\r
*\r
- * "Interrupt semaphore take" task - This task does nothing but block on a \r
- * semaphore that is 'given' from the tick hook function (which is defined in \r
- * main.c). It toggles the fourth LED each time it receives the semaphore. The \r
+ * "Interrupt semaphore take" task - This task does nothing but block on a\r
+ * semaphore that is 'given' from the tick hook function (which is defined in\r
+ * main.c). It toggles the fourth LED each time it receives the semaphore. The\r
* Semahore is given every 50ms, so LED 4 toggles every 50ms.\r
*\r
* "Flash timers" - A software timer callback function is defined that does\r
toggles an LED each time the semaphore is given. */\r
vSemaphoreCreateBinary( xLEDSemaphore );\r
xTaskCreate( prvSemaphoreTakeTask, /* Function that implements the task. */\r
- ( signed char * ) "Sem", /* Text name of the task. */\r
+ "Sem", /* Text name of the task. */\r
configMINIMAL_STACK_SIZE, /* Stack allocated to the task (in words). */\r
NULL, /* The task parameter is not used. */\r
configMAX_PRIORITIES - 2, /* The priority of the task. */\r
These are naked functions that don't use any stack. A stack still has\r
to be allocated to hold the task context. */\r
xTaskCreate( vRegTest1Task, /* Function that implements the task. */\r
- ( signed char * ) "Reg1", /* Text name of the task. */\r
+ "Reg1", /* Text name of the task. */\r
xRegTestStackSize, /* Stack allocated to the task. */\r
NULL, /* The task parameter is not used. */\r
tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
NULL ); /* Don't receive a handle back, it is not needed. */\r
\r
xTaskCreate( vRegTest2Task, /* Function that implements the task. */\r
- ( signed char * ) "Reg2", /* Text name of the task. */\r
+ "Reg2", /* Text name of the task. */\r
xRegTestStackSize, /* Stack allocated to the task. */\r
NULL, /* The task parameter is not used. */\r
tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
/* Create the three flash timers. */\r
for( ulTimer = 0UL; ulTimer < ulTimersToCreate; ulTimer++ )\r
{\r
- xTimer = xTimerCreate( ( const signed char * ) "FlashTimer", /* A text name, purely to help debugging. */\r
+ xTimer = xTimerCreate( "FlashTimer", /* A text name, purely to help debugging. */\r
( mainFLASH_TIMER_BASE_RATE * ( ulTimer + 1UL ) ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) ulTimer, /* The ID is used to hold the number of the LED that will be flashed. */\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* If the software timer was created successfully, start it. It won't\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* required to configure the hardware, are defined in main.c.\r
******************************************************************************\r
*\r
- * main_blinky() creates one queue, and two tasks. It then starts the \r
+ * main_blinky() creates one queue, and two tasks. It then starts the\r
* scheduler.\r
*\r
* The Queue Send Task:\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
These are naked functions that don't use any stack. A stack still has\r
to be allocated to hold the task context. */\r
xTaskCreate( vRegTest1Task, /* Function that implements the task. */\r
- ( signed char * ) "Reg1", /* Text name of the task. */\r
+ "Reg1", /* Text name of the task. */\r
xRegTestStackSize, /* Stack allocated to the task. */\r
NULL, /* The task parameter is not used. */\r
tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
NULL ); /* Don't receive a handle back, it is not needed. */\r
\r
xTaskCreate( vRegTest2Task, /* Function that implements the task. */\r
- ( signed char * ) "Reg2", /* Text name of the task. */\r
+ "Reg2", /* Text name of the task. */\r
xRegTestStackSize, /* Stack allocated to the task. */\r
NULL, /* The task parameter is not used. */\r
tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* If the software timer was created successfully, start it. It won't\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
These are naked functions that don't use any stack. A stack still has\r
to be allocated to hold the task context. */\r
xTaskCreate( vRegTest1Task, /* Function that implements the task. */\r
- ( signed char * ) "Reg1", /* Text name of the task. */\r
+ "Reg1", /* Text name of the task. */\r
xRegTestStackSize, /* Stack allocated to the task. */\r
NULL, /* The task parameter is not used. */\r
tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
NULL ); /* Don't receive a handle back, it is not needed. */\r
\r
xTaskCreate( vRegTest2Task, /* Function that implements the task. */\r
- ( signed char * ) "Reg2", /* Text name of the task. */\r
+ "Reg2", /* Text name of the task. */\r
xRegTestStackSize, /* Stack allocated to the task. */\r
NULL, /* The task parameter is not used. */\r
tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
/* Create the three flash timers. */\r
for( ulTimer = 0UL; ulTimer < ulTimersToCreate; ulTimer++ )\r
{\r
- xTimer = xTimerCreate( ( const signed char * ) "FlashTimer", /* A text name, purely to help debugging. */\r
+ xTimer = xTimerCreate( "FlashTimer", /* A text name, purely to help debugging. */\r
( mainFLASH_TIMER_BASE_RATE * ( ulTimer + 1UL ) ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) ulTimer, /* The ID is used to hold the number of the LED that will be flashed. */\r
- prvFlashTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) ulTimer, /* The ID is used to hold the number of the LED that will be flashed. */\r
+ prvFlashTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
- \r
+\r
if( xTimer != NULL )\r
{\r
xTimerStart( xTimer, mainDONT_BLOCK );\r
}\r
}\r
- \r
+\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* If the software timer was created successfully, start it. It won't\r
ulLED = ( unsigned long ) pvTimerGetTimerID( xTimer );\r
\r
/* Toggle the LED. */\r
- vParTestToggleLED( ulLED ); \r
+ vParTestToggleLED( ulLED );\r
}\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
******************************************************************************\r
*\r
* main_full() creates all the demo application tasks and a software timer, then\r
- * starts the scheduler. The web documentation provides more details of the \r
- * standard demo application tasks, which provide no particular functionality, \r
+ * starts the scheduler. The web documentation provides more details of the\r
+ * standard demo application tasks, which provide no particular functionality,\r
* but do provide a good example of how to use the FreeRTOS API.\r
*\r
* In addition to the standard demo tasks, the following tasks and tests are\r
vStartRecursiveMutexTasks();\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
- \r
+\r
/* Create the register check tasks, as described at the top of this\r
file */\r
- xTaskCreate( prvRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
if( xCheckTimer != NULL )\r
{\r
xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* If all is well, the scheduler will now be running, and the following line\r
will never be reached. If the following line does execute, then there was\r
insufficient FreeRTOS heap memory available for the idle and/or timer tasks\r
to be created. See the memory management section on the FreeRTOS web site\r
for more details. */\r
- for( ;; ); \r
+ for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
ulErrorFound = pdTRUE;\r
}\r
- \r
+\r
/* Check that the register test 1 task is still running. */\r
if( ulLastRegTest1Value == ulRegTest1LoopCounter )\r
{\r
/* Toggle the check LED to give an indication of the system status. If\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
- configTOGGLE_LED(); \r
- \r
+ configTOGGLE_LED();\r
+\r
/* Have any errors been latch in ulErrorFound? If so, shorten the\r
period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.\r
This will result in an increase in the rate at which mainCHECK_LED\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
+\r
/* This call to xTimerChangePeriod() uses a zero block time.\r
Functions called from inside of a timer callback function must\r
*never* attempt to block. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
or 0 to run the more comprehensive test and demo application. */\r
-#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0\r
\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Create the register check tasks, as described at the top of this\r
file */\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
******************************************************************************\r
*\r
* main_full() creates all the demo application tasks and a software timer, then\r
- * starts the scheduler. The web documentation provides more details of the \r
- * standard demo application tasks, which provide no particular functionality, \r
+ * starts the scheduler. The web documentation provides more details of the\r
+ * standard demo application tasks, which provide no particular functionality,\r
* but do provide a good example of how to use the FreeRTOS API.\r
*\r
* In addition to the standard demo tasks, the following tasks and tests are\r
vStartRecursiveMutexTasks();\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
- \r
+\r
/* Create the register check tasks, as described at the top of this\r
file */\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
if( xCheckTimer != NULL )\r
{\r
xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* If all is well, the scheduler will now be running, and the following line\r
will never be reached. If the following line does execute, then there was\r
insufficient FreeRTOS heap memory available for the idle and/or timer tasks\r
to be created. See the memory management section on the FreeRTOS web site\r
for more details. */\r
- for( ;; ); \r
+ for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
ulErrorFound = pdTRUE;\r
}\r
- \r
+\r
/* Check that the register test 1 task is still running. */\r
if( ulLastRegTest1Value == ulRegTest1LoopCounter )\r
{\r
/* Toggle the check LED to give an indication of the system status. If\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
- configTOGGLE_LED(); \r
- \r
+ configTOGGLE_LED();\r
+\r
/* Have any errors been latch in ulErrorFound? If so, shorten the\r
period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.\r
This will result in an increase in the rate at which mainCHECK_LED\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
+\r
/* This call to xTimerChangePeriod() uses a zero block time.\r
Functions called from inside of a timer callback function must\r
*never* attempt to block. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Create the register check tasks, as described at the top of this\r
file */\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
if( xCheckTimer != NULL )\r
{\r
xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* If all is well, the scheduler will now be running, and the following line\r
will never be reached. If the following line does execute, then there was\r
insufficient FreeRTOS heap memory available for the idle and/or timer tasks\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
\r
/* Create the register check tasks, as described at the top of this\r
file */\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*-----------------------------------------------------------\r
- * Normally, a demo application would define ParTest (parallel port test) \r
+ * Normally, a demo application would define ParTest (parallel port test)\r
* functions to write to an LED. In this case, four '*' symbols that are\r
* output to the debug printf() port are used to simulate LED outputs.\r
*-----------------------------------------------------------*/\r
*/\r
static void prvI2CGateKeeperTask( void *pvParameters );\r
\r
-/* The queue used to communicate toggle commands with the I2C gatekeeper \r
+/* The queue used to communicate toggle commands with the I2C gatekeeper\r
task. */\r
static xQueueHandle xI2CCommandQueue = NULL;\r
/*-----------------------------------------------------------*/\r
configASSERT( xI2CCommandQueue );\r
\r
/* Create the I2C gatekeeper task itself. */\r
- xTaskCreate( prvI2CGateKeeperTask, ( signed char * ) "I2C", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvI2CGateKeeperTask, "I2C", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
/* Which bit is being manipulated? */\r
ucLED = 0x01 << ucLED;\r
- \r
+\r
/* Is the bit currently set or clear? */\r
if( ( ucLEDState & ucLED ) == 0U )\r
{\r
{\r
ucLEDState &= ~ucLED;\r
}\r
- \r
+\r
ucBuffer[ 0 ] = partstIO_WRITE_COMMAND;\r
ucBuffer[ 1 ] = ucLEDState;\r
- \r
+\r
xI2CMessage.sl_addr7bit = partstSLAVE_ADDRESS;\r
xI2CMessage.tx_data = ucBuffer ;\r
xI2CMessage.tx_length = sizeof( ucBuffer );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* Infinite loop */\r
- for( ;; ); \r
+ for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
ulErrorFound |= 0x01UL << 9UL;\r
}\r
- \r
+\r
/* Check that the register test 1 task is still running. */\r
if( ulLastRegTest1Value == ulRegTest1LoopCounter )\r
{\r
/* Toggle the check LED to give an indication of the system status. If\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
- vParTestToggleLED( mainCHECK_LED ); \r
- \r
+ vParTestToggleLED( mainCHECK_LED );\r
+\r
/* Have any errors been latch in ulErrorFound? If so, shorten the\r
period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.\r
This will result in an increase in the rate at which mainCHECK_LED\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
+\r
/* This call to xTimerChangePeriod() uses a zero block time.\r
Functions called from inside of a timer callback function must\r
*never* attempt to block. */\r
\r
/* Wind the clock speed up in steps to its maximum. */\r
Hitex_CGU_Init();\r
- \r
+\r
/* Ensure all priority bits are assigned as preemption priority bits. */\r
NVIC_SetPriorityGrouping( 0 );\r
- \r
+\r
/* Setup the LED outputs. */\r
vParTestInitialise();\r
}\r
\r
/* Most importantly, start the tasks that use the FPU. */\r
vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
- \r
+\r
/* Create the register check tasks, as described at the top of this\r
file */\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
if( xCheckTimer != NULL )\r
{\r
xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
\r
void vApplicationTickHook( void )\r
{\r
- /* This function will be called by each tick interrupt if \r
+ /* This function will be called by each tick interrupt if\r
configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be\r
added here, but the tick hook is called from an interrupt context, so\r
code must not attempt to block, and only the interrupt safe FreeRTOS API\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Configure the hardware ready to run the test. */\r
prvSetupHardware();\r
- \r
+\r
/* Start standard demo/test application flash tasks. See the comments at\r
the top of this file. The LED flash tasks are always created. The other\r
tasks are only created if mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY is set to\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* If all is well, the scheduler will now be running, and the following line\r
will never be reached. If the following line does execute, then there was\r
insufficient FreeRTOS heap memory available for the idle and/or timer tasks\r
to be created. See the memory management section on the FreeRTOS web site\r
for more details. */\r
- for( ;; ); \r
+ for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
lErrorFound = pdTRUE;\r
}\r
- \r
+\r
/* Check that the register test 1 task is still running. */\r
if( ulLastRegTest1Value == ulRegTest1LoopCounter )\r
{\r
/* Toggle the check LED to give an indication of the system status. If\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
- vParTestToggleLED( mainCHECK_LED ); \r
- \r
+ vParTestToggleLED( mainCHECK_LED );\r
+\r
/* Have any errors been latch in lErrorFound? If so, shorten the\r
period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.\r
This will result in an increase in the rate at which mainCHECK_LED\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
+\r
/* This call to xTimerChangePeriod() uses a zero block time.\r
Functions called from inside of a timer callback function must\r
*never* attempt to block. */\r
an interrupt. Each time the button interrupt gives the semaphore, this task\r
will unblock, increment its execution counter, then return to block\r
again. */\r
- \r
+\r
/* Take the semaphore before started to ensure it is in the correct\r
state. */\r
xSemaphoreTake( xTestSemaphore, mainDONT_BLOCK );\r
- \r
+\r
for( ;; )\r
{\r
xSemaphoreTake( xTestSemaphore, portMAX_DELAY );\r
{\r
/* Setup STM32 system (clock, PLL and Flash configuration) */\r
SystemInit();\r
- \r
+\r
/* Ensure all priority bits are assigned as preemption priority bits. */\r
NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );\r
- \r
+\r
/* Setup the LED outputs. */\r
vParTestInitialise();\r
- \r
+\r
/* Configure the button input. This configures the interrupt to use the\r
lowest interrupt priority, so it is ok to use the ISR safe FreeRTOS API\r
from the button interrupt handler. */\r
\r
/* Fill the FPU registers with 0. */\r
vRegTestClearFlopRegistersToParameterValue( 0UL );\r
- \r
+\r
/* Trigger a timer 2 interrupt, which will fill the registers with a\r
different value and itself trigger a timer 3 interrupt. Note that the\r
timers are not actually used. The timer 2 and 3 interrupt vectors are\r
just used for convenience. */\r
NVIC_SetPendingIRQ( TIM2_IRQn );\r
- \r
+\r
/* Ensure that, after returning from the nested interrupts, all the FPU\r
registers contain the value to which they were set by the tick hook\r
function. */\r
configASSERT( ulRegTestCheckFlopRegistersContainParameterValue( 0UL ) );\r
- \r
+\r
ulFPUInterruptNesting--;\r
}\r
#endif\r
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;\r
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;\r
NVIC_Init( &NVIC_InitStructure );\r
- \r
+\r
/* Enable the TIM3 interrupt in the NVIC. The timer itself is not used,\r
just its interrupt vector to force nesting from software. TIM2 must have\r
a lower priority than TIM3, and both must have priorities above\r
/* Just to verify that the interrupt nesting behaves as expected, increment\r
ulFPUInterruptNesting on entry, and decrement it on exit. */\r
ulFPUInterruptNesting++;\r
- \r
+\r
/* This is the highest priority interrupt in the chain of forced nesting\r
interrupts, so latch the maximum value reached by ulFPUInterruptNesting.\r
This is done purely to allow verification that the nesting depth reaches\r
/* Fill the FPU registers with 99 to overwrite the values written by\r
TIM2_IRQHandler(). */\r
vRegTestClearFlopRegistersToParameterValue( 99UL );\r
- \r
+\r
ulFPUInterruptNesting--;\r
}\r
/*-----------------------------------------------------------*/\r
/* Just to verify that the interrupt nesting behaves as expected, increment\r
ulFPUInterruptNesting on entry, and decrement it on exit. */\r
ulFPUInterruptNesting++;\r
- \r
+\r
/* Fill the FPU registers with 1. */\r
vRegTestClearFlopRegistersToParameterValue( 1UL );\r
- \r
+\r
/* Trigger a timer 3 interrupt, which will fill the registers with a\r
different value. */\r
NVIC_SetPendingIRQ( TIM3_IRQn );\r
registers contain the value to which they were set by this interrupt\r
function. */\r
configASSERT( ulRegTestCheckFlopRegistersContainParameterValue( 1UL ) );\r
- \r
+\r
ulFPUInterruptNesting--;\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Most importantly, start the tasks that use the FPU. */\r
vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
- \r
+\r
/* Create the register check tasks, as described at the top of this\r
file */\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the semaphore that is used to demonstrate a task being\r
synchronised with an interrupt. */\r
vSemaphoreCreateBinary( xTestSemaphore );\r
\r
/* Create the task that is unblocked by the demonstration interrupt. */\r
- xTaskCreate( prvButtonTestTask, ( signed char * ) "BtnTest", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
- \r
+ xTaskCreate( prvButtonTestTask, "BtnTest", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
if( xCheckTimer != NULL )\r
{\r
xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
/* Only line 6 is enabled, so there is no need to test which line generated\r
the interrupt. */\r
EXTI_ClearITPendingBit( EXTI_Line6 );\r
- \r
+\r
/* This interrupt does nothing more than demonstrate how to synchronise a\r
task with an interrupt. First the handler releases a semaphore.\r
lHigherPriorityTaskWoken has been initialised to zero. */\r
xSemaphoreGiveFromISR( xTestSemaphore, &lHigherPriorityTaskWoken );\r
- \r
+\r
/* If there was a task that was blocked on the semaphore, and giving the\r
semaphore caused the task to unblock, and the unblocked task has a priority\r
higher than the currently executing task (the task that this interrupt\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
- configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
- ( void * ) xQueue, /* Pass the queue into the task using the task parameter. */\r
- mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
- NULL ); /* The task handle is not required, so NULL is passed. */\r
+ xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
+ ( void * ) xQueue, /* Pass the queue into the task using the task parameter. */\r
+ mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
+ NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) xQueue, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) xQueue, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the blinky software timer as described at the top of this\r
file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "Blinky",/* A text name, purely to help debugging. */\r
- ( mainBLINKY_TIMER_PERIOD ), /* The timer period. */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvBlinkyTimerCallback ); /* The callback function that inspects the status of all the other tasks. */\r
+ xTimer = xTimerCreate( "Blinky", /* A text name, purely to help debugging. */\r
+ ( mainBLINKY_TIMER_PERIOD ),/* The timer period. */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvBlinkyTimerCallback ); /* The callback function that inspects the status of all the other tasks. */\r
\r
configASSERT( xTimer );\r
\r
\r
/* Create the software timer that performs the 'check' functionality, as\r
described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback ); /* The callback function that inspects the status of all the other tasks. */\r
+ xTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback ); /* The callback function that inspects the status of all the other tasks. */\r
\r
if( xTimer != NULL )\r
{\r
for a new connection by lowering the priority of the IP task to that of\r
the Idle task. */\r
vTaskPrioritySet( NULL, tskIDLE_PRIORITY );\r
- \r
+\r
/* Disconnected - so no IP address. */\r
ili93xx_draw_string( ulXCoord, ulYCoord, ( uint8_t * ) "IP: " );\r
}\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
if( xCheckTimer != NULL )\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
configASSERT( xQueue );\r
\r
/* Start the two tasks as described at the top of this file. */\r
- xTaskCreate( prvQueueReceiveTask, ( const signed char * const ) "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( const signed char * const ) "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler running running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
xSerialPortInitMinimal( ulBaudRate, comBUFFER_LEN );\r
\r
/* The Tx task is spawned with a lower priority than the Rx task. */\r
- xTaskCreate( vComTxTask, ( signed char * ) "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );\r
- xTaskCreate( vComRxTask, ( signed char * ) "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vComTxTask, "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
the queue empty. */\r
#define mainQUEUE_LENGTH ( 1 )\r
\r
-/* Values passed to the two tasks just to check the task parameter \r
+/* Values passed to the two tasks just to check the task parameter\r
functionality. */\r
#define mainQUEUE_SEND_PARAMETER ( 0x1111UL )\r
#define mainQUEUE_RECEIVE_PARAMETER ( 0x22UL )\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
if( xCheckTimer != NULL )\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Start the two application specific demo tasks, as described in the\r
comments at the top of this file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( mainLED_TIMER_PERIOD_MS ),/* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* Create the software timer that performs the 'digit counting'\r
functionality, as described at the top of this file. */\r
- xDigitCounterTimer = xTimerCreate( ( const signed char * ) "DigitCounter", /* A text name, purely to help debugging. */\r
- ( mainDIGIT_COUNTER_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvDigitCounterTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xDigitCounterTimer = xTimerCreate( "DigitCounter", /* A text name, purely to help debugging. */\r
+ ( mainDIGIT_COUNTER_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvDigitCounterTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
/* Create a lot of 'standard demo' tasks. Over 40 tasks are created in\r
this demo. For a much simpler demo, select the 'blinky' build\r
configuration. */\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartCountingSemaphoreTasks();\r
vStartDynamicPriorityTasks();\r
- \r
+\r
/* The suicide tasks must be created last, as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
or not the correct/expected number of tasks are running at any given\r
{\r
pcStatusMessage = "Error: ComTest\r\n";\r
}\r
- \r
+\r
if( xAreTimerDemoTasksStillRunning( ( mainCHECK_TIMER_PERIOD_MS ) ) != pdTRUE )\r
{\r
pcStatusMessage = "Error: TimerDemo";\r
{\r
pcStatusMessage = "Error: CountSem";\r
}\r
- \r
+\r
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
{\r
pcStatusMessage = "Error: DynamicPriority";\r
}\r
- \r
+\r
/* Toggle the check LED to give an indication of the system status. If\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. vParTestToggleLED()\r
the state of the check LED. A critical section is not required to access\r
the port as only one timer can be executing at any one time. */\r
usCheckLEDState = ( FM3_GPIO->PDOR3 & mainCHECK_LED );\r
- \r
+\r
/* Display the next number, counting up. */\r
FM3_GPIO->PDOR3 = usNumbersPatterns[ lCounter ] | usCheckLEDState;\r
\r
- /* Move onto the next digit. */ \r
+ /* Move onto the next digit. */\r
lCounter++;\r
- \r
+\r
/* Ensure the counter does not go off the end of the array. */\r
if( lCounter >= lNumberOfDigits )\r
{\r
SystemCoreClockUpdate();\r
\r
/* Initialise the IO used for the LEDs on the 7 segment displays. */\r
- vParTestInitialise(); \r
- \r
+ vParTestInitialise();\r
+\r
/* Set the switches to input (P18->P1F). */\r
FM3_GPIO->DDR5 = 0x0000;\r
FM3_GPIO->PFR5 = 0x0000;\r
\r
/* Assign the button input as GPIO. */\r
FM3_GPIO->PFR5 |= usButtonInputBit;\r
- \r
+\r
/* Button interrupt on falling edge. */\r
FM3_EXTI->ELVR = 0x0003;\r
\r
\r
/* Enable the button interrupt. */\r
FM3_EXTI->ENIR |= usButtonInputBit;\r
- \r
+\r
/* Setup the GPIO and the NVIC for the switch used in this simple demo. */\r
NVIC_SetPriority( EXINT0_7_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );\r
NVIC_EnableIRQ( EXINT0_7_IRQn );\r
/* Call the periodic timer test, which tests the timer API functions that\r
can be called from an ISR. */\r
vTimerPeriodicISRTests();\r
-} \r
+}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Configure the NVIC, LED outputs and button inputs. */\r
prvSetupHardware();\r
- \r
+\r
/* Create the queue. */\r
xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );\r
\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- vLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ vLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Start the tasks and timer running. */\r
\r
SystemInit();\r
SystemCoreClockUpdate();\r
- \r
+\r
/* Analog inputs are not used on the LED outputs. */\r
FM3_GPIO->ADE = 0x0000;\r
- \r
+\r
/* Set to output. */\r
FM3_GPIO->DDR1 |= 0xFFFF;\r
FM3_GPIO->DDR3 |= 0xFFFF;\r
- \r
+\r
/* Set as GPIO. */\r
FM3_GPIO->PFR1 &= 0x0000;\r
FM3_GPIO->PFR3 &= 0x0000;\r
/* Start with all LEDs off. */\r
FM3_GPIO->PDOR3 = 0xFFFF;\r
FM3_GPIO->PDOR1 = 0xFFFF;\r
- \r
+\r
/* Set the switches to input (P18->P1F). */\r
FM3_GPIO->DDR5 = 0x0000;\r
FM3_GPIO->PFR5 = 0x0000;\r
\r
/* Assign the button input as GPIO. */\r
FM3_GPIO->PFR5 |= usButtonInputBit;\r
- \r
+\r
/* Button interrupt on falling edge. */\r
FM3_EXTI->ELVR = 0x0003;\r
\r
\r
/* Enable the button interrupt. */\r
FM3_EXTI->ENIR |= usButtonInputBit;\r
- \r
+\r
/* Setup the GPIO and the NVIC for the switch used in this simple demo. */\r
NVIC_SetPriority( EXINT0_7_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );\r
NVIC_EnableIRQ( EXINT0_7_IRQn );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Start the two application specific demo tasks, as described in the\r
comments at the top of this file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( mainLED_TIMER_PERIOD_MS ),/* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* Create the software timer that performs the 'digit counting'\r
functionality, as described at the top of this file. */\r
- xDigitCounterTimer = xTimerCreate( ( const signed char * ) "DigitCounter", /* A text name, purely to help debugging. */\r
- ( mainDIGIT_COUNTER_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvDigitCounterTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xDigitCounterTimer = xTimerCreate( "DigitCounter", /* A text name, purely to help debugging. */\r
+ ( mainDIGIT_COUNTER_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvDigitCounterTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
/* Create a lot of 'standard demo' tasks. Over 40 tasks are created in\r
this demo. For a much simpler demo, select the 'blinky' build\r
configuration. */\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartCountingSemaphoreTasks();\r
vStartDynamicPriorityTasks();\r
- \r
+\r
/* The suicide tasks must be created last, as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
or not the correct/expected number of tasks are running at any given\r
{\r
pcStatusMessage = "Error: ComTest\r\n";\r
}\r
- \r
+\r
if( xAreTimerDemoTasksStillRunning( ( mainCHECK_TIMER_PERIOD_MS ) ) != pdTRUE )\r
{\r
pcStatusMessage = "Error: TimerDemo";\r
{\r
pcStatusMessage = "Error: CountSem";\r
}\r
- \r
+\r
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
{\r
pcStatusMessage = "Error: DynamicPriority";\r
}\r
- \r
+\r
/* Toggle the check LED to give an indication of the system status. If\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
/* Display the next number, counting up. */\r
FM3_GPIO->PDOR1 = usNumbersPatterns[ lCounter ];\r
\r
- /* Move onto the next digit. */ \r
+ /* Move onto the next digit. */\r
lCounter++;\r
- \r
+\r
/* Ensure the counter does not go off the end of the array. */\r
if( lCounter >= lNumberOfDigits )\r
{\r
SystemCoreClockUpdate();\r
\r
/* Initialise the IO used for the LEDs on the 7 segment displays. */\r
- vParTestInitialise(); \r
- \r
+ vParTestInitialise();\r
+\r
/* Set the switches to input (P18->P1F). */\r
FM3_GPIO->DDR5 = 0x0000;\r
FM3_GPIO->PFR5 = 0x0000;\r
\r
/* Assign the button input as GPIO. */\r
FM3_GPIO->PFR1 |= usButtonInputBit;\r
- \r
+\r
/* Button interrupt on falling edge. */\r
FM3_EXTI->ELVR = 0x0003;\r
\r
\r
/* Enable the button interrupt. */\r
FM3_EXTI->ENIR |= usButtonInputBit;\r
- \r
+\r
/* Setup the GPIO and the NVIC for the switch used in this simple demo. */\r
NVIC_SetPriority( EXINT0_7_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );\r
NVIC_EnableIRQ( EXINT0_7_IRQn );\r
/* Call the periodic timer test, which tests the timer API functions that\r
can be called from an ISR. */\r
vTimerPeriodicISRTests();\r
-} \r
+}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- vLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( 5000 / portTICK_RATE_MS ),/* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ vLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Start the tasks and timer running. */\r
\r
SystemInit();\r
SystemCoreClockUpdate();\r
- \r
+\r
/* Analog inputs are not used on the LED outputs. */\r
FM3_GPIO->ADE = 0x00FF;\r
- \r
+\r
/* LED seg1 to GPIO output (P18->P1F). */\r
FM3_GPIO->DDR1 = 0xFF00;\r
FM3_GPIO->PFR1 = 0x0000;\r
- \r
+\r
/* LED seg2 to GPIO output (P30->P3F). */\r
FM3_GPIO->DDR3 = 0xFF00;\r
FM3_GPIO->PFR3 = 0x0000;\r
- \r
+\r
/* Start with all LEDs off. */\r
FM3_GPIO->PDOR3 = usGPIOState;\r
FM3_GPIO->PDOR1 = usGPIOState;\r
- \r
+\r
/* Set the switches to input (P18->P1F). */\r
FM3_GPIO->DDR5 = 0x0000;\r
FM3_GPIO->PFR5 = 0x0000;\r
\r
/* Assign the button input as GPIO. */\r
FM3_GPIO->PFR1 |= usButtonInputBit;\r
- \r
+\r
/* Button interrupt on falling edge. */\r
FM3_EXTI->ELVR = 0x0003;\r
\r
\r
/* Enable the button interrupt. */\r
FM3_EXTI->ENIR |= usButtonInputBit;\r
- \r
+\r
/* Setup the GPIO and the NVIC for the switch used in this simple demo. */\r
NVIC_SetPriority( EXINT0_7_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );\r
NVIC_EnableIRQ( EXINT0_7_IRQn );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
static const xTaskParameters xCheckTaskParameters =\r
{\r
prvCheckTask, /* pvTaskCode - the function that implements the task. */\r
- ( signed char * ) "Check", /* pcName */\r
+ "Check", /* pcName */\r
mainCHECK_TASK_STACK_SIZE_WORDS, /* usStackDepth - defined in words, not bytes. */\r
( void * ) 0x12121212, /* pvParameters - this value is just to test that the parameter is being passed into the task correctly. */\r
( tskIDLE_PRIORITY + 1 ) | portPRIVILEGE_BIT,/* uxPriority - this is the highest priority task in the system. The task is created in privileged mode to demonstrate accessing the privileged only data. */\r
static const xTaskParameters xRegTest1Parameters =\r
{\r
prvRegTest1Task, /* pvTaskCode - the function that implements the task. */\r
- ( signed char * ) "RegTest1", /* pcName */\r
+ "RegTest1", /* pcName */\r
mainREG_TEST_STACK_SIZE_WORDS, /* usStackDepth */\r
( void * ) 0x12345678, /* pvParameters - this value is just to test that the parameter is being passed into the task correctly. */\r
tskIDLE_PRIORITY | portPRIVILEGE_BIT, /* uxPriority - note that this task is created with privileges to demonstrate one method of passing a queue handle into the task. */\r
static xTaskParameters xRegTest2Parameters =\r
{\r
prvRegTest2Task, /* pvTaskCode - the function that implements the task. */\r
- ( signed char * ) "RegTest2", /* pcName */\r
+ "RegTest2", /* pcName */\r
mainREG_TEST_STACK_SIZE_WORDS, /* usStackDepth */\r
( void * ) NULL, /* pvParameters - this task uses the parameter to pass in a queue handle, but the queue is not created yet. */\r
tskIDLE_PRIORITY, /* uxPriority */\r
/* Create the tasks that are created using the original xTaskCreate() API\r
function. */\r
xTaskCreate( prvOldStyleUserModeTask, /* The function that implements the task. */\r
- ( signed char * ) "Task1", /* Text name for the task. */\r
+ "Task1", /* Text name for the task. */\r
100, /* Stack depth in words. */\r
NULL, /* Task parameters. */\r
3, /* Priority and mode (user in this case). */\r
);\r
\r
xTaskCreate( prvOldStylePrivilegedModeTask, /* The function that implements the task. */\r
- ( signed char * ) "Task2", /* Text name for the task. */\r
+ "Task2", /* Text name for the task. */\r
100, /* Stack depth in words. */\r
NULL, /* Task parameters. */\r
( 3 | portPRIVILEGE_BIT ), /* Priority and mode. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* User mode and Privileged mode, and using both the original xTaskCreate() and\r
* the new xTaskCreateRestricted() API functions. The purpose of each created\r
* task is documented in the comments above the task function prototype (in\r
- * this file), with the task behaviour demonstrated and documented within the \r
+ * this file), with the task behaviour demonstrated and documented within the\r
* task function itself. In addition a queue is used to demonstrate passing\r
* data between protected/restricted tasks as well as passing data between an\r
* interrupt and a protected/restricted task.\r
/* Prototypes for functions that implement tasks. -----------*/\r
/*-----------------------------------------------------------*/\r
\r
-/* \r
+/*\r
* Prototype for the reg test tasks. Amongst other things, these fill the CPU\r
* registers with known values before checking that the registers still contain\r
* the expected values. Each of the two tasks use different values so an error\r
static void prvCheckTask( void *pvParameters );\r
\r
/*\r
- * Prototype for a task created in User mode using the original vTaskCreate() \r
+ * Prototype for a task created in User mode using the original vTaskCreate()\r
* API function. The task demonstrates the characteristics of such a task,\r
* before simply deleting itself.\r
*/\r
static void prvOldStyleUserModeTask( void *pvParameters );\r
\r
/*\r
- * Prototype for a task created in Privileged mode using the original \r
- * vTaskCreate() API function. The task demonstrates the characteristics of \r
+ * Prototype for a task created in Privileged mode using the original\r
+ * vTaskCreate() API function. The task demonstrates the characteristics of\r
* such a task, before simply deleting itself.\r
*/\r
static void prvOldStylePrivilegedModeTask( void *pvParameters );\r
/* The handle of the queue used to communicate between tasks and between tasks\r
and interrupts. Note that this is a file scope variable that falls outside of\r
any MPU region. As such other techniques have to be used to allow the tasks\r
-to gain access to the queue. See the comments in the tasks themselves for \r
+to gain access to the queue. See the comments in the tasks themselves for\r
further information. */\r
static xQueueHandle xFileScopeCheckQueue = NULL;\r
\r
#define mainCHECK_TASK_STACK_ALIGNMENT ( mainCHECK_TASK_STACK_SIZE_WORDS * sizeof( portSTACK_TYPE ) )\r
\r
/* Declare the stack that will be used by the check task. The kernel will\r
- automatically create an MPU region for the stack. The stack alignment must \r
- match its size, so if 128 words are reserved for the stack then it must be \r
+ automatically create an MPU region for the stack. The stack alignment must\r
+ match its size, so if 128 words are reserved for the stack then it must be\r
aligned to ( 128 * 4 ) bytes. */\r
static portSTACK_TYPE xCheckTaskStack[ mainCHECK_TASK_STACK_SIZE_WORDS ] mainALIGN_TO( mainCHECK_TASK_STACK_ALIGNMENT );\r
\r
MPU FUNCTIONALITY, the data is not used by the check tasks primary function\r
of monitoring the reg test tasks and printing out status information.\r
\r
-Note that the arrays allocate slightly more RAM than is actually assigned to \r
-the MPU region. This is to permit writes off the end of the array to be \r
-detected even when the arrays are placed in adjacent memory locations (with no \r
+Note that the arrays allocate slightly more RAM than is actually assigned to\r
+the MPU region. This is to permit writes off the end of the array to be\r
+detected even when the arrays are placed in adjacent memory locations (with no\r
gaps between them). The align size must be a power of two. */\r
#define mainREAD_WRITE_ARRAY_SIZE 130\r
#define mainREAD_WRITE_ALIGN_SIZE 128\r
static const xTaskParameters xCheckTaskParameters =\r
{\r
prvCheckTask, /* pvTaskCode - the function that implements the task. */\r
- ( signed char * ) "Check", /* pcName */\r
+ "Check", /* pcName */\r
mainCHECK_TASK_STACK_SIZE_WORDS, /* usStackDepth - defined in words, not bytes. */\r
( void * ) 0x12121212, /* pvParameters - this value is just to test that the parameter is being passed into the task correctly. */\r
( tskIDLE_PRIORITY + 1 ) | portPRIVILEGE_BIT,/* uxPriority - this is the highest priority task in the system. The task is created in privileged mode to demonstrate accessing the privileged only data. */\r
created with different parameters. Again, THIS IS JUST TO DEMONSTRATE THE\r
MPU FUNCTIONALITY, the data is not used by the check tasks primary function\r
of monitoring the reg test tasks and printing out status information.*/\r
- { \r
+ {\r
/* Base address Length Parameters */\r
{ cReadWriteArray, mainREAD_WRITE_ALIGN_SIZE, portMPU_REGION_READ_WRITE },\r
{ cReadOnlyArray, mainREAD_ONLY_ALIGN_SIZE, portMPU_REGION_READ_ONLY },\r
}\r
};\r
\r
-/* Three MPU regions are defined for use by the 'check' task when the task is \r
+/* Three MPU regions are defined for use by the 'check' task when the task is\r
created. These are only used to demonstrate the MPU features and are not\r
actually necessary for the check task to fulfill its primary purpose. Instead\r
-the MPU regions are replaced with those defined by xAltRegions prior to the \r
+the MPU regions are replaced with those defined by xAltRegions prior to the\r
check task receiving any data on the queue or printing any messages to the\r
debug console. The MPU region defined below covers the GPIO peripherals used\r
to write to the LCD. */\r
static const xMemoryRegion xAltRegions[ portNUM_CONFIGURABLE_REGIONS ] =\r
-{ \r
+{\r
/* Base address Length Parameters */\r
{ mainGPIO_START_ADDRESS, ( 64 * 1024 ), portMPU_REGION_READ_WRITE },\r
{ 0, 0, 0 },\r
#define mainREG_TEST_STACK_ALIGNMENT ( mainREG_TEST_STACK_SIZE_WORDS * sizeof( portSTACK_TYPE ) )\r
\r
/* Declare the stacks that will be used by the reg test tasks. The kernel will\r
-automatically create an MPU region for the stack. The stack alignment must \r
-match its size, so if 128 words are reserved for the stack then it must be \r
+automatically create an MPU region for the stack. The stack alignment must\r
+match its size, so if 128 words are reserved for the stack then it must be\r
aligned to ( 128 * 4 ) bytes. */\r
static portSTACK_TYPE xRegTest1Stack[ mainREG_TEST_STACK_SIZE_WORDS ] mainALIGN_TO( mainREG_TEST_STACK_ALIGNMENT );\r
static portSTACK_TYPE xRegTest2Stack[ mainREG_TEST_STACK_SIZE_WORDS ] mainALIGN_TO( mainREG_TEST_STACK_ALIGNMENT );\r
static const xTaskParameters xRegTest1Parameters =\r
{\r
prvRegTest1Task, /* pvTaskCode - the function that implements the task. */\r
- ( signed char * ) "RegTest1", /* pcName */\r
+ "RegTest1", /* pcName */\r
mainREG_TEST_STACK_SIZE_WORDS, /* usStackDepth */\r
( void * ) 0x12345678, /* pvParameters - this value is just to test that the parameter is being passed into the task correctly. */\r
tskIDLE_PRIORITY | portPRIVILEGE_BIT, /* uxPriority - note that this task is created with privileges to demonstrate one method of passing a queue handle into the task. */\r
static xTaskParameters xRegTest2Parameters =\r
{\r
prvRegTest2Task, /* pvTaskCode - the function that implements the task. */\r
- ( signed char * ) "RegTest2", /* pcName */\r
+ "RegTest2", /* pcName */\r
mainREG_TEST_STACK_SIZE_WORDS, /* usStackDepth */\r
( void * ) NULL, /* pvParameters - this task uses the parameter to pass in a queue handle, but the queue is not created yet. */\r
tskIDLE_PRIORITY, /* uxPriority */\r
/* Create the tasks that are created using the original xTaskCreate() API\r
function. */\r
xTaskCreate( prvOldStyleUserModeTask, /* The function that implements the task. */\r
- ( signed char * ) "Task1", /* Text name for the task. */\r
+ "Task1", /* Text name for the task. */\r
100, /* Stack depth in words. */\r
NULL, /* Task parameters. */\r
3, /* Priority and mode (user in this case). */\r
);\r
\r
xTaskCreate( prvOldStylePrivilegedModeTask, /* The function that implements the task. */\r
- ( signed char * ) "Task2", /* Text name for the task. */\r
+ "Task2", /* Text name for the task. */\r
100, /* Stack depth in words. */\r
NULL, /* Task parameters. */\r
( 3 | portPRIVILEGE_BIT ), /* Priority and mode. */\r
/* Just to remove compiler warning. */\r
( void ) pvParameters;\r
\r
- /* Demonstrate how the various memory regions can and can't be accessed. \r
+ /* Demonstrate how the various memory regions can and can't be accessed.\r
The task privilege is set down to user mode within this function. */\r
prvTestMemoryRegions();\r
\r
{\r
/* Wait for the next message to arrive. */\r
xQueueReceive( xQueue, &lMessage, portMAX_DELAY );\r
- \r
+\r
switch( lMessage )\r
{\r
- case mainREG_TEST_1_STILL_EXECUTING : \r
+ case mainREG_TEST_1_STILL_EXECUTING :\r
/* Message from task 1, so task 1 must still be executing. */\r
( ulStillAliveCounts[ 0 ] )++;\r
break;\r
\r
- case mainREG_TEST_2_STILL_EXECUTING : \r
+ case mainREG_TEST_2_STILL_EXECUTING :\r
/* Message from task 2, so task 2 must still be executing. */\r
( ulStillAliveCounts[ 1 ] )++;\r
break;\r
\r
- case mainPRINT_SYSTEM_STATUS : \r
+ case mainPRINT_SYSTEM_STATUS :\r
/* Message from tick hook, time to print out the system\r
status. If messages has stopped arriving from either reg\r
test task then the status must be set to fail. */\r
if( ( ulStillAliveCounts[ 0 ] == 0 ) || ( ulStillAliveCounts[ 1 ] == 0 ) )\r
{\r
- /* One or both of the test tasks are no longer sending \r
+ /* One or both of the test tasks are no longer sending\r
'still alive' messages. */\r
pcStatusMessage = "FAIL\r\n";\r
}\r
/* Print a pass/fail message to the LCD - moving the\r
message each time to provide feedback that the output\r
is still being produced. LCD_PrintString() accesses const\r
- data stored in flash, which all tasks are at liberty to do, \r
+ data stored in flash, which all tasks are at liberty to do,\r
and GPIO for which an MPU region has been set up for it. */\r
LCD_ClearScreen();\r
LCD_PrintString( x>>1, y>>1, pcStatusMessage, 6, COLOR_RED );\r
break;\r
\r
default :\r
- /* Something unexpected happened. Delete this task so the \r
+ /* Something unexpected happened. Delete this task so the\r
error is apparent (no output will be displayed). */\r
prvDeleteMe();\r
break;\r
long l;\r
char cTemp;\r
\r
- /* The check task (from which this function is called) is created in the \r
- Privileged mode. The privileged array can be both read from and written \r
+ /* The check task (from which this function is called) is created in the\r
+ Privileged mode. The privileged array can be both read from and written\r
to while this task is privileged. */\r
cPrivilegedOnlyAccessArray[ 0 ] = 'a';\r
if( cPrivilegedOnlyAccessArray[ 0 ] != 'a' )\r
}\r
\r
/* Writing off the end of the RAM allocated to this task will *NOT* cause a\r
- protection fault because the task is still executing in a privileged mode. \r
+ protection fault because the task is still executing in a privileged mode.\r
Uncomment the following to test. */\r
/* cPrivilegedOnlyAccessArray[ mainPRIVILEGED_ONLY_ACCESS_ALIGN_SIZE ] = 'a'; */\r
\r
/* Now set the task into user mode. */\r
portSWITCH_TO_USER_MODE();\r
- \r
- /* Accessing the privileged only array will now cause a fault. Uncomment \r
- the following line to test. */ \r
+\r
+ /* Accessing the privileged only array will now cause a fault. Uncomment\r
+ the following line to test. */\r
/* cPrivilegedOnlyAccessArray[ 0 ] = 'a'; */\r
\r
/* The read/write array can still be successfully read and written. */\r
}\r
\r
/* But attempting to read or write off the end of the RAM allocated to this\r
- task will cause a fault. Uncomment either of the following two lines to \r
+ task will cause a fault. Uncomment either of the following two lines to\r
test. */\r
/* cReadWriteArray[ 0 ] = cReadWriteArray[ -1 ]; */\r
/* cReadWriteArray[ mainREAD_WRITE_ALIGN_SIZE ] = 0x00; */\r
/* ...but cannot be written. Uncomment the following line to test. */\r
/* cReadOnlyArray[ 0 ] = 'a'; */\r
\r
- /* Writing to the first and last locations in the stack array should not \r
+ /* Writing to the first and last locations in the stack array should not\r
cause a protection fault. Note that doing this will cause the kernel to\r
- detect a stack overflow if configCHECK_FOR_STACK_OVERFLOW is greater than \r
+ detect a stack overflow if configCHECK_FOR_STACK_OVERFLOW is greater than\r
1. */\r
xCheckTaskStack[ 0 ] = 0;\r
xCheckTaskStack[ mainCHECK_TASK_STACK_SIZE_WORDS - 1 ] = 0;\r
\r
- /* Writing off either end of the stack array should cause a protection \r
+ /* Writing off either end of the stack array should cause a protection\r
fault, uncomment either of the following two lines to test. */\r
/* xCheckTaskStack[ -1 ] = 0; */\r
/* xCheckTaskStack[ mainCHECK_TASK_STACK_SIZE_WORDS ] = 0; */\r
longer be accessible but the stack copy will. */\r
xQueueHandle xQueue = xFileScopeCheckQueue;\r
\r
- /* Now the queue handle has been obtained the task can switch to user \r
+ /* Now the queue handle has been obtained the task can switch to user\r
mode. This is just one method of passing a handle into a protected\r
task, the other reg test task uses the task parameter instead. */\r
portSWITCH_TO_USER_MODE();\r
\r
\r
for( ;; )\r
- { \r
+ {\r
/* This task tests the kernel context switch mechanism by reading and\r
writing directly to registers - which requires the test to be written\r
in assembly code. */\r
- __asm volatile \r
- ( \r
+ __asm volatile\r
+ (\r
" MOV R4, #104 \n" /* Set registers to a known value. R0 to R1 are done in the loop below. */\r
" MOV R5, #105 \n"\r
" MOV R6, #106 \n"\r
" BNE prvDeleteMe \n"\r
" CMP R3, #103 \n"\r
" BNE prvDeleteMe \n"\r
- " CMP R4, #104 \n" \r
- " BNE prvDeleteMe \n" \r
+ " CMP R4, #104 \n"\r
+ " BNE prvDeleteMe \n"\r
" CMP R5, #105 \n"\r
" BNE prvDeleteMe \n"\r
" CMP R6, #106 \n"\r
:::"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r8", "r9", "r10", "r11", "r12"\r
);\r
\r
- /* Send mainREG_TEST_1_STILL_EXECUTING to the check task to indicate that this \r
+ /* Send mainREG_TEST_1_STILL_EXECUTING to the check task to indicate that this\r
task is still functioning. */\r
prvSendImAlive( xQueue, mainREG_TEST_1_STILL_EXECUTING );\r
\r
static void prvRegTest2Task( void *pvParameters )\r
{\r
/* The queue handle is passed in as the task parameter. This is one method of\r
-passing data into a protected task, the other reg test task uses a different \r
+passing data into a protected task, the other reg test task uses a different\r
method. */\r
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;\r
\r
/* This task tests the kernel context switch mechanism by reading and\r
writing directly to registers - which requires the test to be written\r
in assembly code. */\r
- __asm volatile \r
- ( \r
+ __asm volatile\r
+ (\r
" MOV R4, #4 \n" /* Set registers to a known value. R0 to R1 are done in the loop below. */\r
" MOV R5, #5 \n"\r
" MOV R6, #6 \n"\r
" MOV R8, #8 \n" /* Frame pointer is omitted as it must not be changed. */\r
" MOV R9, #9 \n"\r
" MOV R10, 10 \n"\r
- " MOV R11, #11 \n" \r
+ " MOV R11, #11 \n"\r
"reg2loop: \n"\r
" MOV R0, #13 \n" /* Set the scratch registers to known values - done inside the loop as they get clobbered. */\r
" MOV R1, #1 \n"\r
:::"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r8", "r9", "r10", "r11", "r12"\r
);\r
\r
- /* Send mainREG_TEST_2_STILL_EXECUTING to the check task to indicate that this \r
+ /* Send mainREG_TEST_2_STILL_EXECUTING to the check task to indicate that this\r
task is still functioning. */\r
prvSendImAlive( xQueue, mainREG_TEST_2_STILL_EXECUTING );\r
\r
\r
/* The idle task, and therefore this function, run in Supervisor mode and\r
can therefore access all memory. Try reading from corners of flash and\r
- RAM to ensure a memory fault does not occur. \r
- \r
+ RAM to ensure a memory fault does not occur.\r
+\r
Start with the edges of the privileged data area. */\r
pul = __privileged_data_start__;\r
ulReadData = *pul;\r
pul = __FLASH_segment_end__ - 1;\r
ulReadData = *pul;\r
\r
- /* Reading off the end of Flash or SRAM space should cause a fault. \r
+ /* Reading off the end of Flash or SRAM space should cause a fault.\r
Uncomment one of the following two pairs of lines to test. */\r
- \r
+\r
/* pul = __FLASH_segment_end__ + 4;\r
ulReadData = *pul; */\r
\r
volatile unsigned long *pul;\r
volatile unsigned long ulReadData;\r
\r
-/* The following lines are commented out to prevent the unused variable \r
+/* The following lines are commented out to prevent the unused variable\r
compiler warnings when the tests that use the variable are also commented out.\r
extern unsigned long __privileged_functions_start__[];\r
const volatile unsigned long *pulSystemPeripheralRegister = ( volatile unsigned long * ) 0xe000e014; */\r
\r
/* pul = __privileged_functions_start__;\r
ulReadData = *pul; */\r
- \r
+\r
/* pul = __privileged_functions_end__ - 1;\r
ulReadData = *pul; */\r
\r
/* pul = __privileged_data_start__;\r
- ulReadData = *pul; */ \r
- \r
+ ulReadData = *pul; */\r
+\r
/* pul = __privileged_data_end__ - 1;\r
ulReadData = *pul; */\r
\r
- /* Must not just run off the end of a task function, so delete this task. \r
+ /* Must not just run off the end of a task function, so delete this task.\r
Note that because this task was created using xTaskCreate() the stack was\r
allocated dynamically and I have not included any code to free it again. */\r
vTaskDelete( NULL );\r
\r
( void ) pvParameters;\r
\r
- /* This task is created in Privileged mode using the original xTaskCreate() \r
- API function. It should have access to all Flash and RAM including that \r
- marked as Privileged access only. So reading from the start and end of the \r
- non-privileged RAM should not cause a problem (the privileged RAM is the \r
+ /* This task is created in Privileged mode using the original xTaskCreate()\r
+ API function. It should have access to all Flash and RAM including that\r
+ marked as Privileged access only. So reading from the start and end of the\r
+ non-privileged RAM should not cause a problem (the privileged RAM is the\r
first block at the bottom of the RAM memory). */\r
pul = __privileged_data_end__ + 1;\r
ulReadData = *pul;\r
pul = __privileged_functions_end__ - 1;\r
ulReadData = *pul;\r
pul = __privileged_data_start__;\r
- ulReadData = *pul; \r
+ ulReadData = *pul;\r
pul = __privileged_data_end__ - 1;\r
ulReadData = *pul;\r
\r
ulReadData = *pulSystemPeripheralRegister;\r
ulReadData = *pulStandardPeripheralRegister;\r
\r
- /* Must not just run off the end of a task function, so delete this task. \r
+ /* Must not just run off the end of a task function, so delete this task.\r
Note that because this task was created using xTaskCreate() the stack was\r
allocated dynamically and I have not included any code to free it again. */\r
vTaskDelete( NULL );\r
if ( SC->PLL0STAT & ( 1 << 25 ) )\r
{\r
/* Enable PLL, disconnected. */\r
- SC->PLL0CON = 1; \r
+ SC->PLL0CON = 1;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
}\r
- \r
+\r
/* Disable PLL, disconnected. */\r
- SC->PLL0CON = 0; \r
+ SC->PLL0CON = 0;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable main OSC. */\r
- SC->SCS |= 0x20; \r
+ SC->SCS |= 0x20;\r
while( !( SC->SCS & 0x40 ) );\r
- \r
+\r
/* select main OSC, 12MHz, as the PLL clock source. */\r
- SC->CLKSRCSEL = 0x1; \r
- \r
+ SC->CLKSRCSEL = 0x1;\r
+\r
SC->PLL0CFG = 0x20031;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable PLL, disconnected. */\r
- SC->PLL0CON = 1; \r
+ SC->PLL0CON = 1;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Set clock divider. */\r
SC->CCLKCFG = 0x03;\r
- \r
+\r
/* Configure flash accelerator. */\r
SC->FLASHCFG = 0x403a;\r
- \r
+\r
/* Check lock bit status. */\r
- while( ( ( SC->PLL0STAT & ( 1 << 26 ) ) == 0 ) ); \r
- \r
+ while( ( ( SC->PLL0STAT & ( 1 << 26 ) ) == 0 ) );\r
+\r
/* Enable and connect. */\r
- SC->PLL0CON = 3; \r
+ SC->PLL0CON = 3;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- while( ( ( SC->PLL0STAT & ( 1 << 25 ) ) == 0 ) ); \r
+ while( ( ( SC->PLL0STAT & ( 1 << 25 ) ) == 0 ) );\r
+\r
+\r
+\r
\r
- \r
- \r
- \r
/* Configure the clock for the USB. */\r
- \r
+\r
if( SC->PLL1STAT & ( 1 << 9 ) )\r
{\r
/* Enable PLL, disconnected. */\r
- SC->PLL1CON = 1; \r
+ SC->PLL1CON = 1;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
}\r
- \r
+\r
/* Disable PLL, disconnected. */\r
- SC->PLL1CON = 0; \r
+ SC->PLL1CON = 0;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
- \r
+\r
SC->PLL1CFG = 0x23;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
- \r
+\r
/* Enable PLL, disconnected. */\r
- SC->PLL1CON = 1; \r
+ SC->PLL1CON = 1;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
while( ( ( SC->PLL1STAT & ( 1 << 10 ) ) == 0 ) );\r
- \r
+\r
/* Enable and connect. */\r
- SC->PLL1CON = 3; \r
+ SC->PLL1CON = 3;\r
SC->PLL1FEED = PLLFEED_FEED1;\r
SC->PLL1FEED = PLLFEED_FEED2;\r
while( ( ( SC->PLL1STAT & ( 1 << 9 ) ) == 0 ) );\r
\r
/* Setup the peripheral bus to be the same as the PLL output (64 MHz). */\r
SC->PCLKSEL0 = 0x05555555;\r
- \r
+\r
/* Prepare the LCD. */\r
LCDdriver_initialisation();\r
LCD_PrintString( 5, 10, "FreeRTOS.org", 14, COLOR_GREEN);\r
ulCallCount = 0;\r
\r
/* Send a message to the check task to command it to check that all\r
- the tasks are still running then print out the status. \r
- \r
+ the tasks are still running then print out the status.\r
+\r
This is running in an ISR so has to use the "FromISR" version of\r
xQueueSend(). Because it is in an ISR it is running with privileges\r
so can access xFileScopeCheckQueue directly. */\r
\r
void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )\r
{\r
- /* If configCHECK_FOR_STACK_OVERFLOW is set to either 1 or 2 then this \r
+ /* If configCHECK_FOR_STACK_OVERFLOW is set to either 1 or 2 then this\r
function will automatically get called if a task overflows its stack. */\r
( void ) pxTask;\r
( void ) pcTaskName;\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Creates eight tasks, each of which loops continuously performing an (emulated) \r
+ * Creates eight tasks, each of which loops continuously performing an (emulated)\r
* floating point calculation.\r
*\r
- * All the tasks run at the idle priority and never block or yield. This causes \r
- * all eight tasks to time slice with the idle task. Running at the idle priority \r
+ * All the tasks run at the idle priority and never block or yield. This causes\r
+ * all eight tasks to time slice with the idle task. Running at the idle priority\r
* means that these tasks will get pre-empted any time another task is ready to run\r
- * or a time slice occurs. More often than not the pre-emption will occur mid \r
- * calculation, creating a good test of the schedulers context switch mechanism - a \r
- * calculation producing an unexpected result could be a symptom of a corruption in \r
+ * or a time slice occurs. More often than not the pre-emption will occur mid\r
+ * calculation, creating a good test of the schedulers context switch mechanism - a\r
+ * calculation producing an unexpected result could be a symptom of a corruption in\r
* the context of a task.\r
*/\r
\r
#define mathSTACK_SIZE configMINIMAL_STACK_SIZE\r
#define mathNUMBER_OF_TASKS ( 8 )\r
\r
-/* Four tasks, each of which performs a different floating point calculation. \r
+/* Four tasks, each of which performs a different floating point calculation.\r
Each of the four is created twice. */\r
static portTASK_FUNCTION_PROTO( vCompetingMathTask1, pvParameters );\r
static portTASK_FUNCTION_PROTO( vCompetingMathTask2, pvParameters );\r
static portTASK_FUNCTION_PROTO( vCompetingMathTask3, pvParameters );\r
static portTASK_FUNCTION_PROTO( vCompetingMathTask4, pvParameters );\r
\r
-/* These variables are used to check that all the tasks are still running. If a \r
+/* These variables are used to check that all the tasks are still running. If a\r
task gets a calculation wrong it will\r
stop incrementing its check variable. */\r
static volatile unsigned long ulTaskCheck[ mathNUMBER_OF_TASKS ] = { 0 };\r
\r
void vStartMathTasks( unsigned portBASE_TYPE uxPriority )\r
{\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math1", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 0 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math2", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 1 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math3", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 2 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math4", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 3 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math5", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 4 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math6", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 5 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math7", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 6 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math8", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 7 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 0 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 1 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 2 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 3 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 4 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 5 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 6 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( ulTaskCheck[ 7 ] ), uxPriority, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
dAnswer = ( d1 + d2 ) * d3;\r
\r
- /* The variable this task increments to show it is still running is passed in \r
+ /* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
pulTaskCheckVariable = ( unsigned long * ) pvParameters;\r
\r
taskYIELD();\r
#endif\r
\r
- /* If the calculation does not match the expected constant, stop the \r
+ /* If the calculation does not match the expected constant, stop the\r
increment of the check variable. */\r
if( fabs( d4 - dAnswer ) > 0.001 )\r
{\r
\r
if( sError == pdFALSE )\r
{\r
- /* If the calculation has always been correct, increment the check \r
+ /* If the calculation has always been correct, increment the check\r
variable so we know this task is still running okay. */\r
( *pulTaskCheckVariable )++;\r
}\r
dAnswer = ( d1 / d2 ) * d3;\r
\r
\r
- /* The variable this task increments to show it is still running is passed in \r
+ /* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
pulTaskCheckVariable = ( unsigned long * ) pvParameters;\r
\r
#if configUSE_PREEMPTION == 0\r
taskYIELD();\r
#endif\r
- \r
- /* If the calculation does not match the expected constant, stop the \r
+\r
+ /* If the calculation does not match the expected constant, stop the\r
increment of the check variable. */\r
if( fabs( d4 - dAnswer ) > 0.001 )\r
{\r
\r
if( sError == pdFALSE )\r
{\r
- /* If the calculation has always been correct, increment the check \r
+ /* If the calculation has always been correct, increment the check\r
variable so we know\r
this task is still running okay. */\r
( *pulTaskCheckVariable )++;\r
vPortTaskUsesFPU();\r
#endif\r
\r
- /* The variable this task increments to show it is still running is passed in \r
+ /* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
pulTaskCheckVariable = ( unsigned long * ) pvParameters;\r
\r
pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );\r
\r
- /* Keep filling an array, keeping a running total of the values placed in the \r
- array. Then run through the array adding up all the values. If the two totals \r
+ /* Keep filling an array, keeping a running total of the values placed in the\r
+ array. Then run through the array adding up all the values. If the two totals\r
do not match, stop the check variable from incrementing. */\r
for( ;; )\r
{\r
for( xPosition = 0; xPosition < xArraySize; xPosition++ )\r
{\r
pdArray[ xPosition ] = ( portDOUBLE ) xPosition + 5.5;\r
- dTotal1 += ( portDOUBLE ) xPosition + 5.5; \r
+ dTotal1 += ( portDOUBLE ) xPosition + 5.5;\r
}\r
\r
#if configUSE_PREEMPTION == 0\r
\r
if( sError == pdFALSE )\r
{\r
- /* If the calculation has always been correct, increment the check \r
+ /* If the calculation has always been correct, increment the check\r
variable so we know this task is still running okay. */\r
( *pulTaskCheckVariable )++;\r
}\r
vPortTaskUsesFPU();\r
#endif\r
\r
- /* The variable this task increments to show it is still running is passed in \r
+ /* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
pulTaskCheckVariable = ( unsigned long * ) pvParameters;\r
\r
pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );\r
\r
- /* Keep filling an array, keeping a running total of the values placed in the \r
- array. Then run through the array adding up all the values. If the two totals \r
+ /* Keep filling an array, keeping a running total of the values placed in the\r
+ array. Then run through the array adding up all the values. If the two totals\r
do not match, stop the check variable from incrementing. */\r
for( ;; )\r
{\r
for( xPosition = 0; xPosition < xArraySize; xPosition++ )\r
{\r
pdArray[ xPosition ] = ( portDOUBLE ) xPosition * 12.123;\r
- dTotal1 += ( portDOUBLE ) xPosition * 12.123; \r
+ dTotal1 += ( portDOUBLE ) xPosition * 12.123;\r
}\r
\r
#if configUSE_PREEMPTION == 0\r
\r
if( sError == pdFALSE )\r
{\r
- /* If the calculation has always been correct, increment the check \r
+ /* If the calculation has always been correct, increment the check\r
variable so we know this task is still running okay. */\r
( *pulTaskCheckVariable )++;\r
}\r
}\r
-} \r
+}\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
portBASE_TYPE xAreMathsTaskStillRunning( void )\r
{\r
-/* Keep a history of the check variables so we know if they have been incremented \r
+/* Keep a history of the check variables so we know if they have been incremented\r
since the last call. */\r
static unsigned long ulLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };\r
portBASE_TYPE xReturn = pdTRUE, xTask;\r
\r
- /* Check the maths tasks are still running by ensuring their check variables \r
+ /* Check the maths tasks are still running by ensuring their check variables\r
are still incrementing. */\r
for( xTask = 0; xTask < mathNUMBER_OF_TASKS; xTask++ )\r
{\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
the queue empty. */\r
#define mainQUEUE_LENGTH ( 1 )\r
\r
-/* Values passed to the two tasks just to check the task parameter \r
+/* Values passed to the two tasks just to check the task parameter\r
functionality. */\r
#define mainQUEUE_SEND_PARAMETER ( 0x1111UL )\r
#define mainQUEUE_RECEIVE_PARAMETER ( 0x22UL )\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* software time maintains a pattern of spinning white LEDs.\r
*\r
* See the documentation page for this demo on the FreeRTOS.org web site for\r
- * full information, including hardware setup requirements. \r
+ * full information, including hardware setup requirements.\r
*/\r
\r
/* Standard includes. */\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
\r
/* Create the register test tasks, as described at the top of this file. */\r
- xTaskCreate( vRegTestTask1, ( const signed char * ) "Reg1...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTestTask2, ( const signed char * ) "Reg2...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- \r
+ xTaskCreate( vRegTestTask1, "Reg1...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTestTask2, "Reg2...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
- \r
+\r
if( xTimer != NULL )\r
{\r
xTimerStart( xTimer, mainDONT_BLOCK );\r
\r
/* Create the software timer that performs the 'LED spin' functionality,\r
as described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 75ms. */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvLEDTimerCallback /* The callback function that toggles the white LEDs. */\r
+ xTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( mainLED_TIMER_PERIOD_MS ),/* The timer period, in this case 75ms. */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvLEDTimerCallback /* The callback function that toggles the white LEDs. */\r
);\r
\r
if( xTimer != NULL )\r
xTimerStart( xTimer, mainDONT_BLOCK );\r
}\r
\r
- /* The set of tasks created by the following function call have to be \r
- created last as they keep account of the number of tasks they expect to see \r
+ /* The set of tasks created by the following function call have to be\r
+ created last as they keep account of the number of tasks they expect to see\r
running. */\r
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* If all is well, the scheduler will now be running, and the following line\r
will never be reached. If the following line does execute, then there was\r
insufficient FreeRTOS heap memory available for the idle and/or timer tasks\r
to be created. See the memory management section on the FreeRTOS web site\r
for more details. */\r
- for( ;; ); \r
+ for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
\r
LEDs are toggling, then an error has been reported in at least one task. */\r
vParTestToggleLED( ulLED1 );\r
vParTestToggleLED( ulLED2 );\r
- \r
+\r
/* Have any errors been latch in ulErrorFound? If so, ensure the gree LEDs\r
are off, then switch to using the red LEDs. */\r
if( ulErrorFound != pdFALSE )\r
if( lChangeToRedLEDsAlready == pdFALSE )\r
{\r
lChangeToRedLEDsAlready = pdTRUE;\r
- \r
+\r
/* An error has been found. Switch to use the red LEDs. */\r
vParTestSetLED( ulLED1, pdFALSE );\r
vParTestSetLED( ulLED2, pdFALSE );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/*\r
This simple demo project runs on the STM32 Discovery board, which is\r
-populated with an STM32F100RB Cortex-M3 microcontroller. The discovery board \r
+populated with an STM32F100RB Cortex-M3 microcontroller. The discovery board\r
makes an ideal low cost evaluation platform, but the 8K of RAM provided on the\r
-STM32F100RB does not allow the simple application to demonstrate all of all the \r
-FreeRTOS kernel features. Therefore, this simple demo only actively \r
-demonstrates task, queue, timer and interrupt functionality. In addition, the \r
-demo is configured to include malloc failure, idle and stack overflow hook \r
+STM32F100RB does not allow the simple application to demonstrate all of all the\r
+FreeRTOS kernel features. Therefore, this simple demo only actively\r
+demonstrates task, queue, timer and interrupt functionality. In addition, the\r
+demo is configured to include malloc failure, idle and stack overflow hook\r
functions.\r
\r
The idle hook function:\r
The idle hook function queries the amount of FreeRTOS heap space that is\r
-remaining (see vApplicationIdleHook() defined in this file). The demo \r
-application is configured to use 7K of the available 8K of RAM as the FreeRTOS \r
-heap. Memory is only allocated from this heap during initialisation, and this \r
-demo only actually uses 1.6K bytes of the configured 7K available - leaving 5.4K \r
+remaining (see vApplicationIdleHook() defined in this file). The demo\r
+application is configured to use 7K of the available 8K of RAM as the FreeRTOS\r
+heap. Memory is only allocated from this heap during initialisation, and this\r
+demo only actually uses 1.6K bytes of the configured 7K available - leaving 5.4K\r
bytes of heap space unallocated.\r
\r
The main() Function:\r
scheduler.\r
\r
The Queue Send Task:\r
-The queue send task is implemented by the prvQueueSendTask() function in this \r
-file. prvQueueSendTask() sits in a loop that causes it to repeatedly block for \r
-200 milliseconds, before sending the value 100 to the queue that was created \r
+The queue send task is implemented by the prvQueueSendTask() function in this\r
+file. prvQueueSendTask() sits in a loop that causes it to repeatedly block for\r
+200 milliseconds, before sending the value 100 to the queue that was created\r
within main(). Once the value is sent, the task loops back around to block for\r
another 200 milliseconds.\r
\r
The Queue Receive Task:\r
The queue receive task is implemented by the prvQueueReceiveTask() function\r
-in this file. prvQueueReceiveTask() sits in a loop where it repeatedly blocks \r
-on attempts to read data from the queue that was created within main(). When \r
-data is received, the task checks the value of the data, and if the value equals \r
-the expected 100, toggles the green LED. The 'block time' parameter passed to \r
-the queue receive function specifies that the task should be held in the Blocked \r
-state indefinitely to wait for data to be available on the queue. The queue \r
-receive task will only leave the Blocked state when the queue send task writes \r
-to the queue. As the queue send task writes to the queue every 200 \r
-milliseconds, the queue receive task leaves the Blocked state every 200 \r
+in this file. prvQueueReceiveTask() sits in a loop where it repeatedly blocks\r
+on attempts to read data from the queue that was created within main(). When\r
+data is received, the task checks the value of the data, and if the value equals\r
+the expected 100, toggles the green LED. The 'block time' parameter passed to\r
+the queue receive function specifies that the task should be held in the Blocked\r
+state indefinitely to wait for data to be available on the queue. The queue\r
+receive task will only leave the Blocked state when the queue send task writes\r
+to the queue. As the queue send task writes to the queue every 200\r
+milliseconds, the queue receive task leaves the Blocked state every 200\r
milliseconds, and therefore toggles the green LED every 200 milliseconds.\r
\r
The LED Software Timer and the Button Interrupt:\r
The user button B1 is configured to generate an interrupt each time it is\r
-pressed. The interrupt service routine switches the red LED on, and resets the \r
+pressed. The interrupt service routine switches the red LED on, and resets the\r
LED software timer. The LED timer has a 5000 millisecond (5 second) period, and\r
-uses a callback function that is defined to just turn the red LED off. \r
-Therefore, pressing the user button will turn the red LED on, and the LED will \r
+uses a callback function that is defined to just turn the red LED off.\r
+Therefore, pressing the user button will turn the red LED on, and the LED will\r
remain on until a full five seconds pass without the button being pressed.\r
*/\r
\r
static void prvQueueSendTask( void *pvParameters );\r
\r
/*\r
- * The LED timer callback function. This does nothing but switch the red LED \r
+ * The LED timer callback function. This does nothing but switch the red LED\r
* off.\r
*/\r
static void vLEDTimerCallback( xTimerHandle xTimer );\r
static xQueueHandle xQueue = NULL;\r
\r
/* The LED software timer. This uses vLEDTimerCallback() as its callback\r
- * function. \r
+ * function.\r
*/\r
static xTimerHandle xLEDTimer = NULL;\r
\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
- /* Create the software timer that is responsible for turning off the LED \r
- if the button is not pushed within 5000ms, as described at the top of \r
+ /* Create the software timer that is responsible for turning off the LED\r
+ if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- vLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( 5000 / portTICK_RATE_MS ),/* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ vLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Start the tasks and timer running. */\r
if( ulReceivedValue == 100UL )\r
{\r
/* NOTE - accessing the LED port should use a critical section\r
- because it is accessed from multiple tasks, and the button interrupt \r
- - in this trivial case, for simplicity, the critical section is \r
+ because it is accessed from multiple tasks, and the button interrupt\r
+ - in this trivial case, for simplicity, the critical section is\r
omitted. */\r
STM32vldiscovery_LEDToggle( LED3 );\r
}\r
STM32vldiscovery_LEDInit( LED3 );\r
STM32vldiscovery_LEDInit( LED4 );\r
STM32vldiscovery_PBInit( BUTTON_USER, BUTTON_MODE_EXTI );\r
- \r
+\r
/* Start with the LEDs off. */\r
STM32vldiscovery_LEDOff( LED3 );\r
STM32vldiscovery_LEDOff( LED4 );\r
{\r
/* Called if a call to pvPortMalloc() fails because there is insufficient\r
free memory available in the FreeRTOS heap. pvPortMalloc() is called\r
- internally by FreeRTOS API functions that create tasks, queues, software \r
+ internally by FreeRTOS API functions that create tasks, queues, software\r
timers, and semaphores. The size of the FreeRTOS heap is set by the\r
configTOTAL_HEAP_SIZE configuration constant in FreeRTOSConfig.h. */\r
for( ;; );\r
volatile size_t xFreeStackSpace;\r
\r
/* This function is called on each cycle of the idle task. In this case it\r
- does nothing useful, other than report the amout of FreeRTOS heap that \r
+ does nothing useful, other than report the amout of FreeRTOS heap that\r
remains unallocated. */\r
xFreeStackSpace = xPortGetFreeHeapSize();\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* defined and/or created within this file:\r
*\r
* "Check" task - This only executes every five seconds but has the highest\r
- * priority so is guaranteed to get processor time. Its main function is to \r
+ * priority so is guaranteed to get processor time. Its main function is to\r
* check that all the standard demo tasks are still operational. The check task\r
* will toggle LED 3 (PB11) every five seconds so long as no errors have been\r
- * detected. The toggle rate will increase to half a second if an error has \r
+ * detected. The toggle rate will increase to half a second if an error has\r
* been found in any task.\r
*\r
- * "Echo" task - This is a very basic task that simply echoes any characters \r
+ * "Echo" task - This is a very basic task that simply echoes any characters\r
* received on COM0 (USART1). This can be tested by transmitting a text file\r
* from a dumb terminal to the STM32 USART then observing or capturing the text\r
- * that is echoed back. Missing characters will be all the more obvious if the \r
+ * that is echoed back. Missing characters will be all the more obvious if the\r
* file contains a simple repeating string of fixed width.\r
*\r
- * Currently this demo does not include interrupt nesting examples. High \r
+ * Currently this demo does not include interrupt nesting examples. High\r
* frequency timer and simpler nesting examples can be found in most Cortex-M3\r
* demo applications.\r
*\r
- * The functions used to initialise, set and clear LED outputs are normally \r
- * defined in partest.c. This demo includes two partest files, one that is \r
- * configured for use with the Keil MCBSTM32 evaluation board (called \r
+ * The functions used to initialise, set and clear LED outputs are normally\r
+ * defined in partest.c. This demo includes two partest files, one that is\r
+ * configured for use with the Keil MCBSTM32 evaluation board (called\r
* ParTest_MCBSTM32.c) and one that is configured for use with the official\r
* ST Eval board (called ParTest_ST_Eval.c). One one of these files should be\r
- * included in the build at any one time, as appropriate for the hardware \r
+ * included in the build at any one time, as appropriate for the hardware\r
* actually being used.\r
*/\r
\r
/* The 'check' task as described at the top of this file. */\r
static void prvCheckTask( void *pvParameters );\r
\r
-/* A simple task that echoes all the characters that are received on COM0 \r
+/* A simple task that echoes all the characters that are received on COM0\r
(USART1). */\r
static void prvUSARTEchoTask( void *pvParameters );\r
\r
vStartRecursiveMutexTasks();\r
\r
/* Create the 'echo' task, which is also defined within this file. */\r
- xTaskCreate( prvUSARTEchoTask, ( signed char * ) "Echo", configMINIMAL_STACK_SIZE, NULL, mainECHO_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvUSARTEchoTask, "Echo", configMINIMAL_STACK_SIZE, NULL, mainECHO_TASK_PRIORITY, NULL );\r
\r
/* Create the 'check' task, which is also defined within this file. */\r
- xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
\r
/* String declared static to ensure it does not end up on the stack, no matter\r
what the optimisation level. */\r
-static const char *pcLongishString = \r
+static const char *pcLongishString =\r
"ABBA was a Swedish pop music group formed in Stockholm in 1972, consisting of Anni-Frid Frida Lyngstad, "\r
"Björn Ulvaeus, Benny Andersson and Agnetha Fältskog. Throughout the band's existence, Fältskog and Ulvaeus "\r
"were a married couple, as were Lyngstad and Andersson - although both couples later divorced. They became one "\r
static void prvSetupHardware( void )\r
{\r
/* RCC system reset(for debug purpose). */\r
- RCC_DeInit (); \r
+ RCC_DeInit ();\r
\r
/* Enable HSE. */\r
- RCC_HSEConfig( RCC_HSE_ON ); \r
- \r
+ RCC_HSEConfig( RCC_HSE_ON );\r
+\r
/* Wait till HSE is ready. */\r
while (RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET);\r
- \r
+\r
/* HCLK = SYSCLK. */\r
- RCC_HCLKConfig( RCC_SYSCLK_Div1 ); \r
+ RCC_HCLKConfig( RCC_SYSCLK_Div1 );\r
\r
/* PCLK2 = HCLK. */\r
- RCC_PCLK2Config( RCC_HCLK_Div1 ); \r
+ RCC_PCLK2Config( RCC_HCLK_Div1 );\r
\r
/* PCLK1 = HCLK/2. */\r
- RCC_PCLK1Config( RCC_HCLK_Div2 ); \r
+ RCC_PCLK1Config( RCC_HCLK_Div2 );\r
\r
/* ADCCLK = PCLK2/4. */\r
- RCC_ADCCLKConfig( RCC_PCLK2_Div4 ); \r
- \r
+ RCC_ADCCLKConfig( RCC_PCLK2_Div4 );\r
+\r
/* Flash 2 wait state. */\r
- *( volatile unsigned long * )0x40022000 = 0x01; \r
- \r
+ *( volatile unsigned long * )0x40022000 = 0x01;\r
+\r
/* PLLCLK = 8MHz * 9 = 72 MHz */\r
RCC_PLLConfig( RCC_PLLSource_HSE_Div1, RCC_PLLMul_9 );\r
- \r
+\r
/* Enable PLL. */\r
RCC_PLLCmd( ENABLE );\r
- \r
+\r
/* Wait till PLL is ready. */\r
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);\r
- \r
+\r
/* Select PLL as system clock source. */\r
RCC_SYSCLKConfig (RCC_SYSCLKSource_PLLCLK);\r
- \r
+\r
/* Wait till PLL is used as system clock source. */\r
while (RCC_GetSYSCLKSource() != 0x08);\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Create the queue used by the LCD task. Messages for display on the LCD\r
are received via this queue. */\r
xLCDQueue = xQueueCreate( mainLCD_QUEUE_SIZE, sizeof( xLCDMessage ) );\r
- \r
+\r
/* Start the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vCreateBlockTimeTasks();\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); \r
- xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vCheckTask, "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
or not the correct/expected number of tasks are running at any given time. */\r
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
- \r
+\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
- \r
+\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* Will only get here if there was not enough heap space to create the\r
idle task. */\r
return 0;\r
\r
xLastExecutionTime = xTaskGetTickCount();\r
xMessage.pcMessage = cPassMessage;\r
- \r
+\r
for( ;; )\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
else if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR IN COM TEST\n";\r
- } \r
+ }\r
else\r
{\r
sprintf( ( portCHAR * ) cPassMessage, "PASS [%uns]\n", ( ( unsigned portLONG ) usMaxJitter ) * mainNS_PER_CLOCK );\r
NVIC_SetVectorTable( NVIC_VectTab_FLASH, 0x0 );\r
\r
NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );\r
- \r
+\r
/* Configure HCLK clock as SysTick clock source. */\r
SysTick_CLKSourceConfig( SysTick_CLKSource_HCLK );\r
- \r
+\r
vParTestInitialise();\r
}\r
/*-----------------------------------------------------------*/\r
{\r
/* Display one character on LCD */\r
LCD_DisplayChar( ucLine, usRefColumn, (u8) ch );\r
- \r
+\r
/* Decrement the column position by 16 */\r
usRefColumn -= mainCOLUMN_INCREMENT;\r
- \r
+\r
/* Increment the character counter */\r
usColumn++;\r
if( usColumn == mainMAX_COLUMN )\r
/* Move back to the first column of the next line. */\r
ucLine += mainROW_INCREMENT;\r
usRefColumn = mainCOLUMN_START;\r
- usColumn = 0; \r
+ usColumn = 0;\r
}\r
\r
/* Wrap back to the top of the display. */\r
{\r
ucLine = 0;\r
}\r
- \r
+\r
return ch;\r
}\r
/*-----------------------------------------------------------*/\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Create the queue used by the LCD task. Messages for display on the LCD\r
are received via this queue. */\r
xLCDQueue = xQueueCreate( mainLCD_QUEUE_SIZE, sizeof( xLCDMessage ) );\r
- \r
+\r
/* Start the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vCreateBlockTimeTasks();\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); \r
- xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vCheckTask, "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
or not the correct/expected number of tasks are running at any given time. */\r
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
- \r
+\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
- \r
+\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* Will only get here if there was not enough heap space to create the\r
idle task. */\r
return 0;\r
\r
xLastExecutionTime = xTaskGetTickCount();\r
xMessage.pcMessage = cPassMessage;\r
- \r
+\r
for( ;; )\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
else if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR IN COM TEST\n";\r
- } \r
+ }\r
else\r
{\r
sprintf( ( portCHAR * ) cPassMessage, "PASS [%uns]\n", ( ( unsigned portLONG ) usMaxJitter ) * mainNS_PER_CLOCK );\r
NVIC_SetVectorTable( NVIC_VectTab_FLASH, 0x0 );\r
\r
NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );\r
- \r
+\r
/* Configure HCLK clock as SysTick clock source. */\r
SysTick_CLKSourceConfig( SysTick_CLKSource_HCLK );\r
- \r
+\r
vParTestInitialise();\r
}\r
/*-----------------------------------------------------------*/\r
{\r
/* Display one character on LCD */\r
LCD_DisplayChar( ucLine, usRefColumn, (u8) ch );\r
- \r
+\r
/* Decrement the column position by 16 */\r
usRefColumn -= mainCOLUMN_INCREMENT;\r
- \r
+\r
/* Increment the character counter */\r
usColumn++;\r
if( usColumn == mainMAX_COLUMN )\r
/* Move back to the first column of the next line. */\r
ucLine += mainROW_INCREMENT;\r
usRefColumn = mainCOLUMN_START;\r
- usColumn = 0; \r
+ usColumn = 0;\r
}\r
\r
/* Wrap back to the top of the display. */\r
{\r
ucLine = 0;\r
}\r
- \r
+\r
return ch;\r
}\r
/*-----------------------------------------------------------*/\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* along with the max jitter time to the LCD (again via the LCD task), as\r
* described above.\r
*\r
- * Tick Hook - A tick hook is provided just for demonstration purposes. In \r
+ * Tick Hook - A tick hook is provided just for demonstration purposes. In\r
* this case it is used to periodically send an instruction to updated the\r
* MEMS input to the LCD task.\r
*\r
*/\r
\r
-/* CircleOS includes. Some of the CircleOS peripheral functionality is \r
+/* CircleOS includes. Some of the CircleOS peripheral functionality is\r
utilised, although CircleOS itself is not used. */\r
#include "circle.h"\r
\r
\r
/*\r
* A cut down version of sprintf() used to percent the HUGE GCC library\r
- * equivalent from being included in the binary image. \r
+ * equivalent from being included in the binary image.\r
*/\r
extern int sprintf(char *out, const char *format, ...);\r
\r
/* Create the queue used by the LCD task. Messages for display on the LCD\r
are received via this queue. */\r
xLCDQueue = xQueueCreate( mainLCD_QUEUE_SIZE, sizeof( xLCDMessage ) );\r
- \r
+\r
/* Start the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vCreateBlockTimeTasks();\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
- xTaskCreate( prvCheckTask, ( signed portCHAR * ) "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); \r
- xTaskCreate( prvLCDTask, ( signed portCHAR * ) "LCD", configLCD_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvFlashTask, ( signed portCHAR * ) "Flash", configMINIMAL_STACK_SIZE, NULL, mainFLASH_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvLCDTask, "LCD", configLCD_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvFlashTask, "Flash", configMINIMAL_STACK_SIZE, NULL, mainFLASH_TASK_PRIORITY, NULL );\r
\r
/* Configure the timers used by the fast interrupt timer test. */\r
vSetupTimerTest();\r
- \r
+\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
- \r
+\r
/* Will only get here if there was not enough heap space to create the\r
idle task. */\r
return 0;\r
\r
cY -= mainLCD_CHAR_HEIGHT;\r
if( cY <= ( mainLCD_CHAR_HEIGHT - 1 ) )\r
- { \r
+ {\r
/* Wrap the line onto which we are going to write the text. */\r
cY = mainLCD_MAX_Y;\r
}\r
- \r
+\r
/* Display the message. */\r
DRAW_DisplayString( 0, cY, xMessage.pcMessage, strlen( xMessage.pcMessage ) );\r
}\r
/* Setup the message we are going to send to the LCD task. */\r
xMessage.xMessageType = mainWRITE_STRING_MESSAGE;\r
xMessage.pcMessage = cPassMessage;\r
- \r
+\r
for( ;; )\r
{\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
NVIC_SetVectorTable( NVIC_VectTab_FLASH, 0x0 );\r
\r
NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );\r
- \r
+\r
/* Configure HCLK clock as SysTick clock source. */\r
SysTick_CLKSourceConfig( SysTick_CLKSource_HCLK );\r
- \r
+\r
/* Misc initialisation, including some of the CircleOS features. Note\r
that CircleOS itself is not used. */\r
vParTestInitialise();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vStartRecursiveMutexTasks();\r
\r
/* Create the uIP task. The WEB server runs in this task. */\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
\r
/* Create the queue used by the LCD task. Messages for display on the LCD\r
are received via this queue. */\r
\r
/* Start the LCD gatekeeper task - as described in the comments at the top\r
of this file. */\r
- xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE * 2, NULL, mainLCD_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvLCDTask, "LCD", configMINIMAL_STACK_SIZE * 2, NULL, mainLCD_TASK_PRIORITY, NULL );\r
\r
/* Configure the high frequency interrupt used to measure the interrupt\r
jitter time. When debugging it can be helpful to comment this line out\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
static unsigned short\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", (int)lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
static unsigned short\r
generate_runtime_stats(void *arg)\r
{\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", (int)lRefreshCount );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
if( xCheckTimer != NULL )\r
configASSERT( xQueue );\r
\r
/* Start the two tasks as described at the top of this file. */\r
- xTaskCreate( prvQueueReceiveTask, ( const signed char * const ) "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( const signed char * const ) "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler running running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Configure the peripherals used by this demo application. This includes\r
configuring the joystick input select button to generate interrupts. */\r
prvSetupHardware();\r
- \r
+\r
/* Create the queue used by tasks and interrupts to send strings to the LCD\r
task. */\r
xLCDQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( xQueueMessage ) );\r
- \r
+\r
/* If the queue could not be created then don't create any tasks that might\r
attempt to use the queue. */\r
if( xLCDQueue != NULL )\r
/* Add the created queue to the queue registry so it can be viewed in\r
the IAR FreeRTOS state viewer plug-in. */\r
vQueueAddToRegistry( xLCDQueue, "LCDQueue" );\r
- \r
+\r
/* Create the LCD and button poll tasks, as described at the top of this\r
file. */\r
- xTaskCreate( prvLCDTask, ( signed char * ) "LCD", mainLCD_TASK_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvButtonPollTask, ( signed char * ) "ButPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- \r
+ xTaskCreate( prvLCDTask, "LCD", mainLCD_TASK_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvButtonPollTask, "ButPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+\r
/* Create a subset of the standard demo tasks. */\r
vStartDynamicPriorityTasks();\r
vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
vStartGenericQueueTasks( mainGENERIC_QUEUE_TEST_PRIORITY );\r
- \r
+\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
}\r
- \r
+\r
/* If all is well then this line will never be reached. If it is reached\r
then it is likely that there was insufficient (FreeRTOS) heap memory space\r
to create the idle task. This may have been trapped by the malloc() failed\r
/* This function is the only function that uses printf(). If printf() is\r
used from any other function then some sort of mutual exclusion on stdout\r
will be necessary.\r
- \r
+\r
This is also the only function that is permitted to access the LCD.\r
- \r
+\r
First print out the number of bytes that remain in the FreeRTOS heap. This\r
can be viewed in the terminal IO window within the IAR Embedded Workbench. */\r
printf( "%d bytes of heap space remain unallocated\n", xPortGetFreeHeapSize() );\r
LCD_Clear( Blue );\r
lLine = 0;\r
}\r
- \r
+\r
/* What is this message? What does it contain? */\r
switch( xReceivedMessage.cMessageID )\r
{\r
the terminal IO window in the IAR\r
embedded workbench. */\r
printf( "\nTask\t Abs Time\t %%Time\n*****************************************" );\r
- vTaskGetRunTimeStats( ( signed char * ) cBuffer );\r
+ vTaskGetRunTimeStats( cBuffer );\r
printf( cBuffer );\r
- \r
+\r
/* Also print out a message to\r
the LCD - in this case the\r
pointer to the string to print\r
technique. */\r
sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.lMessageValue );\r
break;\r
- \r
+\r
case mainMESSAGE_STATUS : /* The tick interrupt hook\r
function has just informed this\r
task of the system status.\r
with the status value. */\r
prvGenerateStatusMessage( cBuffer, xReceivedMessage.lMessageValue );\r
break;\r
- \r
+\r
default : sprintf( cBuffer, "Unknown message" );\r
break;\r
}\r
- \r
+\r
/* Output the message that was placed into the cBuffer array within the\r
switch statement above. */\r
LCD_DisplayStringLine( lLine, ( uint8_t * ) cBuffer );\r
- \r
+\r
/* Move onto the next LCD line, ready for the next iteration of this\r
loop. */\r
lLine += lFontHeight;\r
break;\r
case mainERROR_DYNAMIC_TASKS : sprintf( pcBuffer, "Error: Dynamic tasks" );\r
break;\r
- case mainERROR_COM_TEST : sprintf( pcBuffer, "Err: loop connected?" ); /* Error in COM test - is the Loopback connector connected? */ \r
+ case mainERROR_COM_TEST : sprintf( pcBuffer, "Err: loop connected?" ); /* Error in COM test - is the Loopback connector connected? */\r
break;\r
case mainERROR_GEN_QUEUE_TEST : sprintf( pcBuffer, "Error: Gen Q test" );\r
break;\r
/* This is the interrupt handler for the joystick select button input.\r
The button has been pushed, write a message to the LCD via the LCD task. */\r
xQueueSendFromISR( xLCDQueue, &xMessage, &lHigherPriorityTaskWoken );\r
- \r
+\r
EXTI_ClearITPendingBit( SEL_BUTTON_EXTI_LINE );\r
- \r
+\r
/* If writing to xLCDQueue caused a task to unblock, and the unblocked task\r
has a priority equal to or above the task that this interrupt interrupted,\r
then lHigherPriorityTaskWoken will have been set to pdTRUE internally within\r
{\r
xStatusMessage.lMessageValue = mainERROR_DYNAMIC_TASKS;\r
}\r
- \r
+\r
if( xAreComTestTasksStillRunning() != pdPASS )\r
{\r
xStatusMessage.lMessageValue = mainERROR_COM_TEST;\r
}\r
- \r
+\r
if( xAreGenericQueueTasksStillRunning() != pdPASS )\r
{\r
xStatusMessage.lMessageValue = mainERROR_GEN_QUEUE_TEST;\r
}\r
- \r
+\r
/* As this is the tick hook the lHigherPriorityTaskWoken parameter is not\r
needed (a context switch is going to be performed anyway), but it must\r
still be provided. */\r
lLastState = lState;\r
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );\r
}\r
- \r
+\r
/* Block for 10 milliseconds so this task does not utilise all the CPU\r
time and debouncing of the button is not necessary. */\r
vTaskDelay( 10 / portTICK_RATE_MS );\r
/* Ensure that all 4 interrupt priority bits are used as the pre-emption\r
priority. */\r
NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );\r
- \r
+\r
/* Initialise the LEDs. */\r
vParTestInitialise();\r
\r
STM_EVAL_PBInit( BUTTON_DOWN, BUTTON_MODE_GPIO );\r
STM_EVAL_PBInit( BUTTON_LEFT, BUTTON_MODE_GPIO );\r
STM_EVAL_PBInit( BUTTON_RIGHT, BUTTON_MODE_GPIO );\r
- \r
+\r
/* The select button in the middle of the joystick is configured to generate\r
an interrupt. The Eval board library will configure the interrupt\r
priority to be the lowest priority available so the priority need not be\r
STM_EVAL_PBInit( BUTTON_SEL, BUTTON_MODE_EXTI );\r
\r
/* Initialize the LCD */\r
- STM32L152_LCD_Init(); \r
+ STM32L152_LCD_Init();\r
LCD_Clear( Blue );\r
LCD_SetBackColor( Blue );\r
LCD_SetTextColor( White );\r
significant two bytes are given by the current TIM6 counter value. Care\r
must be taken with data consistency when combining the two in case a timer\r
overflow occurs as the value is being read.\r
- \r
+\r
The portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro (in FreeRTOSConfig.h) is\r
defined to call this function, so the kernel will call this function\r
automatically at the appropriate time. */\r
TIM_TimeBaseStructure.TIM_Prescaler = 5000;\r
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;\r
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;\r
- \r
+\r
TIM_TimeBaseInit( TIM6, &TIM_TimeBaseStructure );\r
- \r
+\r
/* Only interrupt on overflow events. */\r
TIM6->CR1 |= TIM_CR1_URS;\r
- \r
+\r
/* Enable the interrupt. */\r
TIM_ITConfig( TIM6, TIM_IT_Update, ENABLE );\r
- \r
+\r
/* Enable the TIM6 global Interrupt */\r
NVIC_InitStructure.NVIC_IRQChannel = TIM6_IRQn;\r
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configLIBRARY_LOWEST_INTERRUPT_PRIORITY;\r
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00; /* Not used as 4 bits are used for the pre-emption priority. */\r
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;\r
NVIC_Init(&NVIC_InitStructure);\r
- \r
+\r
TIM_ClearITPendingBit( TIM6, TIM_IT_Update );\r
TIM_Cmd( TIM6, ENABLE );\r
}\r
void TIM6_IRQHandler( void )\r
{\r
/* Interrupt handler for TIM 6\r
- \r
+\r
The time base for the run time stats is generated by the 16 bit timer 6.\r
Each time the timer overflows ulTIM6_OverflowCount is incremented.\r
Therefore, when converting the total run time to a 32 bit number, the most\r
{\r
( void ) pcTaskName;\r
( void ) pxTask;\r
- \r
+\r
/* Run time stack overflow checking is performed if\r
configconfigCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook\r
function is called if a stack overflow is detected. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
\r
static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
{\r
-const int8_t *const pcHeader = ( int8_t * ) "Task State Priority Stack #\r\n************************************************\r\n";\r
+const char *const pcHeader = ( int8_t * ) "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
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
- vTaskList( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+ strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
+ vTaskList( pcWriteBuffer + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
\r
static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
{\r
-const int8_t * const pcHeader = ( int8_t * ) "Task Abs Time % Time\r\n****************************************\r\n";\r
+const char * const pcHeader = ( int8_t * ) "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
configASSERT( pcWriteBuffer );\r
\r
/* Generate a table of task stats. */\r
- strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
- vTaskGetRunTimeStats( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+ strcpy( ( char * ) pcWriteBuffer, pcHeader );\r
+ vTaskGetRunTimeStats( ( char * ) pcWriteBuffer + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
prvConfigureUART();\r
\r
/* Create that task that handles the console itself. */\r
- xTaskCreate( prvUARTCommandConsoleTask, /* The task that implements the command console. */\r
- ( const int8_t * const ) "CLI", /* Text name assigned to the task. This is just to assist debugging. The kernel does not use this name itself. */\r
- usStackSize, /* The size of the stack allocated to the task. */\r
- NULL, /* The parameter is not used, so NULL is passed. */\r
- uxPriority, /* The priority allocated to the task. */\r
- NULL ); /* A handle is not required, so just pass NULL. */\r
+ xTaskCreate( prvUARTCommandConsoleTask, /* The task that implements the command console. */\r
+ "CLI", /* Text name assigned to the task. This is just to assist debugging. The kernel does not use this name itself. */\r
+ usStackSize, /* The size of the stack allocated to the task. */\r
+ NULL, /* The parameter is not used, so NULL is passed. */\r
+ uxPriority, /* The priority allocated to the task. */\r
+ NULL ); /* A handle is not required, so just pass NULL. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
if( xCheckTimer != NULL )\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
void vStart7SegTasks( unsigned portBASE_TYPE uxPriority )\r
{\r
- xTaskCreate( prvRefreshTask, ( signed char * ) "7SegRefresh", x7segSTACK_SIZE, NULL, uxPriority, ( xTaskHandle *) NULL );\r
- xTaskCreate( prvCountTask, ( signed char * ) "7SegCount", x7segSTACK_SIZE, NULL, uxPriority, ( xTaskHandle *) NULL );\r
+ xTaskCreate( prvRefreshTask, "7SegRefresh", x7segSTACK_SIZE, NULL, uxPriority, ( xTaskHandle *) NULL );\r
+ xTaskCreate( prvCountTask, "7SegCount", x7segSTACK_SIZE, NULL, uxPriority, ( xTaskHandle *) NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
void vStartRegTestTasks( void )\r
{\r
- xTaskCreate( vRegTest1, ( signed char * ) "RTest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2, ( signed char * ) "RTest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1, "RTest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2, "RTest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vStartRegTestTasks();\r
\r
/* Start the check task - which is defined in this file. */\r
- xTaskCreate( vErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Now all the tasks have been started - start the scheduler. */\r
vTaskStartScheduler();\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern unsigned long ulCheckErrors;\r
static char cCountBuf[ 32 ];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
- \r
+\r
/* Have any errors been latched? */\r
if( ulCheckErrors != 0 )\r
{\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* pages display some TCP/IP status information and permit LED3 to be turned on\r
* and off using a check box.\r
*\r
- * Tick hook function that implements a "Check" function - This is executed \r
- * every 5 seconds from the tick hook function. It checks to ensure that all \r
- * the standard demo tasks are still operational and running without error. \r
- * The system status (pass/fail) is then displayed underneith the task table on \r
- * the served WEB pages. \r
+ * Tick hook function that implements a "Check" function - This is executed\r
+ * every 5 seconds from the tick hook function. It checks to ensure that all\r
+ * the standard demo tasks are still operational and running without error.\r
+ * The system status (pass/fail) is then displayed underneith the task table on\r
+ * the served WEB pages.\r
*\r
* "Reg test" tasks - These fill the registers with known values, then check\r
* that each register still contains its expected value. Each task uses\r
\r
/* Setup the hardware ready for this demo. */\r
prvSetupHardware();\r
- \r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
\r
/* Start the standard demo tasks. */\r
vStartLEDFlashTasks( tskIDLE_PRIORITY );\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
\r
/* Start the reg test tasks - defined in this file. */\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
{\r
static unsigned long ulExecutionCount = 0, ulLastRegTest1Count = 0, ulLastRegTest2Count = 0;\r
const unsigned long ulExecutionRate = 5000 / portTICK_RATE_MS;\r
- \r
+\r
/* Increment the count of how many times the tick hook has been called. */\r
ulExecutionCount++;\r
- \r
+\r
/* Is it time to perform the check again? */\r
if( ulExecutionCount >= ulExecutionRate )\r
{\r
/* Reset the execution count so this function is called again in 5\r
seconds time. */\r
ulExecutionCount = 0;\r
- \r
+\r
/* Has an error been found in any task? */\r
if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
{\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvSetupHardware( void ) \r
+static void prvSetupHardware( void )\r
{\r
/* Disable the watchdog, STOP and WAIT modes. */\r
SOPT1 = 0;\r
\r
/* --- Setup clock to use external 25MHz source. --- */\r
- \r
+\r
/* Extal and xtal pin ON. */\r
PTDPF1_D4 = 0x03;\r
PTDPF1_D5 = 0x03;\r
MCGC2 = MCGC2_ERCLKEN_MASK /* Activate external reference clock */\r
| MCGC2_EREFS_MASK /* Because crystal is being used */\r
| MCGC2_RANGE_MASK; /* High range */\r
- \r
+\r
/* Select clock mode and clear IREFs. */\r
MCGC1 = (0x02 << 6 ) /* CLKS = 10 -> external reference clock. */\r
| (0x04 << 3 ) /* RDIV = 2^4 -> 25MHz/16 = 1.5625 MHz */\r
| MCGC1_IRCLKEN_MASK; /* IRCLK to RTC enabled */\r
- \r
+\r
/* Wait for Reference and Clock status bits to update. */\r
while( MCGSC_IREFST | ( MCGSC_CLKST != 0x02 ) )\r
{\r
}\r
\r
\r
- /* Now in PBE Mode, finally switch from PBE to PEE (PLL enabled external \r
+ /* Now in PBE Mode, finally switch from PBE to PEE (PLL enabled external\r
mode). */\r
MCGC1_CLKS = 0b00; /* PLL clock to system (MCGOUT) */\r
\r
{\r
/* Just to remove compiler warnings. */\r
( void ) pvParameters;\r
- \r
+\r
/* Set all the registers to known values, then check that each retains its\r
expected value - as described at the top of this file. If an error is\r
found then the loop counter will no longer be incremented allowing the check\r
" moveq #3, d2 \n\t"\r
" moveq #4, d3 \n\t"\r
" moveq #5, d4 \n\t"\r
- " moveq #6, d5 \n\t" \r
+ " moveq #6, d5 \n\t"\r
" moveq #7, d6 \n\t"\r
" moveq #8, d7 \n\t"\r
" move #9, a0 \n\t"\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES );\r
\r
/* Create the check task. */\r
- xTaskCreate( prvCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
\r
/* Start the reg test tasks - defined in this file. */\r
- xTaskCreate( vRegTest1Task, ( signed portCHAR * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed portCHAR * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
{\r
ulError |= 0x20UL;\r
}\r
- \r
+\r
if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
ulError |= 0x40UL;\r
\r
/* Toggle the LED each itteration. */\r
vParTestToggleLED( mainCHECK_LED );\r
- \r
+\r
/* For demo only - how much unused stack does this task have? */\r
uxUnusedStack = uxTaskGetStackHighWaterMark( NULL );\r
}\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/* Counters used to detect errors within the reg test tasks. */\r
static volatile unsigned portLONG ulRegTest1Counter = 0x11111111, ulRegTest2Counter = 0x22222222;\r
\r
-/* Any errors that the check task finds in any tasks are latched into \r
+/* Any errors that the check task finds in any tasks are latched into\r
ulErrorCode, and then displayed via the WEB server. */\r
static unsigned portLONG ulErrorCode = 0UL;\r
\r
prvSetupHardware();\r
\r
/* Create the WEB server task. */\r
- xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
\r
/* Start the standard demo tasks. */\r
vStartLEDFlashTasks( tskIDLE_PRIORITY );\r
vStartRecursiveMutexTasks();\r
\r
/* Start the reg test tasks - defined in this file. */\r
- xTaskCreate( vRegTest1Task, ( signed portCHAR * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed portCHAR * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the check task. */\r
- xTaskCreate( prvCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
}\r
/*---------------------------------------------------------------------------*/\r
\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern unsigned long ulGetErrorCode( void );\r
\r
static char cCountBuf[ 32 ];\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d, Error code = %d (0 = no errors)", (int)lRefreshCount, (int)ulGetErrorCode() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
{\r
char *c = pcInputString;\r
\r
- /* Process the form input sent by the IO page of the served HTML. \r
+ /* Process the form input sent by the IO page of the served HTML.\r
This just contains an instruction to either turn on or off the LED. */\r
while( ( *c != '?' ) && ( *c != 0x00 ) )\r
{\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
ulPageHits++;\r
sprintf( cPageHits, "%d", (int)ulPageHits );\r
\r
- /* Write out the HTTP OK header. */ \r
+ /* Write out the HTTP OK header. */\r
netconn_write( pxNetCon, webHTTP_OK, ( u16_t ) strlen( webHTTP_OK ), NETCONN_COPY );\r
\r
/* Generate the dynamic page...\r
- \r
+\r
... First the page header. */\r
strcpy( cDynamicPage, webHTML_START );\r
/* ... Then the hit count... */\r
strcat( cDynamicPage, cPageHits );\r
- \r
+\r
strcat( cDynamicPage,\r
"<p><pre>Task State Priority Stack #<br>************************************************<br>" );\r
/* ... Then the list of tasks and their status... */\r
- vTaskList( ( signed portCHAR * )cDynamicPage + strlen( cDynamicPage ) ); \r
- \r
+ vTaskList( cDynamicPage + strlen( cDynamicPage ) );\r
+\r
/* ... Finally the page footer. */\r
strcat( cDynamicPage, webHTML_END );\r
\r
\r
/* Loop forever */\r
for( ;; )\r
- { \r
+ {\r
/* Wait for connection. */\r
pxNewConnection = netconn_accept( pxHTTPListener );\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
\r
/* Start the reg test tasks - defined in this file. */\r
- xTaskCreate( vRegTest1Task, ( signed portCHAR * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed portCHAR * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the check task. */\r
- xTaskCreate( prvCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vStartInterruptQueueTasks();\r
\r
/* Start the reg test tasks - defined in this file. */\r
- xTaskCreate( vRegTest1Task, ( signed portCHAR * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed portCHAR * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest1Counter, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, ( void * ) &ulRegTest2Counter, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the check task. */\r
- xTaskCreate( prvCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
\r
/* Note the producer has a lower priority than the consumer when the tasks are\r
spawned. */\r
- xTaskCreate( vBlockingQueueConsumer, ( signed portCHAR * ) "QConsB1", blckqSTACK_SIZE, ( void * ) pxQueueParameters1, uxPriority, NULL );\r
- xTaskCreate( vBlockingQueueProducer, ( signed portCHAR * ) "QProdB2", blckqSTACK_SIZE, ( void * ) pxQueueParameters2, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vBlockingQueueConsumer, "QConsB1", blckqSTACK_SIZE, ( void * ) pxQueueParameters1, uxPriority, NULL );\r
+ xTaskCreate( vBlockingQueueProducer, "QProdB2", blckqSTACK_SIZE, ( void * ) pxQueueParameters2, tskIDLE_PRIORITY, NULL );\r
\r
\r
\r
pxQueueParameters4->xBlockTime = xBlockTime;\r
pxQueueParameters4->psCheckVariable = &( sBlockingConsumerCount[ 1 ] );\r
\r
- xTaskCreate( vBlockingQueueConsumer, ( signed portCHAR * ) "QProdB3", blckqSTACK_SIZE, ( void * ) pxQueueParameters3, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vBlockingQueueProducer, ( signed portCHAR * ) "QConsB4", blckqSTACK_SIZE, ( void * ) pxQueueParameters4, uxPriority, NULL );\r
+ xTaskCreate( vBlockingQueueConsumer, "QProdB3", blckqSTACK_SIZE, ( void * ) pxQueueParameters3, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vBlockingQueueProducer, "QConsB4", blckqSTACK_SIZE, ( void * ) pxQueueParameters4, uxPriority, NULL );\r
\r
\r
\r
pxQueueParameters6->xBlockTime = xBlockTime;\r
pxQueueParameters6->psCheckVariable = &( sBlockingConsumerCount[ 2 ] ); \r
\r
- xTaskCreate( vBlockingQueueProducer, ( signed portCHAR * ) "QProdB5", blckqSTACK_SIZE, ( void * ) pxQueueParameters5, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vBlockingQueueConsumer, ( signed portCHAR * ) "QConsB6", blckqSTACK_SIZE, ( void * ) pxQueueParameters6, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vBlockingQueueProducer, "QProdB5", blckqSTACK_SIZE, ( void * ) pxQueueParameters5, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vBlockingQueueConsumer, "QConsB6", blckqSTACK_SIZE, ( void * ) pxQueueParameters6, tskIDLE_PRIORITY, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( xTestQueue, ( signed portCHAR * ) "AltBlockQueue" );\r
+ vQueueAddToRegistry( xTestQueue, "AltBlockQueue" );\r
\r
\r
/* Create the two test tasks. */\r
- xTaskCreate( vPrimaryBlockTimeTestTask, ( signed portCHAR * )"FBTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
- xTaskCreate( vSecondaryBlockTimeTestTask, ( signed portCHAR * )"FBTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
+ xTaskCreate( vPrimaryBlockTimeTestTask, "FBTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
+ xTaskCreate( vSecondaryBlockTimeTestTask, "FBTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
}\r
/*-----------------------------------------------------------*/\r
\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( xPolledQueue, ( signed portCHAR * ) "AltPollQueue" );\r
+ vQueueAddToRegistry( xPolledQueue, "AltPollQueue" );\r
\r
\r
/* Spawn the producer and consumer. */\r
- xTaskCreate( vPolledQueueConsumer, ( signed portCHAR * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );\r
- xTaskCreate( vPolledQueueProducer, ( signed portCHAR * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( xQueue, ( signed portCHAR * ) "Alt_Gen_Test_Queue" );\r
+ vQueueAddToRegistry( xQueue, "Alt_Gen_Test_Queue" );\r
\r
/* Create the demo task and pass it the queue just created. We are\r
passing the queue handle by value so it does not matter that it is\r
declared on the stack here. */\r
- xTaskCreate( prvSendFrontAndBackTest, ( signed portCHAR * ) "FGenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );\r
+ xTaskCreate( prvSendFrontAndBackTest, "FGenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );\r
\r
/* Create the mutex used by the prvMutexTest task. */\r
xMutex = xSemaphoreCreateMutex();\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( ( xQueueHandle ) xMutex, ( signed portCHAR * ) "Alt_Q_Mutex" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Alt_Q_Mutex" );\r
\r
/* Create the mutex demo tasks and pass it the mutex just created. We are\r
passing the mutex handle by value so it does not matter that it is declared\r
on the stack here. */\r
- xTaskCreate( prvLowPriorityMutexTask, ( signed portCHAR * ) "FMuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );\r
- xTaskCreate( prvMediumPriorityMutexTask, ( signed portCHAR * ) "FMuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask );\r
- xTaskCreate( prvHighPriorityMutexTask, ( signed portCHAR * ) "FMuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );\r
+ xTaskCreate( prvLowPriorityMutexTask, "FMuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );\r
+ xTaskCreate( prvMediumPriorityMutexTask, "FMuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask );\r
+ xTaskCreate( prvHighPriorityMutexTask, "FMuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );\r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Note the producer has a lower priority than the consumer when the tasks are\r
spawned. */\r
- xTaskCreate( vBlockingQueueConsumer, ( signed char * ) "QConsB1", blckqSTACK_SIZE, ( void * ) pxQueueParameters1, uxPriority, NULL );\r
- xTaskCreate( vBlockingQueueProducer, ( signed char * ) "QProdB2", blckqSTACK_SIZE, ( void * ) pxQueueParameters2, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vBlockingQueueConsumer, "QConsB1", blckqSTACK_SIZE, ( void * ) pxQueueParameters1, uxPriority, NULL );\r
+ xTaskCreate( vBlockingQueueProducer, "QProdB2", blckqSTACK_SIZE, ( void * ) pxQueueParameters2, tskIDLE_PRIORITY, NULL );\r
\r
\r
\r
pxQueueParameters4->xBlockTime = xBlockTime;\r
pxQueueParameters4->psCheckVariable = &( sBlockingConsumerCount[ 1 ] );\r
\r
- xTaskCreate( vBlockingQueueConsumer, ( signed char * ) "QConsB3", blckqSTACK_SIZE, ( void * ) pxQueueParameters3, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vBlockingQueueProducer, ( signed char * ) "QProdB4", blckqSTACK_SIZE, ( void * ) pxQueueParameters4, uxPriority, NULL );\r
+ xTaskCreate( vBlockingQueueConsumer, "QConsB3", blckqSTACK_SIZE, ( void * ) pxQueueParameters3, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vBlockingQueueProducer, "QProdB4", blckqSTACK_SIZE, ( void * ) pxQueueParameters4, uxPriority, NULL );\r
\r
\r
\r
pxQueueParameters6->xBlockTime = xBlockTime;\r
pxQueueParameters6->psCheckVariable = &( sBlockingConsumerCount[ 2 ] );\r
\r
- xTaskCreate( vBlockingQueueProducer, ( signed char * ) "QProdB5", blckqSTACK_SIZE, ( void * ) pxQueueParameters5, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vBlockingQueueConsumer, ( signed char * ) "QConsB6", blckqSTACK_SIZE, ( void * ) pxQueueParameters6, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vBlockingQueueProducer, "QProdB5", blckqSTACK_SIZE, ( void * ) pxQueueParameters5, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vBlockingQueueConsumer, "QConsB6", blckqSTACK_SIZE, ( void * ) pxQueueParameters6, tskIDLE_PRIORITY, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
* event groups API.\r
*/\r
\r
- xTaskCreate( prvWaitBitsTask, ( signed char * ) "WaitO", configMINIMAL_STACK_SIZE, NULL, ebWAIT_BIT_TASK_PRIORITY, &xWaitBitsTaskHandle );\r
- xTaskCreate( prvSetBitsTask, ( signed char * ) "SetB", configMINIMAL_STACK_SIZE, ( void * ) xWaitBitsTaskHandle, ebSET_BIT_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvSyncTask, ( signed char * ) "Rndv", configMINIMAL_STACK_SIZE, ( void * ) ebRENDESVOUS_TASK_1_SYNC_BIT, ebWAIT_BIT_TASK_PRIORITY, &xSyncTask1 );\r
- xTaskCreate( prvSyncTask, ( signed char * ) "Rndv", configMINIMAL_STACK_SIZE, ( void * ) ebRENDESVOUS_TASK_2_SYNC_BIT, ebWAIT_BIT_TASK_PRIORITY, &xSyncTask2 );\r
+ xTaskCreate( prvWaitBitsTask, "WaitO", configMINIMAL_STACK_SIZE, NULL, ebWAIT_BIT_TASK_PRIORITY, &xWaitBitsTaskHandle );\r
+ xTaskCreate( prvSetBitsTask, "SetB", configMINIMAL_STACK_SIZE, ( void * ) xWaitBitsTaskHandle, ebSET_BIT_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvSyncTask, "Rndv", configMINIMAL_STACK_SIZE, ( void * ) ebRENDESVOUS_TASK_1_SYNC_BIT, ebWAIT_BIT_TASK_PRIORITY, &xSyncTask1 );\r
+ xTaskCreate( prvSyncTask, "Rndv", configMINIMAL_STACK_SIZE, ( void * ) ebRENDESVOUS_TASK_2_SYNC_BIT, ebWAIT_BIT_TASK_PRIORITY, &xSyncTask2 );\r
\r
/* If the last task was created then the others will have been too. */\r
configASSERT( xSyncTask2 );\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
defined to be less than 1. */\r
- vQueueAddToRegistry( xQueue, ( signed portCHAR * ) "Gen_Queue_Test" );\r
+ vQueueAddToRegistry( xQueue, "Gen_Queue_Test" );\r
\r
/* Create the demo task and pass it the queue just created. We are\r
passing the queue handle by value so it does not matter that it is\r
declared on the stack here. */\r
- xTaskCreate( prvSendFrontAndBackTest, ( signed portCHAR * )"GenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );\r
+ xTaskCreate( prvSendFrontAndBackTest, "GenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );\r
\r
/* Create the mutex used by the prvMutexTest task. */\r
xMutex = xSemaphoreCreateMutex();\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
defined to be less than 1. */\r
- vQueueAddToRegistry( ( xQueueHandle ) xMutex, ( signed portCHAR * ) "Gen_Queue_Mutex" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Gen_Queue_Mutex" );\r
\r
/* Create the mutex demo tasks and pass it the mutex just created. We are\r
passing the mutex handle by value so it does not matter that it is declared\r
on the stack here. */\r
- xTaskCreate( prvLowPriorityMutexTask, ( signed portCHAR * )"MuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );\r
- xTaskCreate( prvMediumPriorityMutexTask, ( signed portCHAR * )"MuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask );\r
- xTaskCreate( prvHighPriorityMutexTask, ( signed portCHAR * )"MuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );\r
+ xTaskCreate( prvLowPriorityMutexTask, "MuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );\r
+ xTaskCreate( prvMediumPriorityMutexTask, "MuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask );\r
+ xTaskCreate( prvHighPriorityMutexTask, "MuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );\r
}\r
/*-----------------------------------------------------------*/\r
\r
void vStartInterruptQueueTasks( void )\r
{\r
/* Start the test tasks. */\r
- xTaskCreate( prvHigherPriorityNormallyEmptyTask, ( signed portCHAR * ) "H1QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask1 );\r
- xTaskCreate( prvHigherPriorityNormallyEmptyTask, ( signed portCHAR * ) "H2QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask2 );\r
- xTaskCreate( prvLowerPriorityNormallyEmptyTask, ( signed portCHAR * ) "L1QRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );\r
- xTaskCreate( prv1stHigherPriorityNormallyFullTask, ( signed portCHAR * ) "H1QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask1 );\r
- xTaskCreate( prv2ndHigherPriorityNormallyFullTask, ( signed portCHAR * ) "H2QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask2 );\r
- xTaskCreate( prvLowerPriorityNormallyFullTask, ( signed portCHAR * ) "L2QRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );\r
+ xTaskCreate( prvHigherPriorityNormallyEmptyTask, "H1QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask1 );\r
+ xTaskCreate( prvHigherPriorityNormallyEmptyTask, "H2QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask2 );\r
+ xTaskCreate( prvLowerPriorityNormallyEmptyTask, "L1QRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );\r
+ xTaskCreate( prv1stHigherPriorityNormallyFullTask, "H1QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask1 );\r
+ xTaskCreate( prv2ndHigherPriorityNormallyFullTask, "H2QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask2 );\r
+ xTaskCreate( prvLowerPriorityNormallyFullTask, "L2QRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );\r
\r
/* Create the queues that are accessed by multiple tasks and multiple\r
interrupts. */\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
defined to be less than 1. */\r
- vQueueAddToRegistry( xNormallyFullQueue, ( signed portCHAR * ) "NormallyFull" );\r
- vQueueAddToRegistry( xNormallyEmptyQueue, ( signed portCHAR * ) "NormallyEmpty" );\r
+ vQueueAddToRegistry( xNormallyFullQueue, "NormallyFull" );\r
+ vQueueAddToRegistry( xNormallyEmptyQueue, "NormallyEmpty" );\r
}\r
/*-----------------------------------------------------------*/\r
\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( xPolledQueue, ( signed char * ) "Poll_Test_Queue" );\r
+ vQueueAddToRegistry( xPolledQueue, "Poll_Test_Queue" );\r
\r
/* Spawn the producer and consumer. */\r
- xTaskCreate( vPolledQueueConsumer, ( signed char * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );\r
- xTaskCreate( vPolledQueueProducer, ( signed char * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
defined to be less than 1. */\r
- vQueueAddToRegistry( xQueue, ( signed portCHAR * ) "QPeek_Test_Queue" );\r
+ vQueueAddToRegistry( xQueue, "QPeek_Test_Queue" );\r
\r
/* Create the demo tasks and pass it the queue just created. We are\r
passing the queue handle by value so it does not matter that it is declared\r
on the stack here. */\r
- xTaskCreate( prvLowPriorityPeekTask, ( signed portCHAR * )"PeekL", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekLOW_PRIORITY, NULL );\r
- xTaskCreate( prvMediumPriorityPeekTask, ( signed portCHAR * )"PeekM", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekMEDIUM_PRIORITY, &xMediumPriorityTask );\r
- xTaskCreate( prvHighPriorityPeekTask, ( signed portCHAR * )"PeekH1", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGH_PRIORITY, &xHighPriorityTask );\r
- xTaskCreate( prvHighestPriorityPeekTask, ( signed portCHAR * )"PeekH2", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGHEST_PRIORITY, &xHighestPriorityTask );\r
+ xTaskCreate( prvLowPriorityPeekTask, "PeekL", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekLOW_PRIORITY, NULL );\r
+ xTaskCreate( prvMediumPriorityPeekTask, "PeekM", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekMEDIUM_PRIORITY, &xMediumPriorityTask );\r
+ xTaskCreate( prvHighPriorityPeekTask, "PeekH1", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGH_PRIORITY, &xHighPriorityTask );\r
+ xTaskCreate( prvHighestPriorityPeekTask, "PeekH2", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGHEST_PRIORITY, &xHighestPriorityTask );\r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Create the test task. The queue used by the test task is created inside\r
the task itself. */\r
- xTaskCreate( prvQueueOverwriteTask, ( signed char * ) "QOver", configMINIMAL_STACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( prvQueueOverwriteTask, "QOver", configMINIMAL_STACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
void vStartQueueSetTasks( void )\r
{\r
/* Create the tasks. */\r
- xTaskCreate( prvQueueSetSendingTask, ( signed char * ) "SetTx", configMINIMAL_STACK_SIZE, NULL, queuesetMEDIUM_PRIORITY, &xQueueSetSendingTask );\r
- xTaskCreate( prvQueueSetReceivingTask, ( signed char * ) "SetRx", configMINIMAL_STACK_SIZE, ( void * ) xQueueSetSendingTask, queuesetMEDIUM_PRIORITY, &xQueueSetReceivingTask );\r
+ xTaskCreate( prvQueueSetSendingTask, "SetTx", configMINIMAL_STACK_SIZE, NULL, queuesetMEDIUM_PRIORITY, &xQueueSetSendingTask );\r
+ xTaskCreate( prvQueueSetReceivingTask, "SetRx", configMINIMAL_STACK_SIZE, ( void * ) xQueueSetSendingTask, queuesetMEDIUM_PRIORITY, &xQueueSetReceivingTask );\r
\r
/* It is important that the sending task does not attempt to write to a\r
queue before the queue has been created. It is therefore placed into the\r
task, which will then preempt this task). */\r
if( xTestStatus != pdFAIL )\r
{\r
- xTaskCreate( prvTimerTestTask, ( signed portCHAR * ) "Tmr Tst", configMINIMAL_STACK_SIZE, NULL, configTIMER_TASK_PRIORITY - 1, NULL );\r
+ xTaskCreate( prvTimerTestTask, "Tmr Tst", configMINIMAL_STACK_SIZE, NULL, configTIMER_TASK_PRIORITY - 1, NULL );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
( void ) pvParameters;\r
\r
/* Create a one-shot timer for use later on in this test. */\r
- xOneShotTimer = xTimerCreate( ( const signed char * ) "Oneshot Timer",/* Text name to facilitate debugging. The kernel does not use this itself. */\r
- tmrdemoONE_SHOT_TIMER_PERIOD, /* The period for the timer. */\r
- pdFALSE, /* Don't auto-reload - hence a one shot timer. */\r
- ( void * ) 0, /* The timer identifier. In this case this is not used as the timer has its own callback. */\r
- prvOneShotTimerCallback ); /* The callback to be called when the timer expires. */\r
+ xOneShotTimer = xTimerCreate( "Oneshot Timer", /* Text name to facilitate debugging. The kernel does not use this itself. */\r
+ tmrdemoONE_SHOT_TIMER_PERIOD, /* The period for the timer. */\r
+ pdFALSE, /* Don't auto-reload - hence a one shot timer. */\r
+ ( void * ) 0, /* The timer identifier. In this case this is not used as the timer has its own callback. */\r
+ prvOneShotTimerCallback ); /* The callback to be called when the timer expires. */\r
\r
if( xOneShotTimer == NULL )\r
{\r
and start a timer. These timers are being started before the scheduler has\r
been started, so their block times should get set to zero within the timer\r
API itself. */\r
- xAutoReloadTimers[ xTimer ] = xTimerCreate( ( const signed char * )"FR Timer", /* Text name to facilitate debugging. The kernel does not use this itself. */\r
+ xAutoReloadTimers[ xTimer ] = xTimerCreate( "FR Timer", /* Text name to facilitate debugging. The kernel does not use this itself. */\r
( ( xTimer + ( portTickType ) 1 ) * xBasePeriod ),/* The period for the timer. The plus 1 ensures a period of zero is not specified. */\r
pdTRUE, /* Auto-reload is set to true. */\r
( void * ) xTimer, /* An identifier for the timer as all the auto reload timers use the same callback. */\r
/* The timers queue should now be full, so it should be possible to create\r
another timer, but not possible to start it (the timer queue will not get\r
drained until the scheduler has been started. */\r
- xAutoReloadTimers[ configTIMER_QUEUE_LENGTH ] = xTimerCreate( ( const signed char * ) "FR Timer", /* Text name to facilitate debugging. The kernel does not use this itself. */\r
- ( configTIMER_QUEUE_LENGTH * xBasePeriod ), /* The period for the timer. */\r
- pdTRUE, /* Auto-reload is set to true. */\r
- ( void * ) xTimer, /* An identifier for the timer as all the auto reload timers use the same callback. */\r
- prvAutoReloadTimerCallback ); /* The callback executed when the timer expires. */\r
+ xAutoReloadTimers[ configTIMER_QUEUE_LENGTH ] = xTimerCreate( "FR Timer", /* Text name to facilitate debugging. The kernel does not use this itself. */\r
+ ( configTIMER_QUEUE_LENGTH * xBasePeriod ), /* The period for the timer. */\r
+ pdTRUE, /* Auto-reload is set to true. */\r
+ ( void * ) xTimer, /* An identifier for the timer as all the auto reload timers use the same callback. */\r
+ prvAutoReloadTimerCallback ); /* The callback executed when the timer expires. */\r
\r
if( xAutoReloadTimers[ configTIMER_QUEUE_LENGTH ] == NULL )\r
{\r
\r
/* Create the timers that are used from the tick interrupt to test the timer\r
API functions that can be called from an ISR. */\r
- xISRAutoReloadTimer = xTimerCreate( ( const signed char * ) "ISR AR", /* The text name given to the timer. */\r
+ xISRAutoReloadTimer = xTimerCreate( "ISR AR", /* The text name given to the timer. */\r
0xffff, /* The timer is not given a period yet - this will be done from the tick hook, but a period of 0 is invalid. */\r
pdTRUE, /* This is an auto reload timer. */\r
( void * ) NULL, /* The identifier is not required. */\r
prvISRAutoReloadTimerCallback ); /* The callback that is executed when the timer expires. */\r
\r
- xISROneShotTimer = xTimerCreate( ( const signed char * ) "ISR OS", /* The text name given to the timer. */\r
+ xISROneShotTimer = xTimerCreate( "ISR OS", /* The text name given to the timer. */\r
0xffff, /* The timer is not given a period yet - this will be done from the tick hook, but a period of 0 is invalid. */\r
pdFALSE, /* This is a one shot timer. */\r
( void * ) NULL, /* The identifier is not required. */\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
defined to be less than 1. */\r
- vQueueAddToRegistry( xTestQueue, ( signed char * ) "Block_Time_Queue" );\r
+ vQueueAddToRegistry( xTestQueue, "Block_Time_Queue" );\r
\r
/* Create the two test tasks. */\r
- xTaskCreate( vPrimaryBlockTimeTestTask, ( signed char * )"BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
- xTaskCreate( vSecondaryBlockTimeTestTask, ( signed char * )"BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
+ xTaskCreate( vPrimaryBlockTimeTestTask, "BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
+ xTaskCreate( vSecondaryBlockTimeTestTask, "BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
xSerialPortInitMinimal( ulBaudRate, comBUFFER_LEN );\r
\r
/* The Tx task is spawned with a lower priority than the Rx task. */\r
- xTaskCreate( vComTxTask, ( signed char * ) "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );\r
- xTaskCreate( vComRxTask, ( signed char * ) "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vComTxTask, "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
static portTASK_FUNCTION( vComTxTask, pvParameters )\r
{\r
-signed char cByteToSend;\r
+char cByteToSend;\r
portTickType xTimeToWait;\r
\r
/* Just to stop compiler warnings. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* See http://www.serialporttool.com/CommEcho.htm for a suitable echo server\r
* for Windows hosts.\r
*\r
- * The timer sends a string to the UART, toggles an LED, then resets itself by \r
- * changing its own period. The period is calculated as a pseudo random number \r
+ * The timer sends a string to the UART, toggles an LED, then resets itself by\r
+ * changing its own period. The period is calculated as a pseudo random number\r
* between comTX_MAX_BLOCK_TIME and comTX_MIN_BLOCK_TIME.\r
*\r
- * The task blocks on an Rx queue waiting for a character to become available. \r
- * Received characters are checked to ensure they match those transmitted by the \r
- * Tx timer. An error is latched if characters are missing, incorrect, or \r
+ * The task blocks on an Rx queue waiting for a character to become available.\r
+ * Received characters are checked to ensure they match those transmitted by the\r
+ * Tx timer. An error is latched if characters are missing, incorrect, or\r
* arrive too slowly.\r
*\r
* How characters are actually transmitted and received is port specific. Demos\r
* that include this test/demo file will provide example drivers. The Tx timer\r
- * executes in the context of the timer service (daemon) task, and must \r
+ * executes in the context of the timer service (daemon) task, and must\r
* therefore never attempt to block.\r
*\r
*/\r
\r
/* Create the Rx task and the Tx timer. The timer is started from the\r
Rx task. */\r
- xTaskCreate( vComRxTask, ( signed char * ) "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
- xTxTimer = xTimerCreate( ( const signed char * ) "TxTimer", comTX_MIN_BLOCK_TIME, pdFALSE, NULL, prvComTxTimerCallback );\r
+ xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTxTimer = xTimerCreate( "TxTimer", comTX_MIN_BLOCK_TIME, pdFALSE, NULL, prvComTxTimerCallback );\r
configASSERT( xTxTimer );\r
}\r
/*-----------------------------------------------------------*/\r
sample driver provided with this demo. However - as this is a timer,\r
it executes in the context of the timer task and therefore must not\r
block. */\r
- vSerialPutString( xPort, ( const signed char * const ) comTRANSACTED_STRING, xStringLength );\r
+ vSerialPutString( xPort, comTRANSACTED_STRING, xStringLength );\r
\r
/* Toggle an LED to give a visible indication that another transmission\r
has been performed. */\r
static void vComRxTask( void *pvParameters )\r
{\r
portBASE_TYPE xState = comtstWAITING_START_OF_STRING, xErrorOccurred = pdFALSE;\r
-signed char *pcExpectedByte, cRxedChar;\r
+char *pcExpectedByte, cRxedChar;\r
const xComPortHandle xPort = NULL;\r
\r
/* The parameter is not used in this example. */\r
\r
/* The first expected Rx character is the first in the string that is\r
transmitted. */\r
- pcExpectedByte = ( signed char * ) comTRANSACTED_STRING;\r
+ pcExpectedByte = comTRANSACTED_STRING;\r
\r
for( ;; )\r
{\r
xState = comtstWAITING_END_OF_STRING;\r
pcExpectedByte++;\r
\r
- /* Block for a short period. This just allows the Rx queue \r
+ /* Block for a short period. This just allows the Rx queue\r
to contain more than one character, and therefore prevent\r
- thrashing reads to the queue, and repetitive context \r
+ thrashing reads to the queue, and repetitive context\r
switches as each character is received. */\r
vTaskDelay( comSHORT_DELAY );\r
}\r
}\r
\r
/* Go back to wait for the start of the next string. */\r
- pcExpectedByte = ( signed char * ) comTRANSACTED_STRING;\r
+ pcExpectedByte = comTRANSACTED_STRING;\r
xState = comtstWAITING_START_OF_STRING;\r
}\r
else\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( ( xQueueHandle ) xParameters[ 0 ].xSemaphore, ( signed portCHAR * ) "Counting_Sem_1" );\r
- vQueueAddToRegistry( ( xQueueHandle ) xParameters[ 1 ].xSemaphore, ( signed portCHAR * ) "Counting_Sem_2" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) xParameters[ 0 ].xSemaphore, "Counting_Sem_1" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) xParameters[ 1 ].xSemaphore, "Counting_Sem_2" );\r
\r
\r
/* Were the semaphores created? */\r
if( ( xParameters[ 0 ].xSemaphore != NULL ) || ( xParameters[ 1 ].xSemaphore != NULL ) )\r
{\r
/* Create the demo tasks, passing in the semaphore to use as the parameter. */\r
- xTaskCreate( prvCountingSemaphoreTask, ( signed portCHAR * ) "CNT1", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 0 ] ), tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvCountingSemaphoreTask, ( signed portCHAR * ) "CNT2", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 1 ] ), tskIDLE_PRIORITY, NULL ); \r
+ xTaskCreate( prvCountingSemaphoreTask, "CNT1", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 0 ] ), tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvCountingSemaphoreTask, "CNT2", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 1 ] ), tskIDLE_PRIORITY, NULL ); \r
}\r
}\r
/*-----------------------------------------------------------*/\r
puxPriority = ( unsigned portBASE_TYPE * ) pvPortMalloc( sizeof( unsigned portBASE_TYPE ) );\r
*puxPriority = uxPriority;\r
\r
- xTaskCreate( vCreateTasks, ( signed char * ) "CREATOR", deathSTACK_SIZE, ( void * ) puxPriority, uxPriority, NULL );\r
+ xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) puxPriority, uxPriority, NULL );\r
\r
/* Record the number of tasks that are running now so we know if any of the\r
suicidal tasks have failed to be killed. */\r
\r
xCreatedTask = NULL;\r
\r
- xTaskCreate( vSuicidalTask, ( signed char * ) "SUICID1", configMINIMAL_STACK_SIZE, NULL, uxPriority, &xCreatedTask );\r
- xTaskCreate( vSuicidalTask, ( signed char * ) "SUICID2", configMINIMAL_STACK_SIZE, &xCreatedTask, uxPriority, NULL );\r
+ xTaskCreate( vSuicidalTask, "SUICID1", configMINIMAL_STACK_SIZE, NULL, uxPriority, &xCreatedTask );\r
+ xTaskCreate( vSuicidalTask, "SUICID2", configMINIMAL_STACK_SIZE, &xCreatedTask, uxPriority, NULL );\r
\r
++usCreationCount;\r
}\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
defined to be less than 1. */\r
- vQueueAddToRegistry( xSuspendedTestQueue, ( signed char * ) "Suspended_Test_Queue" );\r
+ vQueueAddToRegistry( xSuspendedTestQueue, "Suspended_Test_Queue" );\r
\r
- xTaskCreate( vContinuousIncrementTask, ( signed char * ) "CNT_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY, &xContinuousIncrementHandle );\r
- xTaskCreate( vLimitedIncrementTask, ( signed char * ) "LIM_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY + 1, &xLimitedIncrementHandle );\r
- xTaskCreate( vCounterControlTask, ( signed char * ) "C_CTRL", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vQueueSendWhenSuspendedTask, ( signed char * ) "SUSP_TX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vQueueReceiveWhenSuspendedTask, ( signed char * ) "SUSP_RX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vContinuousIncrementTask, "CNT_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY, &xContinuousIncrementHandle );\r
+ xTaskCreate( vLimitedIncrementTask, "LIM_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY + 1, &xLimitedIncrementHandle );\r
+ xTaskCreate( vCounterControlTask, "C_CTRL", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vQueueSendWhenSuspendedTask, "SUSP_TX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vQueueReceiveWhenSuspendedTask, "SUSP_RX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
for( xLEDTask = 0; xLEDTask < ledNUMBER_OF_LEDS; ++xLEDTask )\r
{\r
/* Spawn the task. */\r
- xTaskCreate( vLEDFlashTask, ( signed char * ) "LEDx", ledSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* Repeatedly toggles one or more LEDs using software timers - one timer per\r
* LED.\r
*/\r
- \r
+\r
/* Scheduler include files. */\r
#include "FreeRTOS.h"\r
#include "timers.h"\r
for( uxLEDTimer = 0; uxLEDTimer < uxNumberOfLEDs; ++uxLEDTimer )\r
{\r
/* Create the timer. */\r
- xTimer = xTimerCreate( ( const signed char * const ) "Flasher",/* A text name, purely to help debugging. */\r
- ledFLASH_RATE_BASE * ( uxLEDTimer + 1 ), /* The timer period, which is a multiple of ledFLASH_RATE_BASE. */\r
+ xTimer = xTimerCreate( "Flasher", /* A text name, purely to help debugging. */\r
+ ledFLASH_RATE_BASE * ( uxLEDTimer + 1 ),/* The timer period, which is a multiple of ledFLASH_RATE_BASE. */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) uxLEDTimer, /* The ID is used to identify the timer within the timer callback function, as each timer uses the same callback. */\r
prvLEDTimerCallback /* Each timer uses the same callback. */\r
);\r
- \r
+\r
/* If the timer was created successfully, attempt to start it. If the\r
scheduler has not yet been started then the timer command queue must\r
be long enough to hold each command sent to it until such time that the\r
if( xTimer != NULL )\r
{\r
xTimerStart( xTimer, ledDONT_BLOCK );\r
- } \r
+ }\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
void vStartMathTasks( unsigned portBASE_TYPE uxPriority )\r
{\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
for( sTask = 0; sTask < intgNUMBER_OF_TASKS; sTask++ )\r
{\r
- xTaskCreate( vCompeteingIntMathTask, ( signed char * ) "IntMath", intgSTACK_SIZE, ( void * ) &( xTaskCheck[ sTask ] ), uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( vCompeteingIntMathTask, "IntMath", intgSTACK_SIZE, ( void * ) &( xTaskCheck[ sTask ] ), uxPriority, ( xTaskHandle * ) NULL );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
defined to be less than 1. */\r
- vQueueAddToRegistry( ( xQueueHandle ) xMutex, ( signed portCHAR * ) "Recursive_Mutex" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Recursive_Mutex" );\r
\r
\r
if( xMutex != NULL )\r
{\r
- xTaskCreate( prvRecursiveMutexControllingTask, ( signed portCHAR * ) "Rec1", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
- xTaskCreate( prvRecursiveMutexBlockingTask, ( signed portCHAR * ) "Rec2", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
- xTaskCreate( prvRecursiveMutexPollingTask, ( signed portCHAR * ) "Rec3", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvRecursiveMutexControllingTask, "Rec1", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
+ xTaskCreate( prvRecursiveMutexBlockingTask, "Rec2", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
+ xTaskCreate( prvRecursiveMutexPollingTask, "Rec3", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, NULL );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
pxFirstSemaphoreParameters->xBlockTime = ( portTickType ) 0;\r
\r
/* Spawn the first two tasks. As they poll they operate at the idle priority. */\r
- xTaskCreate( prvSemaphoreTest, ( signed char * ) "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );\r
- xTaskCreate( prvSemaphoreTest, ( signed char * ) "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );\r
}\r
}\r
\r
*( pxSecondSemaphoreParameters->pulSharedVariable ) = semtstBLOCKING_EXPECTED_VALUE;\r
pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_RATE_MS;\r
\r
- xTaskCreate( prvSemaphoreTest, ( signed char * ) "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );\r
- xTaskCreate( prvSemaphoreTest, ( signed char * ) "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
}\r
\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( ( xQueueHandle ) pxFirstSemaphoreParameters->xSemaphore, ( signed char * ) "Counting_Sem_1" );\r
- vQueueAddToRegistry( ( xQueueHandle ) pxSecondSemaphoreParameters->xSemaphore, ( signed char * ) "Counting_Sem_2" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) pxFirstSemaphoreParameters->xSemaphore, "Counting_Sem_1" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) pxSecondSemaphoreParameters->xSemaphore, "Counting_Sem_2" );\r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
void vStartMathTasks( unsigned portBASE_TYPE uxPriority )\r
{\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, NULL );\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, NULL );\r
+ xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
#endif\r
\r
/* Create the task that handles the EMAC. */\r
- xTaskCreate( ethernetif_input, ( signed char * ) "ETH_INT", configETHERNET_INPUT_TASK_STACK_SIZE, (void *)netif, configETHERNET_INPUT_TASK_PRIORITY, &xEthIntTask );\r
+ xTaskCreate( ethernetif_input, "ETH_INT", configETHERNET_INPUT_TASK_STACK_SIZE, (void *)netif, configETHERNET_INPUT_TASK_PRIORITY, &xEthIntTask );\r
\r
fec_irq_enable();\r
MCF_FEC_ECR = MCF_FEC_ECR_ETHER_EN;\r
*/\r
void\r
sys_assert( const char *msg )\r
-{ \r
+{\r
/*FSL:only needed for debugging\r
printf(msg);\r
printf("\n\r");\r
THREAD_INIT( p );\r
\r
/* Now q points to a free element in the list. */\r
- if( xTaskCreate( thread, (const signed char *const)name, stacksize, arg, prio, &p->pid ) == pdPASS )\r
+ if( xTaskCreate( thread, name, stacksize, arg, prio, &p->pid ) == pdPASS )\r
{\r
thread_hdl = p;\r
}\r
vPortFree( toremove );\r
}\r
}\r
- /* We are done with accessing the shared datastructure. Release the \r
+ /* We are done with accessing the shared datastructure. Release the\r
* resources.\r
*/\r
vPortExitCritical( );\r
}\r
\r
/*FSL*/\r
-/* \r
+/*\r
*Try to post the "msg" to the mailbox. Returns ERR_MEM if this one\r
*is full, else, ERR_OK if the "msg" is posted.\r
*/\r
sys_mbox_t sys_mbox_new(int size)\r
{\r
xQueueHandle mbox;\r
- \r
+\r
( void ) size;\r
- \r
+\r
mbox = xQueueCreate( archMESG_QUEUE_LENGTH, sizeof( void * ) );\r
\r
#if SYS_STATS\r
#if SYS_STATS\r
lwip_stats.sys.mbox.err++;\r
#endif /* SYS_STATS */\r
- \r
+\r
// TODO notify the user of failure.\r
}\r
\r
else {\r
// could not post, queue must be full\r
result = ERR_MEM;\r
- \r
+\r
#if SYS_STATS\r
lwip_stats.sys.mbox.err++;\r
#endif /* SYS_STATS */\r
- \r
+\r
}\r
\r
return result;\r
{\r
msg = &dummyptr;\r
}\r
- \r
+\r
if ( timeout != 0 )\r
{\r
if ( pdTRUE == xQueueReceive( mbox, &(*msg), timeout / portTICK_RATE_MS ) )\r
{\r
EndTime = xTaskGetTickCount();\r
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;\r
- \r
+\r
return ( Elapsed );\r
}\r
else // timed out blocking for message\r
{\r
*msg = NULL;\r
- \r
+\r
return SYS_ARCH_TIMEOUT;\r
}\r
}\r
while( pdTRUE != xQueueReceive( mbox, &(*msg), portMAX_DELAY ) ){} // time is arbitrary\r
EndTime = xTaskGetTickCount();\r
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;\r
- \r
- return ( Elapsed ); // return time blocked TODO test \r
+\r
+ return ( Elapsed ); // return time blocked TODO test\r
}\r
}\r
\r
xSemaphoreHandle xSemaphore;\r
\r
vSemaphoreCreateBinary( xSemaphore );\r
- \r
+\r
if( xSemaphore == NULL )\r
{\r
- \r
+\r
#if SYS_STATS\r
++lwip_stats.sys.sem.err;\r
#endif /* SYS_STATS */\r
- \r
+\r
return SYS_SEM_NULL; // TODO need assert\r
}\r
- \r
+\r
if(count == 0) // Means it can't be taken\r
{\r
xSemaphoreTake(xSemaphore,1);\r
lwip_stats.sys.sem.max = lwip_stats.sys.sem.used;\r
}\r
#endif /* SYS_STATS */\r
- \r
+\r
return xSemaphore;\r
}\r
\r
{\r
EndTime = xTaskGetTickCount();\r
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;\r
- \r
- return (Elapsed); // return time blocked TODO test \r
+\r
+ return (Elapsed); // return time blocked TODO test\r
}\r
else\r
{\r
EndTime = xTaskGetTickCount();\r
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;\r
\r
- return ( Elapsed ); // return time blocked \r
- \r
+ return ( Elapsed ); // return time blocked\r
+\r
}\r
}\r
\r
#if SYS_STATS\r
--lwip_stats.sys.sem.used;\r
#endif /* SYS_STATS */\r
- \r
+\r
vQueueDelete( sem );\r
}\r
\r
\r
if ( s_nextthread < SYS_THREAD_MAX )\r
{\r
- result = xTaskCreate( thread, ( signed portCHAR * ) name, stacksize, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, name, stacksize, arg, prio, &CreatedTask );\r
\r
// For each task created, store the task handle (pid) in the timers array.\r
// This scheme doesn't allow for threads to be deleted\r
* Prints an assertion messages and aborts execution.\r
*/\r
void sys_assert( const char *msg )\r
-{ \r
+{\r
( void ) msg;\r
/*FSL:only needed for debugging\r
printf(msg);\r
netif->flags |= NETIF_FLAG_LINK_UP;\r
\r
/* Create the task that handles the EMAC. */\r
- xTaskCreate( ethernetif_input, ( signed portCHAR * ) "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, (void *)netif, netifINTERFACE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( ethernetif_input, "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, (void *)netif, netifINTERFACE_TASK_PRIORITY, NULL );\r
} \r
\r
\r
\r
*pxMutex = xSemaphoreCreateMutex();\r
\r
- if( *pxMutex != NULL ) \r
+ if( *pxMutex != NULL )\r
{\r
xReturn = ERR_OK;\r
SYS_STATS_INC_USED( mutex );\r
- } \r
- else \r
+ }\r
+ else\r
{\r
SYS_STATS_INC( mutex.err );\r
}\r
- \r
+\r
return xReturn;\r
}\r
\r
portBASE_TYPE xResult;\r
sys_thread_t xReturn;\r
\r
- xResult = xTaskCreate( pxThread, ( signed char * ) pcName, iStackSize, pvArg, iPriority, &xCreatedTask );\r
+ xResult = xTaskCreate( pxThread, pcName, iStackSize, pvArg, iPriority, &xCreatedTask );\r
\r
if( xResult == pdPASS )\r
{\r
/* Create a task that simulates an interrupt in a real system. This will\r
block waiting for packets, then send a message to the uIP task when data\r
is available. */\r
- xTaskCreate( prvInterruptSimulator, ( signed char * ) "MAC_ISR", configMINIMAL_STACK_SIZE, NULL, ( configuIP_TASK_PRIORITY - 1 ), NULL );\r
+ xTaskCreate( prvInterruptSimulator, "MAC_ISR", configMINIMAL_STACK_SIZE, NULL, ( configuIP_TASK_PRIORITY - 1 ), NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Create a task that simulates an interrupt in a real system. This will\r
block waiting for packets, then send a message to the uIP task when data\r
is available. */\r
- xTaskCreate( prvInterruptSimulator, ( signed char * ) "MAC_ISR", configMINIMAL_STACK_SIZE, NULL, configMAC_ISR_SIMULATOR_PRIORITY, NULL );\r
+ xTaskCreate( prvInterruptSimulator, "MAC_ISR", configMINIMAL_STACK_SIZE, NULL, configMAC_ISR_SIMULATOR_PRIORITY, NULL );\r
}\r
\r
xReturn = ERR_OK;\r
}\r
else\r
- { \r
+ {\r
/* The queue was already full. */\r
xReturn = ERR_MEM;\r
SYS_STATS_INC( mbox.err );\r
\r
ulReturn = xElapsed;\r
}\r
- else \r
+ else\r
{\r
/* Timed out. */\r
*ppvBuffer = NULL;\r
/** Create a new mutex\r
* @param mutex pointer to the mutex to create\r
* @return a new mutex */\r
-err_t sys_mutex_new( sys_mutex_t *pxMutex ) \r
+err_t sys_mutex_new( sys_mutex_t *pxMutex )\r
{\r
err_t xReturn = ERR_MEM;\r
\r
*pxMutex = xSemaphoreCreateMutex();\r
\r
- if( *pxMutex != NULL ) \r
+ if( *pxMutex != NULL )\r
{\r
xReturn = ERR_OK;\r
SYS_STATS_INC_USED( mutex );\r
- } \r
- else \r
+ }\r
+ else\r
{\r
SYS_STATS_INC( mutex.err );\r
}\r
- \r
+\r
return xReturn;\r
}\r
\r
portBASE_TYPE xResult;\r
sys_thread_t xReturn;\r
\r
- xResult = xTaskCreate( pxThread, ( signed char * ) pcName, iStackSize, pvArg, iPriority, &xCreatedTask );\r
+ xResult = xTaskCreate( pxThread, pcName, iStackSize, pvArg, iPriority, &xCreatedTask );\r
\r
if( xResult == pdPASS )\r
{\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
* Creates all the demo application tasks, then starts the scheduler. The WEB\r
* documentation provides more details of the demo application tasks.\r
- * \r
- * Main.c also creates a task called "Check". This only executes every three \r
- * seconds but has the highest priority so is guaranteed to get processor time. \r
+ *\r
+ * Main.c also creates a task called "Check". This only executes every three\r
+ * seconds but has the highest priority so is guaranteed to get processor time.\r
* Its main function is to check that all the other tasks are still operational.\r
- * Each task (other than the "flash" tasks) maintains a unique count that is \r
- * incremented each time the task successfully completes its function. Should \r
- * any error occur within such a task the count is permanently halted. The \r
+ * Each task (other than the "flash" tasks) maintains a unique count that is\r
+ * incremented each time the task successfully completes its function. Should\r
+ * any error occur within such a task the count is permanently halted. The\r
* check task inspects the count of each task to ensure it has changed since\r
- * the last time the check task executed. If all the count variables have \r
+ * the last time the check task executed. If all the count variables have\r
* changed all the tasks are still executing error free, and the check task\r
- * toggles the onboard LED. Should any task contain an error at any time \r
+ * toggles the onboard LED. Should any task contain an error at any time\r
* the LED toggle rate will change from 3 seconds to 500ms.\r
*\r
- * To check the operation of the memory allocator the check task also \r
- * dynamically creates a task before delaying, and deletes it again when it \r
+ * To check the operation of the memory allocator the check task also\r
+ * dynamically creates a task before delaying, and deletes it again when it\r
* wakes. If memory cannot be allocated for the new task the call to xTaskCreate\r
* will fail and an error is signalled. The dynamically created task itself\r
* allocates and frees memory just to give the allocator a bit more exercise.\r
\r
/* LED that is toggled by the check task. The check task periodically checks\r
that all the other tasks are operating without error. If no errors are found\r
-the LED is toggled with mainCHECK_PERIOD frequency. If an error is found \r
+the LED is toggled with mainCHECK_PERIOD frequency. If an error is found\r
the the toggle rate increases to mainERROR_CHECK_PERIOD. */\r
#define mainCHECK_TASK_LED ( 5 )\r
#define mainCHECK_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
\r
/* Start the 'Check' task. */\r
- xTaskCreate( vErrorChecks, ( signed char * )"Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
- /* In this port, to use preemptive scheduler define configUSE_PREEMPTION \r
- as 1 in portmacro.h. To use the cooperative scheduler define \r
+ /* In this port, to use preemptive scheduler define configUSE_PREEMPTION\r
+ as 1 in portmacro.h. To use the cooperative scheduler define\r
configUSE_PREEMPTION as 0. */\r
vTaskStartScheduler();\r
\r
* Cycle for ever, delaying then checking all the other tasks are still\r
* operating without error. If an error is detected then the delay period\r
* is decreased from mainCHECK_PERIOD to mainERROR_CHECK_PERIOD so\r
- * the on board LED flash rate will increase. \r
+ * the on board LED flash rate will increase.\r
*\r
* In addition to the standard tests the memory allocator is tested through\r
- * the dynamic creation and deletion of a task each cycle. Each time the \r
+ * the dynamic creation and deletion of a task each cycle. Each time the\r
* task is created memory must be allocated for its stack. When the task is\r
- * deleted this memory is returned to the heap. If the task cannot be created \r
+ * deleted this memory is returned to the heap. If the task cannot be created\r
* then it is likely that the memory allocation failed. In addition the\r
- * dynamically created task allocates and frees memory while it runs. \r
+ * dynamically created task allocates and frees memory while it runs.\r
*/\r
static void vErrorChecks( void *pvParameters )\r
{\r
later that it has changed. */\r
ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE;\r
\r
- /* Dynamically create a task - passing ulMemCheckTaskRunningCount as a \r
- parameter. */ \r
+ /* Dynamically create a task - passing ulMemCheckTaskRunningCount as a\r
+ parameter. */\r
xCreatedTask = mainNO_TASK;\r
- if( xTaskCreate( vMemCheckTask, ( signed char * ) "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
+ if( xTaskCreate( vMemCheckTask, "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
{\r
/* Could not create the task - we have probably run out of heap. */\r
xDelayPeriod = mainERROR_CHECK_PERIOD;\r
}\r
\r
\r
- /* Delay until it is time to execute again. The delay period is \r
+ /* Delay until it is time to execute again. The delay period is\r
shorter following an error. */\r
vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );\r
\r
- \r
+\r
/* Delete the dynamically created task. */\r
if( xCreatedTask != mainNO_TASK )\r
{\r
vTaskDelete( xCreatedTask );\r
}\r
\r
- /* Check all the standard demo application tasks are executing without \r
+ /* Check all the standard demo application tasks are executing without\r
error. ulMemCheckTaskRunningCount is checked to ensure it was\r
modified by the task just deleted. */\r
if( prvCheckOtherTasksAreStillRunning( ulMemCheckTaskRunningCount ) != pdPASS )\r
\r
/*\r
* Check each set of tasks in turn to see if they have experienced any\r
- * error conditions. \r
+ * error conditions.\r
*/\r
static long prvCheckOtherTasksAreStillRunning( unsigned long ulMemCheckTaskCount )\r
{\r
vErrorChecks task to check the operation of the memory allocator. Each time\r
the task is created memory is allocated for the stack and TCB. Each time\r
the task is deleted this memory is returned to the heap. This task itself\r
- exercises the allocator by allocating and freeing blocks. \r
- \r
- The task executes at the idle priority so does not require a delay. \r
- \r
+ exercises the allocator by allocating and freeing blocks.\r
+\r
+ The task executes at the idle priority so does not require a delay.\r
+\r
pulMemCheckTaskRunningCounter is incremented each cycle to indicate to the\r
vErrorChecks() task that this task is still executing without error. */\r
\r
}\r
else\r
{\r
- /* Reset the count so an error is detected by the \r
+ /* Reset the count so an error is detected by the\r
prvCheckOtherTasksAreStillRunning() function. */\r
*pulMemCheckTaskRunningCounter = mainCOUNT_INITIAL_VALUE;\r
}\r
\r
- /* Allocate some memory - just to give the allocator some extra \r
+ /* Allocate some memory - just to give the allocator some extra\r
exercise. This has to be in a critical section to ensure the\r
task does not get deleted while it has memory allocated. */\r
vTaskSuspendAll();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
* Creates all the demo application tasks, then starts the scheduler. The WEB\r
* documentation provides more details of the demo application tasks.\r
- * \r
+ *\r
* In addition to the standard demo tasks, the follow demo specific tasks are\r
* create:\r
*\r
- * The "Check" task. This only executes every three seconds but has the highest \r
- * priority so is guaranteed to get processor time. Its main function is to \r
- * check that all the other tasks are still operational. Most tasks maintain \r
- * a unique count that is incremented each time the task successfully completes \r
- * its function. Should any error occur within such a task the count is \r
- * permanently halted. The check task inspects the count of each task to ensure \r
- * it has changed since the last time the check task executed. If all the count \r
- * variables have changed all the tasks are still executing error free, and the \r
- * check task toggles the onboard LED. Should any task contain an error at any time \r
+ * The "Check" task. This only executes every three seconds but has the highest\r
+ * priority so is guaranteed to get processor time. Its main function is to\r
+ * check that all the other tasks are still operational. Most tasks maintain\r
+ * a unique count that is incremented each time the task successfully completes\r
+ * its function. Should any error occur within such a task the count is\r
+ * permanently halted. The check task inspects the count of each task to ensure\r
+ * it has changed since the last time the check task executed. If all the count\r
+ * variables have changed all the tasks are still executing error free, and the\r
+ * check task toggles the onboard LED. Should any task contain an error at any time\r
* the LED toggle rate will change from 3 seconds to 500ms.\r
*\r
* The "Register Check" tasks. These tasks fill the CPU registers with known\r
* context switch mechanism. The register check tasks operate at low priority\r
* so are switched in and out frequently.\r
*\r
- * The "Trace Utility" task. This can be used to obtain trace and debug \r
+ * The "Trace Utility" task. This can be used to obtain trace and debug\r
* information via UART5.\r
*/\r
\r
#include "taskutility.h"\r
#include "partest.h"\r
#include "crflash.h"\r
- \r
+\r
/* Demo task priorities. */\r
#define mainWATCHDOG_TASK_PRIORITY ( tskIDLE_PRIORITY + 5 )\r
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )\r
/* Baud rate used by the COM test tasks. */\r
#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 19200 )\r
\r
-/* The frequency at which the 'Check' tasks executes. See the comments at the \r
+/* The frequency at which the 'Check' tasks executes. See the comments at the\r
top of the page. When the system is operating error free the 'Check' task\r
toggles an LED every three seconds. If an error is discovered in any task the\r
-rate is increased to 500 milliseconds. [in this case the '*' characters on the \r
+rate is increased to 500 milliseconds. [in this case the '*' characters on the\r
LCD represent LEDs]*/\r
#define mainNO_ERROR_CHECK_DELAY ( ( portTickType ) 3000 / portTICK_RATE_MS )\r
#define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS )\r
\r
/*---------------------------------------------------------------------------*/\r
\r
-/* \r
+/*\r
* The function that implements the Check task. See the comments at the head\r
* of the page for implementation details.\r
- */ \r
+ */\r
static void prvErrorChecks( void *pvParameters );\r
\r
/*\r
*/\r
static portSHORT prvCheckOtherTasksAreStillRunning( void );\r
\r
-/* \r
- * Setup the microcontroller as used by this demo. \r
+/*\r
+ * Setup the microcontroller as used by this demo.\r
*/\r
static void prvSetupHardware( void );\r
\r
\r
/*---------------------------------------------------------------------------*/\r
\r
-/* The variable that is set to true should an error be found in one of the \r
+/* The variable that is set to true should an error be found in one of the\r
register test tasks. */\r
unsigned portLONG ulRegTestError = pdFALSE;\r
\r
/* Start all the demo application tasks, then start the scheduler. */\r
void main(void)\r
{\r
- /* Initialise the hardware ready for the demo. */ \r
+ /* Initialise the hardware ready for the demo. */\r
prvSetupHardware();\r
\r
/* Start the standard demo application tasks. */\r
- vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); \r
+ vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED - 1 );\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
- vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); \r
- vStartDynamicPriorityTasks(); \r
- vStartMathTasks( tskIDLE_PRIORITY ); \r
+ vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY );\r
+ vStartDynamicPriorityTasks();\r
+ vStartMathTasks( tskIDLE_PRIORITY );\r
vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );\r
vStartQueuePeekTasks();\r
vCreateBlockTimeTasks();\r
vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES );\r
\r
/* Start the 'Check' task which is defined in this file. */\r
- xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); \r
+ xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the 'Register Test' tasks as described at the top of this file. */\r
- xTaskCreate( vFirstRegisterTestTask, ( signed portCHAR * ) "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vSecondRegisterTestTask, ( signed portCHAR * ) "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vFirstRegisterTestTask, "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vSecondRegisterTestTask, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
- /* Start the task that write trace information to the UART. */ \r
+ /* Start the task that write trace information to the UART. */\r
vUtilityStartTraceTask( mainUTILITY_TASK_PRIORITY );\r
\r
/* If we are going to service the watchdog from within a task, then create\r
- the task here. */ \r
- #if WATCHDOG == WTC_IN_TASK \r
+ the task here. */\r
+ #if WATCHDOG == WTC_IN_TASK\r
vStartWatchdogTask( mainWATCHDOG_TASK_PRIORITY );\r
- #endif \r
- \r
+ #endif\r
+\r
/* The suicide tasks must be started last as they record the number of other\r
tasks that exist within the system. The value is then used to ensure at run\r
time the number of tasks that exists is within expected bounds. */\r
vCreateSuicidalTasks( mainDEATH_PRIORITY );\r
\r
/* Now start the scheduler. Following this call the created tasks should\r
- be executing. */ \r
+ be executing. */\r
vTaskStartScheduler( );\r
- \r
- /* vTaskStartScheduler() will only return if an error occurs while the \r
+\r
+ /* vTaskStartScheduler() will only return if an error occurs while the\r
idle task is being created. */\r
for( ;; );\r
}\r
for( ;; )\r
{\r
/* Wait until it is time to check again. The time we wait here depends\r
- on whether an error has been detected or not. When an error is \r
+ on whether an error has been detected or not. When an error is\r
detected the time is shortened resulting in a faster LED flash rate. */\r
/* Perform this check every mainCHECK_DELAY milliseconds. */\r
vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );\r
/* See if the other tasks are all ok. */\r
if( prvCheckOtherTasksAreStillRunning() != pdPASS )\r
{\r
- /* An error occurred in one of the tasks so shorten the delay \r
+ /* An error occurred in one of the tasks so shorten the delay\r
period - which has the effect of increasing the frequency of the\r
LED toggle. */\r
xDelayPeriod = mainERROR_CHECK_DELAY;\r
portBASE_TYPE lReturn = pdPASS;\r
\r
/* The demo tasks maintain a count that increments every cycle of the task\r
- provided that the task has never encountered an error. This function \r
+ provided that the task has never encountered an error. This function\r
checks the counts maintained by the tasks to ensure they are still being\r
incremented. A count remaining at the same value between calls therefore\r
indicates that an error has been detected. */\r
{\r
lReturn = pdFAIL;\r
}\r
- \r
+\r
if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
}\r
- \r
+\r
if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
}\r
- \r
+\r
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
}\r
- \r
+\r
if( xAreMathsTaskStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
}\r
- \r
+\r
if( xIsCreateTaskStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
}\r
- \r
+\r
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
}\r
- \r
+\r
if ( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
}\r
- \r
+\r
if ( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
vParTestInitialise();\r
\r
/* If we are going to use the watchdog, then initialise it now. */\r
- #if WATCHDOG != WTC_NONE \r
+ #if WATCHDOG != WTC_NONE\r
InitWatchdog();\r
#endif\r
}\r
LDI #0xbbbbbbbb, R10\r
LDI #0xcccccccc, R11\r
LDI #0xdddddddd, R12\r
- \r
+\r
;Check each register still contains the expected value.\r
LDI #0x11111111, R13\r
CMP R13, R0\r
First_Set_Error:\r
\r
; Latch that an error has occurred.\r
- LDI #_ulRegTestError, R0 \r
+ LDI #_ulRegTestError, R0\r
LDI #0x00000001, R1\r
ST R1, @R0\r
\r
LDI #0xbbbbbbbb, R11\r
LDI #0xcccccccc, R12\r
LDI #0xdddddddd, R0\r
- \r
+\r
;Check each register still contains the expected value.\r
LDI #0x11111111, R13\r
CMP R13, R1\r
Second_Set_Error:\r
\r
; Latch that an error has occurred.\r
- LDI #_ulRegTestError, R0 \r
+ LDI #_ulRegTestError, R0\r
LDI #0x00000001, R1\r
ST R1, @R0\r
\r
/* (C) Fujitsu Microelectronics Europe GmbH */\r
/*------------------------------------------------------------------------\r
taskutility.C\r
- - \r
+ -\r
-------------------------------------------------------------------------*/\r
#include "mb91467d.h"\r
#include "vectors.h"\r
vInitUart5();\r
portENTER_CRITICAL();\r
\r
- xTaskCreate( vUART5Task, (signed portCHAR *) "UART5", configMINIMAL_STACK_SIZE * 2, ( void * ) NULL, uxPriority, NULL );\r
+ xTaskCreate( vUART5Task, "UART5", configMINIMAL_STACK_SIZE * 2, ( void * ) NULL, uxPriority, NULL );\r
}\r
}\r
\r
switch( ch )\r
{\r
case '1':\r
- vTaskList( (signed char *) buff );\r
+ vTaskList( buff );\r
Puts5( "\n\rThe current task list is as follows...." );\r
Puts5( "\n\r----------------------------------------------" );\r
Puts5( "\n\rName State Priority Stack Number" );\r
\r
/*---------------------------------------------------------------------------\r
* Setup Watchdog\r
- *---------------------------------------------------------------------------*/ \r
+ *---------------------------------------------------------------------------*/\r
#if WATCHDOG != WTC_NONE\r
void InitWatchdog(void)\r
{\r
/*---------------------------------------------------------------------------\r
* The below task clears the watchdog and blocks itself for WTC_CLR_PER ticks.\r
*---------------------------------------------------------------------------*/\r
-#if WATCHDOG == WTC_IN_TASK \r
+#if WATCHDOG == WTC_IN_TASK\r
static void prvWatchdogTask ( void *pvParameters )\r
{\r
const portTickType xFrequency = WTC_CLR_PER;\r
portTickType xLastWakeTime;\r
\r
- /* Get currrent tick count */ \r
+ /* Get currrent tick count */\r
xLastWakeTime = xTaskGetTickCount();\r
- \r
+\r
for( ; ; )\r
{\r
Kick_Watchdog();\r
- \r
- /* Block the task for WTC_CLR_PER ticks (300 ms) at watchdog overflow \r
- period of WTC_PER_2_16 CLKRC cycles (655.36 ms) */ \r
+\r
+ /* Block the task for WTC_CLR_PER ticks (300 ms) at watchdog overflow\r
+ period of WTC_PER_2_16 CLKRC cycles (655.36 ms) */\r
vTaskDelayUntil( &xLastWakeTime, xFrequency );\r
- } \r
+ }\r
}\r
#endif\r
\r
/*---------------------------------------------------------------------------\r
* The below function creates hardware watchdog task.\r
- *---------------------------------------------------------------------------*/ \r
-#if WATCHDOG == WTC_IN_TASK \r
+ *---------------------------------------------------------------------------*/\r
+#if WATCHDOG == WTC_IN_TASK\r
void vStartWatchdogTask( unsigned portSHORT uxPriority )\r
{\r
- xTaskCreate( prvWatchdogTask , ( signed portCHAR * ) "KickWTC", portMINIMAL_STACK_SIZE, ( void * ) NULL, uxPriority, ( xTaskHandle * ) NULL ); \r
+ xTaskCreate( prvWatchdogTask , "KickWTC", portMINIMAL_STACK_SIZE, ( void * ) NULL, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
#endif\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
* Creates all the demo application tasks, then starts the scheduler. The WEB\r
* documentation provides more details of the demo application tasks.\r
- * \r
+ *\r
* In addition to the standard demo tasks, the follow demo specific tasks are\r
* create:\r
*\r
- * The "Check" task. This only executes every three seconds but has the highest \r
- * priority so is guaranteed to get processor time. Its main function is to \r
- * check that all the other tasks are still operational. Most tasks maintain \r
- * a unique count that is incremented each time the task successfully completes \r
- * its function. Should any error occur within such a task the count is \r
- * permanently halted. The check task inspects the count of each task to ensure \r
- * it has changed since the last time the check task executed. If all the count \r
- * variables have changed all the tasks are still executing error free, and the \r
- * check task toggles the onboard LED. Should any task contain an error at any time \r
+ * The "Check" task. This only executes every three seconds but has the highest\r
+ * priority so is guaranteed to get processor time. Its main function is to\r
+ * check that all the other tasks are still operational. Most tasks maintain\r
+ * a unique count that is incremented each time the task successfully completes\r
+ * its function. Should any error occur within such a task the count is\r
+ * permanently halted. The check task inspects the count of each task to ensure\r
+ * it has changed since the last time the check task executed. If all the count\r
+ * variables have changed all the tasks are still executing error free, and the\r
+ * check task toggles the onboard LED. Should any task contain an error at any time\r
* the LED toggle rate will change from 3 seconds to 500ms.\r
*\r
- * The "Trace Utility" task. This can be used to obtain trace and debug \r
+ * The "Trace Utility" task. This can be used to obtain trace and debug\r
* information via UART1.\r
*/\r
\r
/* Baud rate used by the COM test tasks. */\r
#define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 19200 )\r
\r
-/* The frequency at which the 'Check' tasks executes. See the comments at the \r
+/* The frequency at which the 'Check' tasks executes. See the comments at the\r
top of the page. When the system is operating error free the 'Check' task\r
toggles an LED every three seconds. If an error is discovered in any task the\r
-rate is increased to 500 milliseconds. [in this case the '*' characters on the \r
+rate is increased to 500 milliseconds. [in this case the '*' characters on the\r
LCD represent LED's] */\r
#define mainNO_ERROR_CHECK_DELAY ( (portTickType) 3000 / portTICK_RATE_MS )\r
#define mainERROR_CHECK_DELAY ( (portTickType) 500 / portTICK_RATE_MS )\r
\r
/*-----------------------------------------------------------*/\r
\r
-/* \r
+/*\r
* The function that implements the Check task. See the comments at the head\r
* of the page for implementation details.\r
*/\r
\r
/* Start the standard demo application tasks. */\r
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
- vStartIntegerMathTasks( tskIDLE_PRIORITY ); \r
+ vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );\r
#endif\r
\r
/* Start the 'Check' task which is defined in this file. */\r
- xTaskCreate( vErrorChecks, (signed char *) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be started last as they record the number of other\r
tasks that exist within the system. The value is then used to ensure at run\r
vCreateSuicidalTasks( mainDEATH_PRIORITY );\r
\r
/* Now start the scheduler. Following this call the created tasks should\r
- be executing. */ \r
+ be executing. */\r
vTaskStartScheduler( );\r
- \r
- /* vTaskStartScheduler() will only return if an error occurs while the \r
+\r
+ /* vTaskStartScheduler() will only return if an error occurs while the\r
idle task is being created. */\r
for( ;; );\r
}\r
for( ;; )\r
{\r
/* Wait until it is time to check again. The time we wait here depends\r
- on whether an error has been detected or not. When an error is \r
+ on whether an error has been detected or not. When an error is\r
detected the time is shortened resulting in a faster LED flash rate. */\r
vTaskDelay( xDelayPeriod );\r
\r
/* See if the other tasks are all ok. */\r
if( prvCheckOtherTasksAreStillRunning() != pdPASS )\r
{\r
- /* An error occurred in one of the tasks so shorten the delay \r
+ /* An error occurred in one of the tasks so shorten the delay\r
period - which has the effect of increasing the frequency of the\r
LED toggle. */\r
xDelayPeriod = mainERROR_CHECK_DELAY;\r
static short sNoErrorFound = pdTRUE;\r
\r
/* The demo tasks maintain a count that increments every cycle of the task\r
- provided that the task has never encountered an error. This function \r
+ provided that the task has never encountered an error. This function\r
checks the counts maintained by the tasks to ensure they are still being\r
incremented. A count remaining at the same value between calls therefore\r
indicates that an error has been detected. Only tasks that do not flash\r
\r
/*------------------------------------------------------------------------\r
taskutility.C\r
- - \r
+ -\r
-------------------------------------------------------------------------*/\r
\r
/*************************@INCLUDE_START************************/\r
portENTER_CRITICAL();\r
InitUart0();\r
portENTER_CRITICAL();\r
- xTaskCreate( vUART0Task, (signed portCHAR *) "UART1", configMINIMAL_STACK_SIZE * 3, ( void * ) NULL, uxPriority, &UART_TaskHandle );\r
+ xTaskCreate( vUART0Task, "UART1", configMINIMAL_STACK_SIZE * 3, ( void * ) NULL, uxPriority, &UART_TaskHandle );\r
}\r
}\r
\r
switch( ch )\r
{\r
case '1':\r
- vTaskList( (signed char *) buff );\r
+ vTaskList( buff );\r
Puts0( "\n\rThe current task list is as follows...." );\r
Puts0( "\n\r----------------------------------------------" );\r
Puts0( "\n\rName State Priority Stack Number" );\r
#if WATCHDOG == WTC_IN_TASK\r
void vStartWatchdogTask( unsigned portBASE_TYPE uxPriority )\r
{\r
- xTaskCreate( prvWatchdogTask, (signed portCHAR *) "KickWTC", portMINIMAL_STACK_SIZE, ( void * ) NULL, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( prvWatchdogTask, "KickWTC", portMINIMAL_STACK_SIZE, ( void * ) NULL, uxPriority, ( xTaskHandle * ) NULL );\r
}\r
\r
#endif\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
for( sLEDTask = 0; sLEDTask < ledNUM_OF_LED_TASKS; ++sLEDTask )\r
{\r
/* Spawn the task. */\r
- xTaskCreate( vLEDFlashTask, ( signed char * ) "LEDt", configMINIMAL_STACK_SIZE, ( void * ) sLEDTask, ( tskIDLE_PRIORITY + 1 ), &( xFlashTaskHandles[ sLEDTask ] ) );\r
+ xTaskCreate( vLEDFlashTask, "LEDt", configMINIMAL_STACK_SIZE, ( void * ) sLEDTask, ( tskIDLE_PRIORITY + 1 ), &( xFlashTaskHandles[ sLEDTask ] ) );\r
}\r
\r
/* Create the task in which the co-routines run. The co-routines themselves\r
are created within the task. */\r
- xTaskCreate( vLEDCoRoutineControlTask, ( signed char * ) "LEDc", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCoroutineTask );\r
+ xTaskCreate( vLEDCoRoutineControlTask, "LEDc", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCoroutineTask );\r
}\r
/*-----------------------------------------------------------*/\r
\r
delay is only half the total period. */\r
xFlashRate /= ( portTickType ) 2;\r
\r
- /* We need to initialise xLastFlashTime prior to the first call to \r
+ /* We need to initialise xLastFlashTime prior to the first call to\r
vTaskDelayUntil(). */\r
xLastFlashTime = xTaskGetTickCount();\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*****\r
*\r
* See http://www.freertos.org/Documentation/FreeRTOS-documentation-and-book.html\r
- * for an introductory guide to using real time kernels, and FreeRTOS in \r
- * particular. \r
+ * for an introductory guide to using real time kernels, and FreeRTOS in\r
+ * particular.\r
*\r
*****\r
- * \r
+ *\r
* The DICE-KIT-16FX has two 7 segment displays and two buttons that can\r
* generate interrupts. This example uses this IO as follows:\r
*\r
*\r
- * - Left 7 segment display - \r
+ * - Left 7 segment display -\r
*\r
- * 7 'flash' tasks are created, each of which toggles a single segment of the \r
- * left display. Each task executes at a fixed frequency, with a different \r
+ * 7 'flash' tasks are created, each of which toggles a single segment of the\r
+ * left display. Each task executes at a fixed frequency, with a different\r
* frequency being used by each task.\r
*\r
* When button SW2 is pressed an interrupt is generated that wakes up a 'dice'\r
* task. The dice task suspends the 7 tasks that are accessing the left display\r
* before simulating a dice being thrown by generating a random number between\r
* 1 and 6. After the number has been generated the task sleeps for 5 seconds,\r
- * if SW2 is pressed again within the 5 seconds another random number is \r
+ * if SW2 is pressed again within the 5 seconds another random number is\r
* generated, if SW2 is not pressed within the 5 seconds then the 7 tasks are\r
* un-suspended and will once again toggle the segments of the left hand display.\r
*\r
* Only one dice task is actually defined. Two instances of this single\r
* definition are created, the first to simulate a dice being thrown on the left\r
* display, and the other to simulate a dice being thrown on the right display.\r
- * The task parameter is used to let the dice tasks know which display to \r
+ * The task parameter is used to let the dice tasks know which display to\r
* control.\r
*\r
* Both dice tasks and the flash tasks operate completely independently under\r
* the control of FreeRTOS. 11 tasks and 7 co-routines are created in total,\r
- * including the idle task. \r
+ * including the idle task.\r
*\r
* The co-routines all execute within a single low priority task.\r
*\r
vCreateFlashTasksAndCoRoutines();\r
\r
/* Create a 'dice' task to control the left hand display. */\r
- xTaskCreate( vDiceTask, ( signed char * ) "Dice1", configMINIMAL_STACK_SIZE, ( void * ) configLEFT_DISPLAY, mainDICE_PRIORITY, NULL );\r
+ xTaskCreate( vDiceTask, "Dice1", configMINIMAL_STACK_SIZE, ( void * ) configLEFT_DISPLAY, mainDICE_PRIORITY, NULL );\r
\r
/* Create a 'dice' task to control the right hand display. */\r
- xTaskCreate( vDiceTask, ( signed char * ) "Dice2", configMINIMAL_STACK_SIZE, ( void * ) configRIGHT_DISPLAY, mainDICE_PRIORITY, NULL );\r
+ xTaskCreate( vDiceTask, "Dice2", configMINIMAL_STACK_SIZE, ( void * ) configRIGHT_DISPLAY, mainDICE_PRIORITY, NULL );\r
\r
/* Start the scheduler running. */\r
vTaskStartScheduler();\r
scheduler has been started. */\r
InitIrqLevels();\r
portDISABLE_INTERRUPTS();\r
- __set_il( 7 ); \r
+ __set_il( 7 );\r
\r
/* Set Port3 as output (7Segment Display). */\r
DDR03 = 0xff;\r
\r
/* Enable external interrupt 8. */\r
PIER00_IE0 = 1;\r
- \r
+\r
/* LB0, LA0 = 11 -> falling edge. */\r
ELVRL1_LB8 = 1;\r
ELVRL1_LA8 = 1;\r
\r
/* Enable external interrupt 9. */\r
PIER00_IE1 = 1;\r
- \r
+\r
/* LB1, LA1 = 11 -> falling edge. */\r
ELVRL1_LB9 = 1;\r
ELVRL1_LA9 = 1;\r
\r
/* Reset and enable the interrupt request. */\r
EIRR1_ER9 = 0;\r
- ENIR1_EN9 = 1; \r
+ ENIR1_EN9 = 1;\r
}\r
\r
Please ensure to read the configuration and relevant port sections of the\r
online documentation.\r
\r
- http://www.FreeRTOS.org - Documentation, latest information, license and \r
+ http://www.FreeRTOS.org - Documentation, latest information, license and\r
contact details.\r
\r
- http://www.SafeRTOS.com - A version that is certified for use in safety \r
+ http://www.SafeRTOS.com - A version that is certified for use in safety\r
critical systems.\r
\r
- http://www.OpenRTOS.com - Commercial support, development, porting, \r
+ http://www.OpenRTOS.com - Commercial support, development, porting,\r
licensing and training services.\r
*/\r
\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
\r
/* Start the check task - which is defined in this file. */\r
- xTaskCreate( vErrorChecks, ( signed char * )"Check", 512, NULL,\r
+ xTaskCreate( vErrorChecks, "Check", 512, NULL,\r
mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Now all the tasks have been started - start the scheduler. */\r
xCreatedTask = mainNO_TASK;\r
\r
if( xTaskCreate\r
- ( vMemCheckTask, ( signed char * )"MEM_CHECK",\r
+ ( vMemCheckTask, "MEM_CHECK",\r
configMINIMAL_STACK_SIZE, ( void * )&ulMemCheckTaskRunningCount,\r
tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
{\r
\r
/* Create the LCD, button poll and register test tasks, as described at\r
the top of this file. */\r
- xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvButtonPollTask, ( signed char * ) "BPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
+ xTaskCreate( prvLCDTask, "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvButtonPollTask, "BPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
\r
/* Create the 'check' timer - the timer that periodically calls the\r
check function as described at the top of this file. Note that, for\r
the reasons stated in the comments above the call to \r
vStartTimerDemoTask(), that the check timer is not actually started \r
until after the scheduler has been started. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "Check timer", mainCHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback ); \r
+ xCheckTimer = xTimerCreate( "Check timer", mainCHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback ); \r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/*-----------------------------------------------------------*/\r
\r
-/* The linker script can be used to test the FreeRTOS ports use of 20bit \r
-addresses by locating all code in high memory. The following pragma ensures \r
-that main remains in low memory when that is done. The ISR_CODE segment is used \r
+/* The linker script can be used to test the FreeRTOS ports use of 20bit\r
+addresses by locating all code in high memory. The following pragma ensures\r
+that main remains in low memory when that is done. The ISR_CODE segment is used\r
for convenience as ISR functions are always placed in low memory. */\r
#pragma location="ISR_CODE"\r
void main( void )\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
vStartDynamicPriorityTasks();\r
vStartGenericQueueTasks( mainGENERIC_QUEUE_TEST_PRIORITY );\r
- \r
+\r
/* Create the LCD, button poll and register test tasks, as described at\r
the top of this file. */\r
- xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvButtonPollTask, ( signed char * ) "BPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
+ xTaskCreate( prvLCDTask, "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvButtonPollTask, "BPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
}\r
- \r
+\r
/* If all is well then this line will never be reached. If it is reached\r
then it is likely that there was insufficient (FreeRTOS) heap memory space\r
to create the idle task. This may have been trapped by the malloc() failed\r
- hook function, if one is configured. */ \r
+ hook function, if one is configured. */\r
for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
/* This function is the only function that uses printf(). If printf() is\r
used from any other function then some sort of mutual exclusion on stdout\r
will be necessary.\r
- \r
+\r
This is also the only function that is permitted to access the LCD.\r
- \r
+\r
First print out the number of bytes that remain in the FreeRTOS heap. This\r
can be viewed in the terminal IO window within the IAR Embedded Workbench. */\r
printf( "%d bytes of heap space remain unallocated\n", ( int ) xPortGetFreeHeapSize() );\r
- \r
+\r
/* Just as a test of the port, and for no functional reason, check the task\r
parameter contains its expected value. */\r
if( pvParameters != mainTASK_PARAMETER_CHECK_VALUE )\r
{\r
halLcdPrintLine( "Invalid parameter", ucLine, OVERWRITE_TEXT );\r
- ucLine++; \r
+ ucLine++;\r
}\r
\r
for( ;; )\r
halLcdClearScreen();\r
ucLine = 0;\r
}\r
- \r
+\r
/* What is this message? What does it contain? */\r
switch( xReceivedMessage.cMessageID )\r
{\r
the terminal IO window in the IAR\r
embedded workbench. */\r
printf( "\nTask\t Abs Time\t %%Time\n*****************************************" );\r
- vTaskGetRunTimeStats( ( signed char * ) cBuffer );\r
+ vTaskGetRunTimeStats( cBuffer );\r
printf( cBuffer );\r
- \r
+\r
/* Also print out a message to\r
the LCD - in this case the\r
pointer to the string to print\r
technique. */\r
sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.ulMessageValue );\r
break;\r
- \r
+\r
case mainMESSAGE_STATUS : /* The tick interrupt hook\r
function has just informed this\r
task of the system status.\r
with the status value. */\r
prvGenerateStatusMessage( cBuffer, xReceivedMessage.ulMessageValue );\r
break;\r
- \r
+\r
default : sprintf( cBuffer, "Unknown message" );\r
break;\r
}\r
- \r
+\r
/* Output the message that was placed into the cBuffer array within the\r
switch statement above, then move onto the next line ready for the next\r
message to arrive on the queue. */\r
{\r
/* Check the button state. */\r
ucState = ( halButtonsPressed() & BUTTON_UP );\r
- \r
+\r
if( ucState != 0 )\r
{\r
/* The button was pressed. */\r
ucState = pdTRUE;\r
}\r
- \r
+\r
if( ucState != ucLastState )\r
{\r
/* The state has changed, send a message to the LCD task. */\r
ucLastState = ucState;\r
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );\r
}\r
- \r
+\r
/* Block for 10 milliseconds so this task does not utilise all the CPU\r
time and debouncing of the button is not necessary. */\r
vTaskDelay( 10 / portTICK_RATE_MS );\r
halLcdInit();\r
halLcdSetContrast( 100 );\r
halLcdClearScreen();\r
- \r
+\r
halLcdPrintLine( " www.FreeRTOS.org", 0, OVERWRITE_TEXT );\r
}\r
/*-----------------------------------------------------------*/\r
{\r
xStatusMessage.ulMessageValue = mainERROR_DYNAMIC_TASKS;\r
}\r
- \r
+\r
if( xAreGenericQueueTasksStillRunning() != pdPASS )\r
{\r
xStatusMessage.ulMessageValue = mainERROR_GEN_QUEUE_TEST;\r
- } \r
+ }\r
\r
/* Check the reg test tasks are still cycling. They will stop\r
incrementing their loop counters if they encounter an error. */\r
\r
usLastRegTest1Counter = usRegTest1Counter;\r
usLastRegTest2Counter = usRegTest2Counter;\r
- \r
+\r
/* As this is the tick hook the lHigherPriorityTaskWoken parameter is not\r
needed (a context switch is going to be performed anyway), but it must\r
still be provided. */\r
xQueueSendFromISR( xLCDQueue, &xMessage, &xHigherPriorityTaskWoken );\r
\r
P2IFG = 0;\r
- \r
+\r
/* If writing to xLCDQueue caused a task to unblock, and the unblocked task\r
has a priority equal to or above the task that this interrupt interrupted,\r
then lHigherPriorityTaskWoken will have been set to pdTRUE internally within\r
{\r
( void ) pxTask;\r
( void ) pcTaskName;\r
- \r
+\r
/* Run time stack overflow checking is performed if\r
configconfigCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook\r
function is called if a stack overflow is detected. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer */\r
- xExampleSoftwareTimer = xTimerCreate( ( const signed char * ) "SoftwareTimer", /* A text name, purely to help debugging. */\r
- ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- vSoftwareTimerCallback /* The callback function that switches the LED off. */\r
+ xExampleSoftwareTimer = xTimerCreate( "SoftwareTimer", /* A text name, purely to help debugging. */\r
+ ( 5000 / portTICK_RATE_MS ),/* The timer period, in this case 5000ms (5s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ vSoftwareTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Start the software timer. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
#define LWIP_PORT_INIT_NETMASK(addr) IP4_ADDR((addr), configNET_MASK0,configNET_MASK1,configNET_MASK2,configNET_MASK3)\r
#define LWIP_MAC_ADDR_BASE { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 }\r
\r
-/* Definitions of the various SSI callback functions within the pccSSITags \r
+/* Definitions of the various SSI callback functions within the pccSSITags\r
array. If pccSSITags is updated, then these definitions must also be updated. */\r
#define ssiTASK_STATS_INDEX 0\r
#define ssiRUN_TIME_STATS_INDEX 1\r
/*-----------------------------------------------------------*/\r
\r
/* The SSI strings that are embedded in the served html files. If this array\r
-is changed, then the index position defined by the #defines such as \r
+is changed, then the index position defined by the #defines such as\r
ssiTASK_STATS_INDEX above must also be updated. */\r
-static const char *pccSSITags[] = \r
+static const char *pccSSITags[] =\r
{\r
"rtos_stats",\r
"run_stats"\r
\r
/* The SSI handler function that generates text depending on the index of\r
the SSI tag encountered. */\r
- \r
+\r
switch( iIndex )\r
{\r
case ssiTASK_STATS_INDEX :\r
- vTaskList( ( signed char * ) pcBuffer );\r
+ vTaskList( pcBuffer );\r
break;\r
\r
case ssiRUN_TIME_STATS_INDEX :\r
- vTaskGetRunTimeStats( ( signed char * ) pcBuffer );\r
+ vTaskGetRunTimeStats( pcBuffer );\r
break;\r
}\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* one queue, and one timer. It also demonstrates how MicroBlaze interrupts\r
* can interact with FreeRTOS tasks/timers.\r
*\r
- * This simple demo project was developed and tested on the Spartan-6 SP605 \r
+ * This simple demo project was developed and tested on the Spartan-6 SP605\r
* development board, using the hardware configuration found in the hardware\r
* project that is already included in the Eclipse project.\r
*\r
* in this file. prvQueueReceiveTask() sits in a loop that causes it to\r
* repeatedly attempt to read data from the queue that was created within\r
* main(). When data is received, the task checks the value of the data, and\r
- * if the value equals the expected 100, toggles an LED. The 'block time' \r
+ * if the value equals the expected 100, toggles an LED. The 'block time'\r
* parameter passed to the queue receive function specifies that the task\r
* should be held in the Blocked state indefinitely to wait for data to be\r
* available on the queue. The queue receive task will only leave the Blocked\r
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_RATE_MS )\r
\r
/* The number of items the queue can hold. This is 1 as the receive task\r
-will remove items as they are added because it has the higher priority, meaning \r
+will remove items as they are added because it has the higher priority, meaning\r
the send task should always find the queue empty. */\r
#define mainQUEUE_LENGTH ( 1 )\r
\r
*/\r
static void vLEDTimerCallback( xTimerHandle xTimer );\r
\r
-/* \r
+/*\r
* The handler executed each time a button interrupt is generated. This ensures\r
* the LED defined by mainTIMER_CONTROLLED_LED is on, and resets the timer so\r
* the timer will not turn the LED off for a full 5 seconds after the button\r
int main( void )\r
{\r
/* *************************************************************************\r
- This is a very simple project suitable for getting started with FreeRTOS. \r
- If you would prefer a more complex project that demonstrates a lot more \r
- features and tests, then select the 'Full' build configuration within the \r
- SDK Eclipse IDE. \r
+ This is a very simple project suitable for getting started with FreeRTOS.\r
+ If you would prefer a more complex project that demonstrates a lot more\r
+ features and tests, then select the 'Full' build configuration within the\r
+ SDK Eclipse IDE.\r
***************************************************************************/\r
\r
/* Configure the interrupt controller, LED outputs and button inputs. */\r
/* Sanity check that the queue was created. */\r
configASSERT( xQueue );\r
\r
- /* Start the two tasks as described in the comments at the top of this \r
+ /* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. The timer is not actually started until a button interrupt is\r
pushed, as it is not until that point that the LED is turned on. */\r
- xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */\r
- ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- vLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */\r
+ ( 5000 / portTICK_RATE_MS ),/* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ vLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Start the tasks and timer running. */\r
\r
if( xStatus == XST_SUCCESS )\r
{\r
- /* Install the handler defined in this task for the button input. \r
+ /* Install the handler defined in this task for the button input.\r
*NOTE* The FreeRTOS defined xPortInstallInterruptHandler() API function\r
must be used for this purpose. */\r
xStatus = xPortInstallInterruptHandler( XPAR_MICROBLAZE_0_INTC_PUSH_BUTTONS_4BITS_IP2INTC_IRPT_INTR, prvButtonInputInterruptHandler, NULL );\r
{\r
/* Set buttons to input. */\r
XGpio_SetDataDirection( &xInputGPIOInstance, ulGPIOInputChannel, ~( ucSetToOutput ) );\r
- \r
+\r
/* Enable the button input interrupts in the interrupt controller.\r
*NOTE* The vPortEnableInterrupt() API function must be used for this\r
purpose. */\r
{\r
/* vApplicationMallocFailedHook() will only be called if\r
configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook\r
- function that will get called if a call to pvPortMalloc() fails. \r
+ function that will get called if a call to pvPortMalloc() fails.\r
pvPortMalloc() is called internally by the kernel whenever a task, queue or\r
semaphore is created. It is also called by various parts of the demo\r
application. If heap_1.c or heap_2.c are used, then the size of the heap\r
\r
/* vApplicationStackOverflowHook() will only be called if\r
configCHECK_FOR_STACK_OVERFLOW is set to either 1 or 2. The handle and name\r
- of the offending task will be passed into the hook function via its \r
+ of the offending task will be passed into the hook function via its\r
parameters. However, when a stack has overflowed, it is possible that the\r
parameters will have been corrupted, in which case the pxCurrentTCB variable\r
can be inspected directly. */\r
which will have the same timer peripherals defined or available. This example\r
uses the AXI Timer 0. If that is available on your hardware platform then this\r
example callback implementation should not require modification. The name of\r
-the interrupt handler that should be installed is vPortTickISR(), which the \r
+the interrupt handler that should be installed is vPortTickISR(), which the\r
function below declares as an extern. */\r
void vApplicationSetupTimerInterrupt( void )\r
{\r
\r
if( xStatus == XST_SUCCESS )\r
{\r
- /* Install the tick interrupt handler as the timer ISR. \r
+ /* Install the tick interrupt handler as the timer ISR.\r
*NOTE* The xPortInstallInterruptHandler() API function must be used for\r
this purpose. */\r
xStatus = xPortInstallInterruptHandler( XPAR_INTC_0_TMRCTR_0_VEC_ID, vPortTickISR, NULL );\r
\r
/* This is an application defined callback function used to clear whichever\r
interrupt was installed by the the vApplicationSetupTimerInterrupt() callback\r
-function - in this case the interrupt generated by the AXI timer. It is \r
-provided as an application callback because the kernel will run on lots of \r
-different MicroBlaze and FPGA configurations - not all of which will have the \r
-same timer peripherals defined or available. This example uses the AXI Timer 0. \r
-If that is available on your hardware platform then this example callback \r
+function - in this case the interrupt generated by the AXI timer. It is\r
+provided as an application callback because the kernel will run on lots of\r
+different MicroBlaze and FPGA configurations - not all of which will have the\r
+same timer peripherals defined or available. This example uses the AXI Timer 0.\r
+If that is available on your hardware platform then this example callback\r
implementation should not require modification provided the example definition\r
of vApplicationSetupTimerInterrupt() is also not modified. */\r
void vApplicationClearTimerInterrupt( void )\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* main-blinky.c is included when the "Blinky" build configuration is used.\r
* main-full.c is included when the "Full" build configuration is used.\r
*\r
- * main-full.c creates a lot of demo and test tasks and timers, and is \r
- * therefore very comprehensive but also complex. If you would prefer a much \r
- * simpler project to get started with, then select the 'Blinky' build \r
+ * main-full.c creates a lot of demo and test tasks and timers, and is\r
+ * therefore very comprehensive but also complex. If you would prefer a much\r
+ * simpler project to get started with, then select the 'Blinky' build\r
* configuration within the SDK Eclipse IDE. See the documentation page for\r
* this demo on the http://www.FreeRTOS.org web site for more information.\r
* ****************************************************************************\r
*\r
- * main() creates all the demo application tasks and timers, then starts the \r
- * scheduler. The web documentation provides more details of the standard demo \r
- * application tasks, which provide no particular functionality, but do provide \r
- * a good example of how to use the FreeRTOS API. \r
+ * main() creates all the demo application tasks and timers, then starts the\r
+ * scheduler. The web documentation provides more details of the standard demo\r
+ * application tasks, which provide no particular functionality, but do provide\r
+ * a good example of how to use the FreeRTOS API.\r
*\r
* In addition to the standard demo tasks, the following tasks and tests are\r
* defined and/or created within this file:\r
* http://www.FreeRTOS.org/Free-RTOS-for-Xilinx-MicroBlaze-on-Spartan-6-FPGA.html\r
* for details on setting up and using the embedded web server.\r
*\r
- * "Reg test" tasks - These test the task context switch mechanism by first \r
+ * "Reg test" tasks - These test the task context switch mechanism by first\r
* filling the MicroBlaze registers with known values, before checking that each\r
* register maintains the value that was written to it as the tasks are switched\r
* in and out. The two register test tasks do not use the same values, and\r
* execute at a very low priority, to ensure they are pre-empted regularly.\r
*\r
- * "Check" timer - The check timer period is initially set to five seconds. \r
+ * "Check" timer - The check timer period is initially set to five seconds.\r
* The check timer callback function checks that all the standard demo tasks,\r
* and the register check tasks, are not only still executing, but are executing\r
* without reporting any errors. If the check timer discovers that a task has\r
#define mainNO_ERROR_CHECK_TIMER_PERIOD ( 5000 / portTICK_RATE_MS )\r
\r
/* The rate at which mainCHECK_LED will toggle when an error has been reported\r
-by at least one task. See the description of the check timer in the comments at \r
+by at least one task. See the description of the check timer in the comments at\r
the top of this file. */\r
#define mainERROR_CHECK_TIMER_PERIOD ( 200 / portTICK_RATE_MS )\r
\r
available LEDs (LEDs 0 to 3) are already in use. */\r
#define mainCOM_TEST_LED ( 4 )\r
\r
-/* Baud rate used by the comtest tasks. The baud rate used is actually fixed in \r
-UARTLite IP when the hardware was built, but the standard serial init function \r
-required a baud rate parameter to be provided - in this case it is just \r
+/* Baud rate used by the comtest tasks. The baud rate used is actually fixed in\r
+UARTLite IP when the hardware was built, but the standard serial init function\r
+required a baud rate parameter to be provided - in this case it is just\r
ignored. */\r
#define mainCOM_TEST_BAUD_RATE ( XPAR_RS232_UART_1_BAUDRATE )\r
\r
-/* The timer test task generates a lot of timers that all use a different \r
+/* The timer test task generates a lot of timers that all use a different\r
period that is a multiple of the mainTIMER_TEST_PERIOD definition. */\r
#define mainTIMER_TEST_PERIOD ( 20 )\r
\r
extern void vRegisterTest2( void *pvParameters );\r
\r
/*\r
- * Defines the 'check' timer functionality as described at the top of this file. \r
+ * Defines the 'check' timer functionality as described at the top of this file.\r
* This function is the callback function associated with the 'check' timer.\r
*/\r
static void vCheckTimerCallback( xTimerHandle xTimer );\r
\r
-/* \r
- * Configure the interrupt controller, LED outputs and button inputs. \r
+/*\r
+ * Configure the interrupt controller, LED outputs and button inputs.\r
*/\r
static void prvSetupHardware( void );\r
\r
int main( void )\r
{\r
/***************************************************************************\r
- This project includes a lot of demo and test tasks and timers, and is \r
- therefore comprehensive, but complex. If you would prefer a much simpler \r
- project to get started with, then select the 'Blinky' build configuration \r
+ This project includes a lot of demo and test tasks and timers, and is\r
+ therefore comprehensive, but complex. If you would prefer a much simpler\r
+ project to get started with, then select the 'Blinky' build configuration\r
within the SDK Eclipse IDE.\r
***************************************************************************/\r
\r
\r
/* Start the reg test tasks, as described in the comments at the top of this\r
file. */\r
- xTaskCreate( vRegisterTest1, ( const signed char * const ) "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) 0, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( vRegisterTest2, ( const signed char * const ) "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) 0, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegisterTest1, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) 0, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vRegisterTest2, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) 0, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
- tasks were running prior to their creation. This then allows them to \r
- ascertain whether or not the correct/expected number of tasks are running at \r
+ tasks were running prior to their creation. This then allows them to\r
+ ascertain whether or not the correct/expected number of tasks are running at\r
any given time. */\r
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
\r
/* Create the 'check' timer - the timer that periodically calls the\r
- check function as described in the comments at the top of this file. Note \r
+ check function as described in the comments at the top of this file. Note\r
that, for reasons stated in the comments within vApplicationIdleHook()\r
- (defined in this file), the check timer is not actually started until after \r
+ (defined in this file), the check timer is not actually started until after\r
the scheduler has been started. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "Check timer", mainNO_ERROR_CHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback );\r
+ xCheckTimer = xTimerCreate( "Check timer", mainNO_ERROR_CHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback );\r
\r
- /* Start the scheduler running. From this point on, only tasks and \r
+ /* Start the scheduler running. From this point on, only tasks and\r
interrupts will be executing. */\r
vTaskStartScheduler();\r
\r
/* If all is well then the following line will never be reached. If\r
execution does reach here, then it is highly probably that the heap size\r
- is too small for the idle and/or timer tasks to be created within \r
+ is too small for the idle and/or timer tasks to be created within\r
vTaskStartScheduler(). */\r
taskDISABLE_INTERRUPTS();\r
for( ;; );\r
which will have the same timer peripherals defined or available. This example\r
uses the AXI Timer 0. If that is available on your hardware platform then this\r
example callback implementation should not require modification. The name of\r
-the interrupt handler that should be installed is vPortTickISR(), which the \r
+the interrupt handler that should be installed is vPortTickISR(), which the\r
function below declares as an extern. */\r
void vApplicationSetupTimerInterrupt( void )\r
{\r
\r
if( xStatus == XST_SUCCESS )\r
{\r
- /* Install the tick interrupt handler as the timer ISR. \r
+ /* Install the tick interrupt handler as the timer ISR.\r
*NOTE* The xPortInstallInterruptHandler() API function must be used for\r
this purpose. */\r
xStatus = xPortInstallInterruptHandler( XPAR_INTC_0_TMRCTR_0_VEC_ID, vPortTickISR, NULL );\r
\r
/* This is an application defined callback function used to clear whichever\r
interrupt was installed by the the vApplicationSetupTimerInterrupt() callback\r
-function - in this case the interrupt generated by the AXI timer. It is \r
-provided as an application callback because the kernel will run on lots of \r
-different MicroBlaze and FPGA configurations - not all of which will have the \r
-same timer peripherals defined or available. This example uses the AXI Timer 0. \r
-If that is available on your hardware platform then this example callback \r
+function - in this case the interrupt generated by the AXI timer. It is\r
+provided as an application callback because the kernel will run on lots of\r
+different MicroBlaze and FPGA configurations - not all of which will have the\r
+same timer peripherals defined or available. This example uses the AXI Timer 0.\r
+If that is available on your hardware platform then this example callback\r
implementation should not require modification provided the example definition\r
of vApplicationSetupTimerInterrupt() is also not modified. */\r
void vApplicationClearTimerInterrupt( void )\r
{\r
/* vApplicationMallocFailedHook() will only be called if\r
configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook\r
- function that will get called if a call to pvPortMalloc() fails. \r
+ function that will get called if a call to pvPortMalloc() fails.\r
pvPortMalloc() is called internally by the kernel whenever a task, queue or\r
semaphore is created. It is also called by various parts of the demo\r
application. If heap_1.c or heap_2.c are used, then the size of the heap\r
\r
/* vApplicationStackOverflowHook() will only be called if\r
configCHECK_FOR_STACK_OVERFLOW is set to either 1 or 2. The handle and name\r
- of the offending task will be passed into the hook function via its \r
+ of the offending task will be passed into the hook function via its\r
parameters. However, when a stack has overflowed, it is possible that the\r
parameters will have been corrupted, in which case the pxCurrentTCB variable\r
can be inspected directly. */\r
{\r
static long lCheckTimerStarted = pdFALSE;\r
\r
- /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set \r
- to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle \r
- task. It is essential that code added to this hook function never attempts \r
- to block in any way (for example, call xQueueReceive() with a block time \r
- specified, or call vTaskDelay()). If the application makes use of the \r
- vTaskDelete() API function (as this demo application does) then it is also \r
- important that vApplicationIdleHook() is permitted to return to its calling \r
- function, because it is the responsibility of the idle task to clean up \r
+ /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set\r
+ to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle\r
+ task. It is essential that code added to this hook function never attempts\r
+ to block in any way (for example, call xQueueReceive() with a block time\r
+ specified, or call vTaskDelay()). If the application makes use of the\r
+ vTaskDelete() API function (as this demo application does) then it is also\r
+ important that vApplicationIdleHook() is permitted to return to its calling\r
+ function, because it is the responsibility of the idle task to clean up\r
memory allocated by the kernel to any task that has since been deleted. */\r
\r
/* If the check timer has not already been started, then start it now.\r
queue will have been drained. */\r
if( lCheckTimerStarted == pdFALSE )\r
{\r
- xTimerStart( xCheckTimer, mainDONT_BLOCK ); \r
+ xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
lCheckTimerStarted = pdTRUE;\r
}\r
}\r
{\r
( void ) xRegisterDump;\r
\r
- /* If configINSTALL_EXCEPTION_HANDLERS is set to 1 in FreeRTOSConfig.h, then \r
- the kernel will automatically install its own exception handlers before the \r
- kernel is started, if the application writer has not already caused them to \r
- be installed by calling either of the vPortExceptionsInstallHandlers() \r
- or xPortInstallInterruptHandler() API functions before that time. The \r
+ /* If configINSTALL_EXCEPTION_HANDLERS is set to 1 in FreeRTOSConfig.h, then\r
+ the kernel will automatically install its own exception handlers before the\r
+ kernel is started, if the application writer has not already caused them to\r
+ be installed by calling either of the vPortExceptionsInstallHandlers()\r
+ or xPortInstallInterruptHandler() API functions before that time. The\r
kernels exception handler populates an xPortRegisterDump structure with\r
the processor state at the point that the exception was triggered - and also\r
includes a strings that say what the exception cause was and which task was\r
static void prvSetupHardware( void )\r
{\r
taskDISABLE_INTERRUPTS();\r
- \r
+\r
/* Configure the LED outputs. */\r
vParTestInitialise();\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the first. This enables the \r
- * demo's to be executed on the RAM limited 40 pin devices. The 64 and 80 pin \r
- * devices require a more costly development platform and are not so readily \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the first. This enables the\r
+ * demo's to be executed on the RAM limited 40 pin devices. The 64 and 80 pin\r
+ * devices require a more costly development platform and are not so readily\r
* available.\r
*\r
- * The RTOSDemo1 project is configured for a PIC18F452 device. Main1.c starts 5 \r
+ * The RTOSDemo1 project is configured for a PIC18F452 device. Main1.c starts 5\r
* tasks (including the idle task).\r
*\r
- * The first task runs at the idle priority. It repeatedly performs a 32bit \r
- * calculation and checks it's result against the expected value. This checks \r
- * that the temporary storage utilised by the compiler to hold intermediate \r
- * results does not get corrupted when the task gets switched in and out. See \r
+ * The first task runs at the idle priority. It repeatedly performs a 32bit\r
+ * calculation and checks it's result against the expected value. This checks\r
+ * that the temporary storage utilised by the compiler to hold intermediate\r
+ * results does not get corrupted when the task gets switched in and out. See\r
* demo/common/minimal/integer.c for more information.\r
*\r
- * The second and third tasks pass an incrementing value between each other on \r
+ * The second and third tasks pass an incrementing value between each other on\r
* a message queue. See demo/common/minimal/PollQ.c for more information.\r
*\r
- * Main1.c also creates a check task. This periodically checks that all the \r
- * other tasks are still running and have not experienced any unexpected \r
- * results. If all the other tasks are executing correctly an LED is flashed \r
- * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not \r
- * executed, or report and error, the frequency of the LED flash will increase \r
+ * Main1.c also creates a check task. This periodically checks that all the\r
+ * other tasks are still running and have not experienced any unexpected\r
+ * results. If all the other tasks are executing correctly an LED is flashed\r
+ * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not\r
+ * executed, or report and error, the frequency of the LED flash will increase\r
* to mainERROR_FLASH_RATE.\r
*\r
* On entry to main an 'X' is transmitted. Monitoring the serial port using a\r
- * dumb terminal allows for verification that the device is not continuously \r
+ * dumb terminal allows for verification that the device is not continuously\r
* being reset (no more than one 'X' should be transmitted).\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* PIC18F port.\r
*/\r
\r
/* The LED that is flashed by the check task. */\r
#define mainCHECK_TASK_LED ( 0 )\r
\r
-/* Constants required for the communications. Only one character is ever \r
+/* Constants required for the communications. Only one character is ever\r
transmitted. */\r
#define mainCOMMS_QUEUE_LENGTH ( 5 )\r
#define mainNO_BLOCK ( ( portTickType ) 0 )\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const char * const ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. Will never return here. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the second. This enables the \r
- * demo's to be executed on the RAM limited 40 pin devices. The 64 and 80 pin \r
- * devices require a more costly development platform and are not so readily \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the second. This enables the\r
+ * demo's to be executed on the RAM limited 40 pin devices. The 64 and 80 pin\r
+ * devices require a more costly development platform and are not so readily\r
* available.\r
*\r
- * The RTOSDemo2 project is configured for a PIC18F452 device. Main2.c starts \r
+ * The RTOSDemo2 project is configured for a PIC18F452 device. Main2.c starts\r
* 5 tasks (including the idle task).\r
- * \r
+ *\r
* The first, second and third tasks do nothing but flash an LED. This gives\r
* visual feedback that everything is executing as expected. One task flashes\r
* an LED every 333ms (i.e. on and off every 333/2 ms), then next every 666ms\r
* and the last every 999ms.\r
*\r
- * The last task runs at the idle priority. It repeatedly performs a 32bit \r
- * calculation and checks it's result against the expected value. This checks \r
- * that the temporary storage utilised by the compiler to hold intermediate \r
+ * The last task runs at the idle priority. It repeatedly performs a 32bit\r
+ * calculation and checks it's result against the expected value. This checks\r
+ * that the temporary storage utilised by the compiler to hold intermediate\r
* results does not get corrupted when the task gets switched in and out.\r
* should the calculation ever provide an incorrect result the final LED is\r
* turned on.\r
*\r
* On entry to main() an 'X' is transmitted. Monitoring the serial port using a\r
- * dumb terminal allows for verification that the device is not continuously \r
+ * dumb terminal allows for verification that the device is not continuously\r
* being reset (no more than one 'X' should be transmitted).\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* PIC18F port.\r
*/\r
\r
/* The LED that is lit when should the calculation fail. */\r
#define mainCHECK_TASK_LED ( ( unsigned portBASE_TYPE ) 3 )\r
\r
-/* Constants required for the communications. Only one character is ever \r
+/* Constants required for the communications. Only one character is ever\r
transmitted. */\r
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned portBASE_TYPE ) 5 )\r
#define mainNO_BLOCK ( ( portTickType ) 0 )\r
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vCalculationTask, ( const char * const ) "Check", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vCalculationTask, "Check", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* THIS DEMO APPLICATION REQUIRES A LOOPBACK CONNECTOR TO BE FITTED TO THE PIC\r
* USART PORT - connect pin 2 to pin 3 on J2.\r
*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the third. This enables the \r
- * demo's to be executed on the RAM limited 40 pin devices. The 64 and 80 pin \r
- * devices require a more costly development platform and are not so readily \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the third. This enables the\r
+ * demo's to be executed on the RAM limited 40 pin devices. The 64 and 80 pin\r
+ * devices require a more costly development platform and are not so readily\r
* available.\r
*\r
* The RTOSDemo3 project is configured for a PIC18F452 device. Main3.c starts\r
* 5 tasks (including the idle task).\r
- * \r
+ *\r
* The first task repeatedly transmits a string of characters on the PIC USART\r
* port. The second task receives the characters, checking that the correct\r
- * sequence is maintained (i.e. what is transmitted is identical to that \r
- * received). Each transmitted and each received character causes an LED to \r
+ * sequence is maintained (i.e. what is transmitted is identical to that\r
+ * received). Each transmitted and each received character causes an LED to\r
* flash. See demo/common/minimal/comtest. c for more information.\r
*\r
* The third task continuously performs a 32 bit calculation. This is a good\r
- * test of the context switch mechanism as the 8 bit architecture requires \r
+ * test of the context switch mechanism as the 8 bit architecture requires\r
* the use of several file registers to perform the 32 bit operations. See\r
* demo/common/minimal/integer. c for more information.\r
*\r
* The third task is the check task. This periodically checks that the other\r
* tasks are still running and have not experienced any errors. If no errors\r
* have been reported by either the comms or integer tasks an LED is flashed\r
- * with a frequency mainNO_ERROR_CHECK_PERIOD. If an error is discovered the \r
+ * with a frequency mainNO_ERROR_CHECK_PERIOD. If an error is discovered the\r
* frequency is increased to mainERROR_FLASH_RATE.\r
*\r
* The check task also provides a visual indication of a system reset by\r
- * flashing the one remaining LED (mainRESET_LED) when it starts. After \r
+ * flashing the one remaining LED (mainRESET_LED) when it starts. After\r
* this initial flash mainRESET_LED should remain off.\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* PIC18F port.\r
*/\r
\r
mainCOMM_TX_RX_LED + 1 will be toggled every time a character is received. */\r
#define mainCOMM_TX_RX_LED ( ( unsigned portBASE_TYPE ) 2 )\r
\r
-/* The LED that is flashed by the check task at a rate that indicates the \r
+/* The LED that is flashed by the check task at a rate that indicates the\r
error status. */\r
#define mainCHECK_TASK_LED ( ( unsigned portBASE_TYPE ) 1 )\r
\r
#define mainBAUD_RATE ( ( unsigned long ) 57600 )\r
/*-----------------------------------------------------------*/\r
\r
-/* \r
+/*\r
* Task function which periodically checks the other tasks for errors. Flashes\r
- * an LED at a rate that indicates whether an error has ever been detected. \r
+ * an LED at a rate that indicates whether an error has ever been detected.\r
*/\r
static void vErrorChecks( void *pvParameters );\r
\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const char * const ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. This will never return. */\r
vTaskStartScheduler();\r
xDelayTime = mainERROR_CHECK_PERIOD;\r
}\r
\r
- /* Flash the LED for visual feedback. The rate of the flash will \r
+ /* Flash the LED for visual feedback. The rate of the flash will\r
indicate the health of the system. */\r
vParTestToggleLED( mainCHECK_TASK_LED );\r
}\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the second. This enables the \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the second. This enables the\r
* demo's to be executed on the RAM limited PIC-devices.\r
*\r
- * The Demo2 project is configured for a PIC18F4620 device. Main.c starts 12 \r
+ * The Demo2 project is configured for a PIC18F4620 device. Main.c starts 12\r
* tasks (including the idle task). See the indicated files in the demo/common\r
* directory for more information.\r
*\r
* demo/common/minimal/semtest.c: Creates 4 tasks\r
* demo/common/minimal/flash.c: Creates 3 tasks\r
*\r
- * Main.c also creates a check task. This periodically checks that all the \r
- * other tasks are still running and have not experienced any unexpected \r
- * results. If all the other tasks are executing correctly an LED is flashed \r
- * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not \r
- * executed, or report an error, the frequency of the LED flash will increase \r
+ * Main.c also creates a check task. This periodically checks that all the\r
+ * other tasks are still running and have not experienced any unexpected\r
+ * results. If all the other tasks are executing correctly an LED is flashed\r
+ * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not\r
+ * executed, or report an error, the frequency of the LED flash will increase\r
* to mainERROR_FLASH_RATE.\r
*\r
* On entry to main an 'X' is transmitted. Monitoring the serial port using a\r
- * dumb terminal allows for verification that the device is not continuously \r
+ * dumb terminal allows for verification that the device is not continuously\r
* being reset (no more than one 'X' should be transmitted).\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* wizC PIC18F port.\r
*/\r
\r
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 )\r
#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 0 )\r
\r
-/* Constants required for the communications. Only one character is ever \r
+/* Constants required for the communications. Only one character is ever\r
transmitted. */\r
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 )\r
#define mainNO_BLOCK ( ( portTickType ) 0 )\r
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const char * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. Will never return here. */\r
vTaskStartScheduler();\r
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;\r
char cErrorOccurred;\r
\r
- /* We need to initialise xLastCheckTime prior to the first call to \r
+ /* We need to initialise xLastCheckTime prior to the first call to\r
vTaskDelayUntil(). */\r
xLastCheckTime = xTaskGetTickCount();\r
- \r
+\r
/* Cycle for ever, delaying then checking all the other tasks are still\r
operating without error. */\r
for( ;; )\r
{\r
/* Wait until it is time to check the other tasks again. */\r
vTaskDelayUntil( &xLastCheckTime, xDelayTime );\r
- \r
+\r
/* Check all the other tasks are running, and running without ever\r
having an error. */\r
cErrorOccurred = prvCheckOtherTasksAreStillRunning();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the third. This enables the \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the third. This enables the\r
* demo's to be executed on the RAM limited PIC-devices.\r
*\r
- * The Demo3 project is configured for a PIC18F4620 device. Main.c starts 12 \r
+ * The Demo3 project is configured for a PIC18F4620 device. Main.c starts 12\r
* tasks (including the idle task). See the indicated files in the demo/common\r
* directory for more information.\r
*\r
* demo/common/minimal/BlockQ.c: Creates 6 tasks\r
* demo/common/minimal/flash.c: Creates 3 tasks\r
*\r
- * Main.c also creates a check task. This periodically checks that all the \r
- * other tasks are still running and have not experienced any unexpected \r
- * results. If all the other tasks are executing correctly an LED is flashed \r
- * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not \r
- * executed, or report an error, the frequency of the LED flash will increase \r
+ * Main.c also creates a check task. This periodically checks that all the\r
+ * other tasks are still running and have not experienced any unexpected\r
+ * results. If all the other tasks are executing correctly an LED is flashed\r
+ * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not\r
+ * executed, or report an error, the frequency of the LED flash will increase\r
* to mainERROR_FLASH_RATE.\r
*\r
* On entry to main an 'X' is transmitted. Monitoring the serial port using a\r
- * dumb terminal allows for verification that the device is not continuously \r
+ * dumb terminal allows for verification that the device is not continuously\r
* being reset (no more than one 'X' should be transmitted).\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* wizC PIC18F port.\r
*/\r
\r
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 )\r
#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 0 )\r
\r
-/* Constants required for the communications. Only one character is ever \r
+/* Constants required for the communications. Only one character is ever\r
transmitted. */\r
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 )\r
#define mainNO_BLOCK ( ( portTickType ) 0 )\r
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const char * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. Will never return here. */\r
vTaskStartScheduler( );\r
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;\r
char cErrorOccurred;\r
\r
- /* We need to initialise xLastCheckTime prior to the first call to \r
+ /* We need to initialise xLastCheckTime prior to the first call to\r
vTaskDelayUntil(). */\r
xLastCheckTime = xTaskGetTickCount();\r
- \r
+\r
/* Cycle for ever, delaying then checking all the other tasks are still\r
operating without error. */\r
for( ;; )\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the fourth. This enables the \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the fourth. This enables the\r
* demo's to be executed on the RAM limited PIC-devices.\r
*\r
- * The Demo4 project is configured for a PIC18F4620 device. Main.c starts 11 \r
+ * The Demo4 project is configured for a PIC18F4620 device. Main.c starts 11\r
* tasks (including the idle task). See the indicated files in the demo/common\r
* directory for more information.\r
*\r
* demo/common/minimal/dynamic.c: Creates 5 tasks\r
* demo/common/minimal/flash.c: Creates 3 tasks\r
*\r
- * Main.c also creates a check task. This periodically checks that all the \r
- * other tasks are still running and have not experienced any unexpected \r
- * results. If all the other tasks are executing correctly an LED is flashed \r
- * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not \r
- * executed, or report an error, the frequency of the LED flash will increase \r
+ * Main.c also creates a check task. This periodically checks that all the\r
+ * other tasks are still running and have not experienced any unexpected\r
+ * results. If all the other tasks are executing correctly an LED is flashed\r
+ * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not\r
+ * executed, or report an error, the frequency of the LED flash will increase\r
* to mainERROR_FLASH_RATE.\r
*\r
* On entry to main an 'X' is transmitted. Monitoring the serial port using a\r
- * dumb terminal allows for verification that the device is not continuously \r
+ * dumb terminal allows for verification that the device is not continuously\r
* being reset (no more than one 'X' should be transmitted).\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* wizC PIC18F port.\r
*/\r
\r
#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 )\r
#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 0 )\r
\r
-/* Constants required for the communications. Only one character is ever \r
+/* Constants required for the communications. Only one character is ever\r
transmitted. */\r
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 )\r
#define mainNO_BLOCK ( ( portTickType ) 0 )\r
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const char * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. Will never return here. */\r
vTaskStartScheduler( );\r
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;\r
char cErrorOccurred;\r
\r
- /* We need to initialise xLastCheckTime prior to the first call to \r
+ /* We need to initialise xLastCheckTime prior to the first call to\r
vTaskDelayUntil(). */\r
xLastCheckTime = xTaskGetTickCount();\r
- \r
+\r
/* Cycle for ever, delaying then checking all the other tasks are still\r
operating without error. */\r
for( ;; )\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the fifth. This enables the \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the fifth. This enables the\r
* demo's to be executed on the RAM limited PIC-devices.\r
*\r
- * The Demo5 project is configured for a PIC18F4620 device. Main.c starts 13 \r
+ * The Demo5 project is configured for a PIC18F4620 device. Main.c starts 13\r
* tasks (including the idle task). See the indicated files in the demo/common\r
* directory for more information.\r
*\r
* demo/common/minimal/flop.c: Creates 8 tasks\r
* demo/common/minimal/flash.c: Creates 3 tasks\r
*\r
- * Main.c also creates a check task. This periodically checks that all the \r
- * other tasks are still running and have not experienced any unexpected \r
- * results. If all the other tasks are executing correctly an LED is flashed \r
- * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not \r
- * executed, or report an error, the frequency of the LED flash will increase \r
+ * Main.c also creates a check task. This periodically checks that all the\r
+ * other tasks are still running and have not experienced any unexpected\r
+ * results. If all the other tasks are executing correctly an LED is flashed\r
+ * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not\r
+ * executed, or report an error, the frequency of the LED flash will increase\r
* to mainERROR_FLASH_RATE.\r
*\r
* On entry to main an 'X' is transmitted. Monitoring the serial port using a\r
- * dumb terminal allows for verification that the device is not continuously \r
+ * dumb terminal allows for verification that the device is not continuously\r
* being reset (no more than one 'X' should be transmitted).\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* wizC PIC18F port.\r
*/\r
\r
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 )\r
#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 )\r
\r
-/* Constants required for the communications. Only one character is ever \r
+/* Constants required for the communications. Only one character is ever\r
transmitted. */\r
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 )\r
#define mainNO_BLOCK ( ( portTickType ) 0 )\r
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const char * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. Will never return here. */\r
vTaskStartScheduler();\r
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;\r
char cErrorOccurred;\r
\r
- /* We need to initialise xLastCheckTime prior to the first call to \r
+ /* We need to initialise xLastCheckTime prior to the first call to\r
vTaskDelayUntil(). */\r
xLastCheckTime = xTaskGetTickCount();\r
- \r
+\r
/* Cycle for ever, delaying then checking all the other tasks are still\r
operating without error. */\r
for( ;; )\r
{\r
/* Wait until it is time to check the other tasks again. */\r
vTaskDelayUntil( &xLastCheckTime, xDelayTime );\r
- \r
+\r
/* Check all the other tasks are running, and running without ever\r
having an error. */\r
cErrorOccurred = prvCheckOtherTasksAreStillRunning();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the sixth. This enables the \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the sixth. This enables the\r
* demo's to be executed on the RAM limited PIC-devices.\r
*\r
- * The Demo6 project is configured for a PIC18F4620 device. Main.c starts 4 \r
+ * The Demo6 project is configured for a PIC18F4620 device. Main.c starts 4\r
* tasks (including the idle task). See the indicated files in the demo/common\r
* directory for more information.\r
*\r
* demo/common/minimal/comtest.c: Creates 2 tasks\r
* ATTENTION: Comtest needs a loopback-connector on the serial port.\r
*\r
- * Main.c also creates a check task. This periodically checks that all the \r
- * other tasks are still running and have not experienced any unexpected \r
- * results. If all the other tasks are executing correctly an LED is flashed \r
- * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not \r
- * executed, or report an error, the frequency of the LED flash will increase \r
+ * Main.c also creates a check task. This periodically checks that all the\r
+ * other tasks are still running and have not experienced any unexpected\r
+ * results. If all the other tasks are executing correctly an LED is flashed\r
+ * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not\r
+ * executed, or report an error, the frequency of the LED flash will increase\r
* to mainERROR_FLASH_RATE.\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* wizC PIC18F port.\r
*/\r
\r
vAltStartComTestTasks( mainCOMM_TEST_PRIORITY, mainBAUD_RATE, mainCOMM_TX_RX_LED );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const char * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. Will never return here. */\r
vTaskStartScheduler();\r
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;\r
char cErrorOccurred;\r
\r
- /* We need to initialise xLastCheckTime prior to the first call to \r
+ /* We need to initialise xLastCheckTime prior to the first call to\r
vTaskDelayUntil(). */\r
xLastCheckTime = xTaskGetTickCount();\r
- \r
+\r
/* Cycle for ever, delaying then checking all the other tasks are still\r
operating without error. */\r
for( ;; )\r
{\r
/* Wait until it is time to check the other tasks again. */\r
vTaskDelayUntil( &xLastCheckTime, xDelayTime );\r
- \r
+\r
/* Check all the other tasks are running, and running without ever\r
having an error. */\r
cErrorOccurred = prvCheckOtherTasksAreStillRunning();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
\r
/*\r
- * Instead of the normal single demo application, the PIC18F demo is split \r
- * into several smaller programs of which this is the seventh. This enables the \r
+ * Instead of the normal single demo application, the PIC18F demo is split\r
+ * into several smaller programs of which this is the seventh. This enables the\r
* demo's to be executed on the RAM limited PIC-devices.\r
*\r
- * The Demo7 project is configured for a PIC18F4620 device. Main.c starts 10 \r
+ * The Demo7 project is configured for a PIC18F4620 device. Main.c starts 10\r
* tasks (including the idle task). See the indicated files in the demo/common\r
* directory for more information.\r
*\r
* demo/common/minimal/death.c: Creates 1 controltask and\r
* creates/deletes 4 suicidaltasks\r
*\r
- * Main.c also creates a check task. This periodically checks that all the \r
- * other tasks are still running and have not experienced any unexpected \r
- * results. If all the other tasks are executing correctly an LED is flashed \r
- * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not \r
- * executed, or report an error, the frequency of the LED flash will increase \r
+ * Main.c also creates a check task. This periodically checks that all the\r
+ * other tasks are still running and have not experienced any unexpected\r
+ * results. If all the other tasks are executing correctly an LED is flashed\r
+ * once every mainCHECK_PERIOD milliseconds. If any of the tasks have not\r
+ * executed, or report an error, the frequency of the LED flash will increase\r
* to mainERROR_FLASH_RATE.\r
*\r
* On entry to main an 'X' is transmitted. Monitoring the serial port using a\r
- * dumb terminal allows for verification that the device is not continuously \r
+ * dumb terminal allows for verification that the device is not continuously\r
* being reset (no more than one 'X' should be transmitted).\r
*\r
- * http://www.FreeRTOS.org contains important information on the use of the \r
+ * http://www.FreeRTOS.org contains important information on the use of the\r
* wizC PIC18F port.\r
*/\r
\r
#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 )\r
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 )\r
\r
-/* Constants required for the communications. Only one character is ever \r
+/* Constants required for the communications. Only one character is ever\r
transmitted. */\r
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 )\r
#define mainNO_BLOCK ( ( portTickType ) 0 )\r
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );\r
\r
/* Start the check task defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const char * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vErrorChecks, "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* This task has to be created last as it keeps account of the number of tasks\r
it expects to see running. */\r
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;\r
char cErrorOccurred;\r
\r
- /* We need to initialise xLastCheckTime prior to the first call to \r
+ /* We need to initialise xLastCheckTime prior to the first call to\r
vTaskDelayUntil(). */\r
xLastCheckTime = xTaskGetTickCount();\r
- \r
+\r
/* Cycle for ever, delaying then checking all the other tasks are still\r
operating without error. */\r
for( ;; )\r
{\r
/* Wait until it is time to check the other tasks again. */\r
vTaskDelayUntil( &xLastCheckTime, xDelayTime );\r
- \r
+\r
/* Check all the other tasks are running, and running without ever\r
having an error. */\r
cErrorOccurred = prvCheckOtherTasksAreStillRunning();\r
\r
/* Start the task that will write to the LCD. The LCD hardware is\r
initialised from within the task itself so delays can be used. */\r
- xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );\r
+ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );\r
\r
return xLCDQueue;\r
}\r
vCreateBlockTimeTasks();\r
\r
/* Create the test tasks defined within this file. */\r
- xTaskCreate( vCheckTask, ( signed char * ) "Check", mainCHECK_TAKS_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vCheckTask, "Check", mainCHECK_TAKS_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the task that will control the LCD. This returns the handle\r
to the queue used to write text out to the task. */\r
\r
/* Start the task that will write to the LCD. The LCD hardware is\r
initialised from within the task itself so delays can be used. */\r
- xTaskCreate( vLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );\r
+ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );\r
\r
return xLCDQueue;\r
}\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* required to configure the hardware, are defined in main.c.\r
******************************************************************************\r
*\r
- * main_blinky() creates one queue, two tasks, and one software timer. It then \r
+ * main_blinky() creates one queue, two tasks, and one software timer. It then\r
* starts the scheduler.\r
*\r
* The Blinky Software Timer:\r
* of this file.\r
*/\r
static void prvBlinkyTimerCallback( xTimerHandle xTimer );\r
- \r
+\r
/*\r
* Called by main() to create the simply blinky style application if\r
* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
/* Create the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Create the blinky software timer as described at the top of this\r
file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "Blinky", /* A text name, purely to help debugging. */\r
- ( mainBLINKY_TIMER_PERIOD ), /* The timer period. */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvBlinkyTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ xTimer = xTimerCreate( "Blinky", /* A text name, purely to help debugging. */\r
+ ( mainBLINKY_TIMER_PERIOD ),/* The timer period. */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvBlinkyTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ );\r
+\r
if( xTimer != NULL )\r
{\r
xTimerStart( xTimer, mainDONT_BLOCK );\r
}\r
- \r
+\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
}\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* required to configure the hardware, are defined in main.c.\r
******************************************************************************\r
*\r
- * main_full() creates all the demo application tasks and software timers, then \r
- * starts the scheduler. The WEB documentation provides more details of the \r
- * standard demo application tasks. In addition to the standard demo tasks, the \r
+ * main_full() creates all the demo application tasks and software timers, then\r
+ * starts the scheduler. The WEB documentation provides more details of the\r
+ * standard demo application tasks. In addition to the standard demo tasks, the\r
* following tasks and tests are defined and/or created within this file:\r
*\r
* "LCD" task - the LCD task is a 'gatekeeper' task. It is the only task that\r
* the check software timer discovers that a task has either stalled, or\r
* reported an error, then it changes its own execution period from the initial\r
* three seconds, to just 200ms. The check software timer callback function\r
- * also writes a status message to the LCD (via the LCD task). If all the demo \r
- * tasks are executing with their expected behaviour then the check task writes \r
+ * also writes a status message to the LCD (via the LCD task). If all the demo\r
+ * tasks are executing with their expected behaviour then the check task writes\r
* a count of the number of times the high frequency interrupt has incremented\r
* ulHighFrequencyTimerInterrupts - which is one in every 20,000 interrupts.\r
*\r
* "Register test" tasks - These tasks are used in part to test the kernel port.\r
- * They set each processor register to a known value, then check that the \r
+ * They set each processor register to a known value, then check that the\r
* register still contains that value. Each of the tasks sets the registers\r
- * to different values, and will get swapping in and out between setting and \r
+ * to different values, and will get swapping in and out between setting and\r
* then subsequently checking the register values. Discovery of an incorrect\r
* value would be indicative of an error in the task switching mechanism.\r
*\r
- * By way of demonstration, the demo application defines \r
- * configMAX_SYSCALL_INTERRUPT_PRIORITY to be 3, configKERNEL_INTERRUPT_PRIORITY \r
+ * By way of demonstration, the demo application defines\r
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY to be 3, configKERNEL_INTERRUPT_PRIORITY\r
* to be 1, and all other interrupts as follows:\r
*\r
- * + The UART is allocated a priority of 2. This means it can interrupt the \r
+ * + The UART is allocated a priority of 2. This means it can interrupt the\r
* RTOS tick, and can also safely use queues.\r
- * + Two timers are configured to generate interrupts just to test the nesting \r
- * and queue access mechanisms. These timers are allocated priorities 2 and 3 \r
- * respectively. Even though they both access the same two queues, the \r
- * priority 3 interrupt can safely interrupt the priority 2 interrupt. Both \r
+ * + Two timers are configured to generate interrupts just to test the nesting\r
+ * and queue access mechanisms. These timers are allocated priorities 2 and 3\r
+ * respectively. Even though they both access the same two queues, the\r
+ * priority 3 interrupt can safely interrupt the priority 2 interrupt. Both\r
* can interrupt the RTOS tick.\r
- * + Finally a high frequency timer interrupt is configured to use priority 4 - \r
- * therefore kernel activity will never prevent the high frequency timer from \r
- * executing immediately that the interrupt is raised (within the limitations \r
- * of the hardware itself). It would not be safe to access a queue from this \r
- * interrupt as it is above configMAX_SYSCALL_INTERRUPT_PRIORITY. \r
+ * + Finally a high frequency timer interrupt is configured to use priority 4 -\r
+ * therefore kernel activity will never prevent the high frequency timer from\r
+ * executing immediately that the interrupt is raised (within the limitations\r
+ * of the hardware itself). It would not be safe to access a queue from this\r
+ * interrupt as it is above configMAX_SYSCALL_INTERRUPT_PRIORITY.\r
*\r
* See the online documentation for this demo for more information on interrupt\r
* usage.\r
/* Misc. */\r
#define mainDONT_BLOCK ( 0 )\r
\r
-/* Dimension the buffer used to hold the value of the high frequency timer \r
+/* Dimension the buffer used to hold the value of the high frequency timer\r
count when it is converted to a string. */\r
#define mainMAX_STRING_LENGTH ( 20 )\r
\r
/* The frequency at which the "fast interrupt test" interrupt will occur. */\r
#define mainTEST_INTERRUPT_FREQUENCY ( 20000 )\r
\r
-/* The number of timer clocks expected to occur between each "fast interrupt \r
+/* The number of timer clocks expected to occur between each "fast interrupt\r
test" interrupt. */\r
#define mainEXPECTED_CLOCKS_BETWEEN_INTERRUPTS ( ( configCPU_CLOCK_HZ >> 1 ) / mainTEST_INTERRUPT_FREQUENCY )\r
\r
static void prvSetupHighFrequencyTimerTest( xTimerHandle xTimer );\r
\r
/*\r
- * Tasks that test the context switch mechanism by filling the processor \r
+ * Tasks that test the context switch mechanism by filling the processor\r
* registers with known values, then checking that the values contained\r
* within the registers is as expected. The tasks are likely to get swapped\r
* in and out between setting the register values and checking the register\r
- * values. \r
+ * values.\r
*/\r
static void prvRegTestTask1( void *pvParameters );\r
static void prvRegTestTask2( void *pvParameters );\r
/* The queue used to send messages to the LCD task. */\r
static xQueueHandle xLCDQueue;\r
\r
-/* Variables incremented by prvRegTestTask1() and prvRegTestTask2() respectively on \r
+/* Variables incremented by prvRegTestTask1() and prvRegTestTask2() respectively on\r
each iteration of their function. This is used to detect either task stopping\r
their execution.. */\r
volatile unsigned long ulRegTest1Cycles = 0, ulRegTest2Cycles = 0;\r
{\r
xTimerHandle xTimer = NULL;\r
\r
- /* Create the LCD task - this returns the queue to use when writing \r
+ /* Create the LCD task - this returns the queue to use when writing\r
messages to the LCD. */\r
xLCDQueue = xStartLCDTask();\r
\r
vStartInterruptQueueTasks();\r
\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( prvRegTestTask1, ( const signed char * const ) "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTestTask2, ( const signed char * const ) "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask1, "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
- /* The PIC32MX795 uses an 8 deep fifo where TX interrupts are asserted \r
- whilst the TX buffer is empty. This causes an issue with the test driver so \r
+ /* The PIC32MX795 uses an 8 deep fifo where TX interrupts are asserted\r
+ whilst the TX buffer is empty. This causes an issue with the test driver so\r
it is not used in this demo */\r
#if !defined(__32MX795F512L__)\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
- #endif \r
- \r
- /* Create the software timer that performs the 'check' functionality, as \r
+ #endif\r
+\r
+ /* Create the software timer that performs the 'check' functionality, as\r
described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
- ); \r
- \r
+ );\r
+\r
if( xTimer != NULL )\r
{\r
xTimerStart( xTimer, mainDONT_BLOCK );\r
}\r
- \r
+\r
/* A software timer is also used to start the high frequency timer test.\r
This is to ensure the test does not start before the kernel. This time a\r
one shot software timer is used. */\r
- xTimer = xTimerCreate( ( const signed char * ) "HighHzTimerSetup", 1, pdFALSE, ( void * ) 0, prvSetupHighFrequencyTimerTest );\r
+ xTimer = xTimerCreate( "HighHzTimerSetup", 1, pdFALSE, ( void * ) 0, prvSetupHighFrequencyTimerTest );\r
if( xTimer != NULL )\r
{\r
xTimerStart( xTimer, mainDONT_BLOCK );\r
}\r
ulLastRegTest1Value = ulRegTest1Cycles;\r
\r
- \r
+\r
/* Check that the register test 2 task is still running. */\r
if( ulLastRegTest2Value == ulRegTest2Cycles )\r
{\r
xMessage.pcMessage = "Error: Reg test3";\r
}\r
ulLastRegTest2Value = ulRegTest2Cycles;\r
- \r
\r
- /* Have any of the standard demo tasks detected an error in their \r
+\r
+ /* Have any of the standard demo tasks detected an error in their\r
operation? */\r
if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
{\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
+\r
/* This call to xTimerChangePeriod() uses a zero block time.\r
Functions called from inside of a timer callback function must\r
*never* attempt to block as to do so could impact other software\r
timers. */\r
xTimerChangePeriod( xTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );\r
- } \r
+ }\r
}\r
else\r
{\r
- /* Write the ulHighFrequencyTimerInterrupts value to the string \r
+ /* Write the ulHighFrequencyTimerInterrupts value to the string\r
buffer. It will only be displayed if no errors have been detected. */\r
sprintf( cStringBuffer, "Pass %u", ( unsigned int ) ulHighFrequencyTimerInterrupts );\r
}\r
\r
- /* Send the status message to the LCD task for display on the LCD. This is \r
+ /* Send the status message to the LCD task for display on the LCD. This is\r
a timer callback function, so the queue send function *must not* block. */\r
xQueueSend( xLCDQueue, &xMessage, mainDONT_BLOCK );\r
- vParTestToggleLED( mainCHECK_LED ); \r
+ vParTestToggleLED( mainCHECK_LED );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Setup the high frequency, high priority, timer test. It is setup in this\r
software timer callback to ensure it does not start before the kernel does.\r
This is a one shot timer - so the setup routine will only be executed once. */\r
- vSetupTimerTest( mainTEST_INTERRUPT_FREQUENCY ); \r
+ vSetupTimerTest( mainTEST_INTERRUPT_FREQUENCY );\r
}\r
\r
{\r
/* Create the task described at the top of this file. The timer is\r
configured by the task itself. */\r
- xTaskCreate( prvISRTriggeredTask, /* The function that implements the task. */\r
- ( const signed char * const ) "ISRt", /* Text name to help debugging - not used by the kernel. */\r
- configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task - defined in words, not bytes. */\r
- NULL, /* The parameter to pass into the task. Not used in this case. */\r
- configMAX_PRIORITIES - 1, /* The priority at which the task is created. */\r
- NULL ); /* Used to pass a handle to the created task out of the function. Not used in this case. */\r
+ xTaskCreate( prvISRTriggeredTask, /* The function that implements the task. */\r
+ "ISRt", /* Text name to help debugging - not used by the kernel. */\r
+ configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task - defined in words, not bytes. */\r
+ NULL, /* The parameter to pass into the task. Not used in this case. */\r
+ configMAX_PRIORITIES - 1, /* The priority at which the task is created. */\r
+ NULL ); /* Used to pass a handle to the created task out of the function. Not used in this case. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Create the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
\r
/* Create the blinky software timer as described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "Blinky",/* A text name, purely to help debugging. */\r
- ( mainBLINKY_TIMER_PERIOD ), /* The timer period. */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvBlinkyTimerCallback ); /* The callback function that inspects the status of all the other tasks. */\r
+ xTimer = xTimerCreate( "Blinky", /* A text name, purely to help debugging. */\r
+ ( mainBLINKY_TIMER_PERIOD ),/* The timer period. */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvBlinkyTimerCallback ); /* The callback function that inspects the status of all the other tasks. */\r
configASSERT( xTimer );\r
\r
if( xTimer != NULL )\r
vStartRecursiveMutexTasks();\r
\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( prvRegTestTask1, /* The function that implements the task. */\r
- ( const signed char * const ) "Reg1", /* Text name for the task to assist debugger - not used by FreeRTOS itself. */\r
- configMINIMAL_STACK_SIZE, /* The stack size to allocate for the task - specified in words not bytes. */\r
- NULL, /* The parameter to pass into the task - not used in this case so set to NULL. */\r
- tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
- NULL ); /* Used to obtain a handle to the task being created - not used in this case so set to NULL. */\r
+ xTaskCreate( prvRegTestTask1, /* The function that implements the task. */\r
+ "Reg1", /* Text name for the task to assist debugger - not used by FreeRTOS itself. */\r
+ configMINIMAL_STACK_SIZE, /* The stack size to allocate for the task - specified in words not bytes. */\r
+ NULL, /* The parameter to pass into the task - not used in this case so set to NULL. */\r
+ tskIDLE_PRIORITY, /* The priority to assign to the task. */\r
+ NULL ); /* Used to obtain a handle to the task being created - not used in this case so set to NULL. */\r
\r
- xTaskCreate( prvRegTestTask2, ( const signed char * const ) "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality, as\r
described at the top of this file. */\r
- xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
/* A software timer is also used to start the high frequency timer test.\r
This is to ensure the test does not start before the kernel. This time a\r
one shot software timer is used. */\r
- xTimer = xTimerCreate( ( const signed char * ) "HighHzTimerSetup", 1, pdFALSE, ( void * ) 0, prvSetupHighFrequencyTimerTest );\r
+ xTimer = xTimerCreate( "HighHzTimerSetup", 1, pdFALSE, ( void * ) 0, prvSetupHighFrequencyTimerTest );\r
if( xTimer != NULL )\r
{\r
xTimerStart( xTimer, mainDONT_BLOCK );\r
\r
\r
/* Create the first task. */\r
- xTaskCreate( vFlopTest1, ( signed portCHAR * ) "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest1, "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Do the same for the second task. */\r
- xTaskCreate( vFlopTest2, ( signed portCHAR * ) "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest2, "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
/* Create the first task - passing it the address of the check variable\r
that it is going to increment. This check variable is used as an \r
indication that the task is still running. */\r
- xTaskCreate( vCompetingMathTask1, ( signed portCHAR * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Create another 7 tasks, allocating a buffer for each. */\r
- xTaskCreate( vCompetingMathTask2, ( signed portCHAR * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed portCHAR * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 2 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed portCHAR * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 3 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask1, ( signed portCHAR * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 4 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask2, ( signed portCHAR * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 5 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed portCHAR * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 6 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed portCHAR * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 7 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
#endif\r
\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( prvRegTestTask1, ( signed portCHAR * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTestTask2, ( signed portCHAR * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask1, "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask2, "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be started last as they record the number of other\r
tasks that exist within the system. The value is then used to ensure at run\r
\r
\r
/* Create the first task. */\r
- xTaskCreate( vFlopTest1, ( signed portCHAR * ) "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest1, "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Do the same for the second task. */\r
- xTaskCreate( vFlopTest2, ( signed portCHAR * ) "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest2, "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
/* Create the first task - passing it the address of the check variable\r
that it is going to increment. This check variable is used as an \r
indication that the task is still running. */\r
- xTaskCreate( vCompetingMathTask1, ( signed portCHAR * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Create another 7 tasks, allocating a buffer for each. */\r
- xTaskCreate( vCompetingMathTask2, ( signed portCHAR * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed portCHAR * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 2 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed portCHAR * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 3 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask1, ( signed portCHAR * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 4 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask2, ( signed portCHAR * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 5 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed portCHAR * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 6 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed portCHAR * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 7 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
#endif\r
\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( prvRegTestTask1, ( signed portCHAR * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTestTask2, ( signed portCHAR * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask1, "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask2, "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be started last as they record the number of other\r
tasks that exist within the system. The value is then used to ensure at run\r
\r
\r
/* Create the first task. */\r
- xTaskCreate( vFlopTest1, ( signed char * ) "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest1, "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Do the same for the second task. */\r
- xTaskCreate( vFlopTest2, ( signed char * ) "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest2, "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 1 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
/* Create the first task - passing it the address of the check variable\r
that it is going to increment. This check variable is used as an \r
indication that the task is still running. */\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Create another 7 tasks, allocating a buffer for each. */\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 1 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 2 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 3 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 4 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 5 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 6 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( dFlopRegisters[ 7 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
#endif\r
\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( prvRegTestTask1, ( signed char * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTestTask2, ( signed char * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask1, "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask2, "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be started last as they record the number of other\r
tasks that exist within the system. The value is then used to ensure at run\r
\r
\r
/* Create the first task. */\r
- xTaskCreate( vFlopTest1, ( signed char * ) "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest1, "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Do the same for the second task. */\r
- xTaskCreate( vFlopTest2, ( signed char * ) "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest2, "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
/* Create the first task - passing it the address of the check variable\r
that it is going to increment. This check variable is used as an \r
indication that the task is still running. */\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Create another 7 tasks, allocating a buffer for each. */\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 2 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 3 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 4 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 5 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 6 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 7 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
#endif\r
\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( prvRegTestTask1, ( signed char * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTestTask2, ( signed char * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask1, "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask2, "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be started last as they record the number of other\r
tasks that exist within the system. The value is then used to ensure at run\r
\r
\r
/* Create the first task. */\r
- xTaskCreate( vFlopTest1, ( signed char * ) "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest1, "flop1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Do the same for the second task. */\r
- xTaskCreate( vFlopTest2, ( signed char * ) "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
+ xTaskCreate( vFlopTest2, "flop2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
/* Create the first task - passing it the address of the check variable\r
that it is going to increment. This check variable is used as an \r
indication that the task is still running. */\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
\r
/* The task tag value is a value that can be associated with a task, but \r
is not used by the scheduler itself. Its use is down to the application so\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
\r
/* Create another 7 tasks, allocating a buffer for each. */\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 2 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 3 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 4 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 5 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 6 ][ 0 ] ) );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
+ xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated );\r
vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 7 ][ 0 ] ) );\r
}\r
/*-----------------------------------------------------------*/\r
#endif\r
\r
/* Create the tasks defined within this file. */\r
- xTaskCreate( prvRegTestTask1, ( signed char * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTestTask2, ( signed char * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask1, "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTestTask2, "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* The suicide tasks must be started last as they record the number of other\r
tasks that exist within the system. The value is then used to ensure at run\r
***************************************************************************\r
\r
\r
- http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+ http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
license and Real Time Engineers Ltd. contact details.\r
\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
fully thread aware and reentrant UDP/IP stack.\r
\r
- http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
- Integrity Systems, who sell the code with commercial support, \r
+ http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+ Integrity Systems, who sell the code with commercial support,\r
indemnification and middleware, under the OpenRTOS brand.\r
- \r
- http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
- engineered and independently SIL3 certified version for use in safety and \r
+\r
+ http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+ engineered and independently SIL3 certified version for use in safety and\r
mission critical applications that require provable dependability.\r
*/\r
\r
vQueueAddToRegistry( xTestQueue, ( signed char * ) "Block_Time_Queue" );\r
\r
/* Create the two test tasks. */\r
- xTaskCreate( vPrimaryBlockTimeTestTask, ( signed char * )"BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
- xTaskCreate( vSecondaryBlockTimeTestTask, ( signed char * )"BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
+ xTaskCreate( vPrimaryBlockTimeTestTask, "BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
+ xTaskCreate( vSecondaryBlockTimeTestTask, "BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
/* Create the timer task, storing its handle in xTimerTaskHandle so\r
it can be returned by the xTimerGetTimerDaemonTaskHandle() function. */\r
- xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle );\r
+ xReturn = xTaskCreate( prvTimerTask, "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle );\r
}\r
#else\r
{\r
/* Create the timer task without storing its handle. */\r
- xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, NULL);\r
+ xReturn = xTaskCreate( prvTimerTask, "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, NULL);\r
}\r
#endif\r
}\r
vCreateBlockTimeTasks();\r
\r
/* Create the RegTest tasks as described at the top of this file. */\r
- xTaskCreate( prvRegTest1Entry, /* The function that implements the task. */\r
- ( const signed char * ) "Reg1",/* Text name for the task - to assist debugging only, not used by the kernel. */\r
- configMINIMAL_STACK_SIZE, /* The size of the stack allocated to the task (in words, not bytes). */\r
- mainREG_TEST_1_PARAMETER, /* The parameter passed into the task. */\r
- tskIDLE_PRIORITY, /* The priority at which the task will execute. */\r
- NULL ); /* Used to pass the handle of the created task out to the function caller - not used in this case. */\r
+ xTaskCreate( prvRegTest1Entry, /* The function that implements the task. */\r
+ "Reg1", /* Text name for the task - to assist debugging only, not used by the kernel. */\r
+ configMINIMAL_STACK_SIZE, /* The size of the stack allocated to the task (in words, not bytes). */\r
+ mainREG_TEST_1_PARAMETER, /* The parameter passed into the task. */\r
+ tskIDLE_PRIORITY, /* The priority at which the task will execute. */\r
+ NULL ); /* Used to pass the handle of the created task out to the function caller - not used in this case. */\r
\r
- xTaskCreate( prvRegTest2Entry, ( const signed char * ) "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTest2Entry, "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* Create the software timer that just increments a variable for demo\r
purposes. */\r
- xDemoTimer = xTimerCreate( ( const signed char * ) "DemoTimer",/* A text name, purely to help debugging. */\r
- ( mainDEMO_TIMER_PERIOD_MS ), /* The timer period, in this case it is always calculated relative to the check timer period (see the definition of mainDEMO_TIMER_PERIOD_MS). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvDemoTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xDemoTimer = xTimerCreate( "DemoTimer", /* A text name, purely to help debugging. */\r
+ ( mainDEMO_TIMER_PERIOD_MS ), /* The timer period, in this case it is always calculated relative to the check timer period (see the definition of mainDEMO_TIMER_PERIOD_MS). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvDemoTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* Start both the check timer and the demo timer. The timers won't actually\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
\r
/* Create the software timer that just increments a variable for demo\r
purposes. */\r
- xDemoTimer = xTimerCreate( ( const signed char * ) "DemoTimer",/* A text name, purely to help debugging. */\r
+ xDemoTimer = xTimerCreate( "DemoTimer",/* A text name, purely to help debugging. */\r
( mainDEMO_TIMER_PERIOD_MS ), /* The timer period, in this case it is always calculated relative to the check timer period (see the definition of mainDEMO_TIMER_PERIOD_MS). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
{\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
- xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
- configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
- NULL, /* The parameter passed to the task - not used in this case. */\r
- mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
- NULL ); /* The task handle is not required, so NULL is passed. */\r
-\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
+ NULL, /* The parameter passed to the task - not used in this case. */\r
+ mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
+ NULL ); /* The task handle is not required, so NULL is passed. */\r
+\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Create the RegTest tasks as described at the top of this file. */\r
xTaskCreate( prvRegTest1Entry, /* The function that implements the task. */\r
- ( const signed char * ) "Reg1",/* Text name for the task - to assist debugging only, not used by the kernel. */\r
+ "Reg1", /* Text name for the task - to assist debugging only, not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack allocated to the task (in words, not bytes). */\r
mainREG_TEST_1_PARAMETER, /* The parameter passed into the task. */\r
tskIDLE_PRIORITY, /* The priority at which the task will execute. */\r
NULL ); /* Used to pass the handle of the created task out to the function caller - not used in this case. */\r
\r
- xTaskCreate( prvRegTest2Entry, ( const signed char * ) "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTest2Entry, "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
- ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
+ ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
\r
/* Create the software timer that just increments a variable for demo\r
purposes. */\r
- xDemoTimer = xTimerCreate( ( const signed char * ) "DemoTimer",/* A text name, purely to help debugging. */\r
+ xDemoTimer = xTimerCreate( "DemoTimer",/* A text name, purely to help debugging. */\r
( mainDEMO_TIMER_PERIOD_MS ), /* The timer period, in this case it is always calculated relative to the check timer period (see the definition of mainDEMO_TIMER_PERIOD_MS). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
if( xQueue != NULL )\r
{\r
/* Start the two tasks as described at the top of this file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks running. */\r
vTaskStartScheduler();\r
vParTestInitialise();\r
\r
/* Start the reg test tasks which test the context switching mechanism. */\r
- xTaskCreate( prvRegTest1Task, ( signed char * ) "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTest2Task, ( signed char * ) "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
\r
/* The web server task. */\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
\r
/* Start the check task as described at the top of this file. */\r
- xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Create the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
static void prvSetMACAddress( void );\r
\r
/*\r
- * Perform any uIP initialisation necessary. \r
+ * Perform any uIP initialisation necessary.\r
*/\r
static void prvInitialise_uIP( void );\r
\r
unsigned long ulUIP_Events = 0UL;\r
\r
( void ) pvParameters;\r
- \r
+\r
/* Initialise the uIP stack. */\r
prvInitialise_uIP();\r
\r
for( ;; )\r
{\r
if( ( ulUIP_Events & uipETHERNET_RX_EVENT ) != 0UL )\r
- { \r
+ {\r
/* Is there received data ready to be processed? */\r
uip_len = ( unsigned short ) ulEMACRead();\r
- \r
+\r
if( ( uip_len > 0 ) && ( uip_buf != NULL ) )\r
{\r
/* Standard uIP loop taken from the uIP manual. */\r
ulUIP_Events &= ~uipETHERNET_RX_EVENT;\r
}\r
}\r
- \r
+\r
if( ( ulUIP_Events & uipPERIODIC_TIMER_EVENT ) != 0UL )\r
{\r
ulUIP_Events &= ~uipPERIODIC_TIMER_EVENT;\r
- \r
+\r
for( i = 0; i < UIP_CONNS; i++ )\r
{\r
uip_periodic( i );\r
}\r
}\r
}\r
- \r
+\r
/* Call the ARP timer function every 10 seconds. */\r
if( ( ulUIP_Events & uipARP_TIMER_EVENT ) != 0 )\r
{\r
ulUIP_Events &= ~uipARP_TIMER_EVENT;\r
uip_arp_timer();\r
}\r
- \r
+\r
if( ulUIP_Events == pdFALSE )\r
{\r
xQueueReceive( xEMACEventQueue, &ulNewEvent, portMAX_DELAY );\r
xEMACEventQueue = xQueueCreate( ul_uIPEventQueueLength, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( const signed char * const ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( const signed char * const ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 50 / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
\r
/* Only interested in processing form input if this is the IO page. */\r
c = strstr( pcInputString, "io.shtml" );\r
- \r
+\r
if( c )\r
{\r
/* Is there a command in the string? */\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static char cJitterBuffer[ 200 ];\r
static unsigned short generate_runtime_stats( void *arg )\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
+\r
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST\r
{\r
sprintf( cJitterBuffer, "<p><br>Max high frequency timer jitter = %d peripheral clock periods.<p><br>", ( int ) usMaxJitter );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cJitterBuffer );\r
}\r
#else\r
( void ) cJitterBuffer;\r
strcpy( uip_appdata, "<p>Run time stats are only available in the debug_with_optimisation build configuration.<p>" );\r
}\r
- #endif \r
+ #endif\r
\r
strcat( uip_appdata, cCountBuf );\r
\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static char cJitterBuffer[ 200 ];\r
static unsigned short generate_runtime_stats( void *arg )\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
+\r
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST\r
{\r
sprintf( cJitterBuffer, "<p><br>Max high frequency timer jitter = %d peripheral clock periods.<p><br>", ( int ) usMaxJitter );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cJitterBuffer );\r
}\r
#else\r
( void ) cJitterBuffer;\r
strcpy( uip_appdata, "<p>Run time stats are only available in the debug_with_optimisation build configuration.<p>" );\r
}\r
- #endif \r
+ #endif\r
\r
strcat( uip_appdata, cCountBuf );\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
static void prvSetMACAddress( void );\r
\r
/*\r
- * Perform any uIP initialisation necessary. \r
+ * Perform any uIP initialisation necessary.\r
*/\r
static void prvInitialise_uIP( void );\r
\r
unsigned long ulUIP_Events = 0UL;\r
\r
( void ) pvParameters;\r
- \r
+\r
/* Initialise the uIP stack. */\r
prvInitialise_uIP();\r
\r
for( ;; )\r
{\r
if( ( ulUIP_Events & uipETHERNET_RX_EVENT ) != 0UL )\r
- { \r
+ {\r
/* Is there received data ready to be processed? */\r
uip_len = ( unsigned short ) ulEMACRead();\r
- \r
+\r
if( ( uip_len > 0 ) && ( uip_buf != NULL ) )\r
{\r
/* Standard uIP loop taken from the uIP manual. */\r
ulUIP_Events &= ~uipETHERNET_RX_EVENT;\r
}\r
}\r
- \r
+\r
if( ( ulUIP_Events & uipPERIODIC_TIMER_EVENT ) != 0UL )\r
{\r
ulUIP_Events &= ~uipPERIODIC_TIMER_EVENT;\r
- \r
+\r
for( i = 0; i < UIP_CONNS; i++ )\r
{\r
uip_periodic( i );\r
}\r
}\r
}\r
- \r
+\r
/* Call the ARP timer function every 10 seconds. */\r
if( ( ulUIP_Events & uipARP_TIMER_EVENT ) != 0 )\r
{\r
ulUIP_Events &= ~uipARP_TIMER_EVENT;\r
uip_arp_timer();\r
}\r
- \r
+\r
if( ulUIP_Events == pdFALSE )\r
{\r
xQueueReceive( xEMACEventQueue, &ulNewEvent, portMAX_DELAY );\r
xEMACEventQueue = xQueueCreate( ul_uIPEventQueueLength, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( const signed char * const ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( const signed char * const ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 50 / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
\r
/* Only interested in processing form input if this is the IO page. */\r
c = strstr( pcInputString, "io.shtml" );\r
- \r
+\r
if( c )\r
{\r
/* Is there a command in the string? */\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static char cJitterBuffer[ 200 ];\r
static unsigned short generate_runtime_stats( void *arg )\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
+\r
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST\r
{\r
sprintf( cJitterBuffer, "<p><br>Max high frequency timer jitter = %d peripheral clock periods.<p><br>", ( int ) usMaxJitter );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cJitterBuffer );\r
}\r
#else\r
( void ) cJitterBuffer;\r
strcpy( uip_appdata, "<p>Run time stats are only available in the debug_with_optimisation build configuration.<p>" );\r
}\r
- #endif \r
+ #endif\r
\r
strcat( uip_appdata, cCountBuf );\r
\r
if( xQueue != NULL )\r
{\r
/* Start the two tasks as described at the top of this file. */\r
- xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks running. */\r
vTaskStartScheduler();\r
vParTestInitialise();\r
\r
/* Start the reg test tasks which test the context switching mechanism. */\r
- xTaskCreate( prvRegTest1Task, ( signed char * ) "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegTest2Task, ( signed char * ) "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
\r
/* The web server task. */\r
- xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
\r
/* Start the check task as described at the top of this file. */\r
- xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Create the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
static void prvSetMACAddress( void );\r
\r
/*\r
- * Perform any uIP initialisation necessary. \r
+ * Perform any uIP initialisation necessary.\r
*/\r
static void prvInitialise_uIP( void );\r
\r
unsigned long ulUIP_Events = 0UL;\r
\r
( void ) pvParameters;\r
- \r
+\r
/* Initialise the uIP stack. */\r
prvInitialise_uIP();\r
\r
for( ;; )\r
{\r
if( ( ulUIP_Events & uipETHERNET_RX_EVENT ) != 0UL )\r
- { \r
+ {\r
/* Is there received data ready to be processed? */\r
uip_len = ( unsigned short ) ulEMACRead();\r
- \r
+\r
if( ( uip_len > 0 ) && ( uip_buf != NULL ) )\r
{\r
/* Standard uIP loop taken from the uIP manual. */\r
ulUIP_Events &= ~uipETHERNET_RX_EVENT;\r
}\r
}\r
- \r
+\r
if( ( ulUIP_Events & uipPERIODIC_TIMER_EVENT ) != 0UL )\r
{\r
ulUIP_Events &= ~uipPERIODIC_TIMER_EVENT;\r
- \r
+\r
for( i = 0; i < UIP_CONNS; i++ )\r
{\r
uip_periodic( i );\r
}\r
}\r
}\r
- \r
+\r
/* Call the ARP timer function every 10 seconds. */\r
if( ( ulUIP_Events & uipARP_TIMER_EVENT ) != 0 )\r
{\r
ulUIP_Events &= ~uipARP_TIMER_EVENT;\r
uip_arp_timer();\r
}\r
- \r
+\r
if( ulUIP_Events == pdFALSE )\r
{\r
xQueueReceive( xEMACEventQueue, &ulNewEvent, portMAX_DELAY );\r
xEMACEventQueue = xQueueCreate( ul_uIPEventQueueLength, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( const signed char * const ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( const signed char * const ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 50 / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
\r
/* Only interested in processing form input if this is the IO page. */\r
c = strstr( pcInputString, "io.shtml" );\r
- \r
+\r
if( c )\r
{\r
/* Is there a command in the string? */\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static char cJitterBuffer[ 200 ];\r
static unsigned short generate_runtime_stats( void *arg )\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
+\r
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST\r
{\r
sprintf( cJitterBuffer, "<p><br>Max high frequency timer jitter = %d peripheral clock periods.<p><br>", ( int ) usMaxJitter );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cJitterBuffer );\r
}\r
#else\r
( void ) cJitterBuffer;\r
strcpy( uip_appdata, "<p>Run time stats are only available in the debug_with_optimisation build configuration.<p>" );\r
}\r
- #endif \r
+ #endif\r
\r
strcat( uip_appdata, cCountBuf );\r
\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static char cJitterBuffer[ 200 ];\r
static unsigned short generate_runtime_stats( void *arg )\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
+\r
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST\r
{\r
sprintf( cJitterBuffer, "<p><br>Max high frequency timer jitter = %d peripheral clock periods.<p><br>", ( int ) usMaxJitter );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cJitterBuffer );\r
}\r
#else\r
( void ) cJitterBuffer;\r
strcpy( uip_appdata, "<p>Run time stats are only available in the debug_with_optimisation build configuration.<p>" );\r
}\r
- #endif \r
+ #endif\r
\r
strcat( uip_appdata, cCountBuf );\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
static void prvSetMACAddress( void );\r
\r
/*\r
- * Perform any uIP initialisation necessary. \r
+ * Perform any uIP initialisation necessary.\r
*/\r
static void prvInitialise_uIP( void );\r
\r
unsigned long ulUIP_Events = 0UL;\r
\r
( void ) pvParameters;\r
- \r
+\r
/* Initialise the uIP stack. */\r
prvInitialise_uIP();\r
\r
for( ;; )\r
{\r
if( ( ulUIP_Events & uipETHERNET_RX_EVENT ) != 0UL )\r
- { \r
+ {\r
/* Is there received data ready to be processed? */\r
uip_len = ( unsigned short ) ulEMACRead();\r
- \r
+\r
if( ( uip_len > 0 ) && ( uip_buf != NULL ) )\r
{\r
/* Standard uIP loop taken from the uIP manual. */\r
ulUIP_Events &= ~uipETHERNET_RX_EVENT;\r
}\r
}\r
- \r
+\r
if( ( ulUIP_Events & uipPERIODIC_TIMER_EVENT ) != 0UL )\r
{\r
ulUIP_Events &= ~uipPERIODIC_TIMER_EVENT;\r
- \r
+\r
for( i = 0; i < UIP_CONNS; i++ )\r
{\r
uip_periodic( i );\r
}\r
}\r
}\r
- \r
+\r
/* Call the ARP timer function every 10 seconds. */\r
if( ( ulUIP_Events & uipARP_TIMER_EVENT ) != 0 )\r
{\r
ulUIP_Events &= ~uipARP_TIMER_EVENT;\r
uip_arp_timer();\r
}\r
- \r
+\r
if( ulUIP_Events == pdFALSE )\r
{\r
xQueueReceive( xEMACEventQueue, &ulNewEvent, portMAX_DELAY );\r
xEMACEventQueue = xQueueCreate( ul_uIPEventQueueLength, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( const signed char * const ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( const signed char * const ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 50 / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
\r
/* Only interested in processing form input if this is the IO page. */\r
c = strstr( pcInputString, "io.shtml" );\r
- \r
+\r
if( c )\r
{\r
/* Is there a command in the string? */\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static char cJitterBuffer[ 200 ];\r
static unsigned short generate_runtime_stats( void *arg )\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
+\r
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST\r
{\r
sprintf( cJitterBuffer, "<p><br>Max high frequency timer jitter = %d peripheral clock periods.<p><br>", ( int ) usMaxJitter );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cJitterBuffer );\r
}\r
#else\r
( void ) cJitterBuffer;\r
strcpy( uip_appdata, "<p>Run time stats are only available in the debug_with_optimisation build configuration.<p>" );\r
}\r
- #endif \r
+ #endif\r
\r
strcat( uip_appdata, cCountBuf );\r
\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
static void prvSetMACAddress( void );\r
\r
/*\r
- * Perform any uIP initialisation necessary. \r
+ * Perform any uIP initialisation necessary.\r
*/\r
static void prvInitialise_uIP( void );\r
\r
unsigned long ulUIP_Events = 0UL;\r
\r
( void ) pvParameters;\r
- \r
+\r
/* Initialise the uIP stack. */\r
prvInitialise_uIP();\r
\r
for( ;; )\r
{\r
if( ( ulUIP_Events & uipETHERNET_RX_EVENT ) != 0UL )\r
- { \r
+ {\r
/* Is there received data ready to be processed? */\r
uip_len = ( unsigned short ) ulEMACRead();\r
- \r
+\r
if( ( uip_len > 0 ) && ( uip_buf != NULL ) )\r
{\r
/* Standard uIP loop taken from the uIP manual. */\r
ulUIP_Events &= ~uipETHERNET_RX_EVENT;\r
}\r
}\r
- \r
+\r
if( ( ulUIP_Events & uipPERIODIC_TIMER_EVENT ) != 0UL )\r
{\r
ulUIP_Events &= ~uipPERIODIC_TIMER_EVENT;\r
- \r
+\r
for( i = 0; i < UIP_CONNS; i++ )\r
{\r
uip_periodic( i );\r
}\r
}\r
}\r
- \r
+\r
/* Call the ARP timer function every 10 seconds. */\r
if( ( ulUIP_Events & uipARP_TIMER_EVENT ) != 0 )\r
{\r
ulUIP_Events &= ~uipARP_TIMER_EVENT;\r
uip_arp_timer();\r
}\r
- \r
+\r
if( ulUIP_Events == pdFALSE )\r
{\r
xQueueReceive( xEMACEventQueue, &ulNewEvent, portMAX_DELAY );\r
xEMACEventQueue = xQueueCreate( ul_uIPEventQueueLength, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( const signed char * const ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( const signed char * const ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 50 / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
\r
/* Only interested in processing form input if this is the IO page. */\r
c = strstr( pcInputString, "io.shtml" );\r
- \r
+\r
if( c )\r
{\r
/* Is there a command in the string? */\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static char cJitterBuffer[ 200 ];\r
static unsigned short generate_runtime_stats( void *arg )\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
+\r
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST\r
{\r
sprintf( cJitterBuffer, "<p><br>Max high frequency timer jitter = %d peripheral clock periods.<p><br>", ( int ) usMaxJitter );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cJitterBuffer );\r
}\r
#else\r
( void ) cJitterBuffer;\r
strcpy( uip_appdata, "<p>Run time stats are only available in the debug_with_optimisation build configuration.<p>" );\r
}\r
- #endif \r
+ #endif\r
\r
strcat( uip_appdata, cCountBuf );\r
\r
***************************************************************************\r
\r
\r
- http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+ http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
license and Real Time Engineers Ltd. contact details.\r
\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
fully thread aware and reentrant UDP/IP stack.\r
\r
- http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
- Integrity Systems, who sell the code with commercial support, \r
+ http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+ Integrity Systems, who sell the code with commercial support,\r
indemnification and middleware, under the OpenRTOS brand.\r
- \r
- http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
- engineered and independently SIL3 certified version for use in safety and \r
+\r
+ http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+ engineered and independently SIL3 certified version for use in safety and\r
mission critical applications that require provable dependability.\r
*/\r
\r
static void prvSetMACAddress( void );\r
\r
/*\r
- * Perform any uIP initialisation necessary. \r
+ * Perform any uIP initialisation necessary.\r
*/\r
static void prvInitialise_uIP( void );\r
\r
unsigned long ulUIP_Events = 0UL;\r
\r
( void ) pvParameters;\r
- \r
+\r
/* Initialise the uIP stack. */\r
prvInitialise_uIP();\r
\r
for( ;; )\r
{\r
if( ( ulUIP_Events & uipETHERNET_RX_EVENT ) != 0UL )\r
- { \r
+ {\r
/* Is there received data ready to be processed? */\r
uip_len = ( unsigned short ) ulEMACRead();\r
- \r
+\r
if( ( uip_len > 0 ) && ( uip_buf != NULL ) )\r
{\r
/* Standard uIP loop taken from the uIP manual. */\r
ulUIP_Events &= ~uipETHERNET_RX_EVENT;\r
}\r
}\r
- \r
+\r
if( ( ulUIP_Events & uipPERIODIC_TIMER_EVENT ) != 0UL )\r
{\r
ulUIP_Events &= ~uipPERIODIC_TIMER_EVENT;\r
- \r
+\r
for( i = 0; i < UIP_CONNS; i++ )\r
{\r
uip_periodic( i );\r
}\r
}\r
}\r
- \r
+\r
/* Call the ARP timer function every 10 seconds. */\r
if( ( ulUIP_Events & uipARP_TIMER_EVENT ) != 0 )\r
{\r
ulUIP_Events &= ~uipARP_TIMER_EVENT;\r
uip_arp_timer();\r
}\r
- \r
+\r
if( ulUIP_Events == pdFALSE )\r
{\r
xQueueReceive( xEMACEventQueue, &ulNewEvent, portMAX_DELAY );\r
xEMACEventQueue = xQueueCreate( ul_uIPEventQueueLength, sizeof( unsigned long ) );\r
\r
/* Create and start the uIP timers. */\r
- xARPTimer = xTimerCreate( ( const signed char * const ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
+ xARPTimer = xTimerCreate( "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */\r
( 10000UL / portTICK_RATE_MS ), /* Timer period. */\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipARP_TIMER,\r
prvUIPTimerCallback\r
);\r
\r
- xPeriodicTimer = xTimerCreate( ( const signed char * const ) "PeriodicTimer",\r
+ xPeriodicTimer = xTimerCreate( "PeriodicTimer",\r
( 50 / portTICK_RATE_MS ),\r
pdTRUE, /* Autor-reload. */\r
( void * ) uipPERIODIC_TIMER,\r
\r
/* Only interested in processing form input if this is the IO page. */\r
c = strstr( pcInputString, "io.shtml" );\r
- \r
+\r
if( c )\r
{\r
/* Is there a command in the string? */\r
PSOCK_BEGIN( &s->sout );\r
\r
( void ) PT_YIELD_FLAG;\r
- \r
+\r
PSOCK_GENERATOR_SEND( &s->sout, generate_file_stats, strchr(ptr, ' ') + 1 );\r
\r
PSOCK_END( &s->sout );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
extern unsigned short usMaxJitter;\r
static char cJitterBuffer[ 200 ];\r
static unsigned short generate_runtime_stats( void *arg )\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- \r
+\r
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST\r
{\r
sprintf( cJitterBuffer, "<p><br>Max high frequency timer jitter = %d peripheral clock periods.<p><br>", ( int ) usMaxJitter );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cJitterBuffer );\r
}\r
#else\r
( void ) cJitterBuffer;\r
strcpy( uip_appdata, "<p>Run time stats are only available in the debug_with_optimisation build configuration.<p>" );\r
}\r
- #endif \r
+ #endif\r
\r
strcat( uip_appdata, cCountBuf );\r
\r
xTaskHandle xCreatedTask;\r
\r
/* Create one of the floating point tasks... */\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xCreatedTask );\r
+ xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xCreatedTask );\r
\r
/* ... then enable floating point support for the created task so its flop\r
flop registers are maintained in a consistent state. */\r
xPortUsesFloatingPoint( xCreatedTask );\r
\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xCreatedTask );\r
+ xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xCreatedTask );\r
xPortUsesFloatingPoint( xCreatedTask );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xCreatedTask );\r
+ xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xCreatedTask );\r
xPortUsesFloatingPoint( xCreatedTask );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xCreatedTask );\r
+ xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xCreatedTask );\r
xPortUsesFloatingPoint( xCreatedTask );\r
\r
- xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xCreatedTask );\r
+ xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xCreatedTask );\r
xPortUsesFloatingPoint( xCreatedTask );\r
\r
- xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xCreatedTask );\r
+ xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xCreatedTask );\r
xPortUsesFloatingPoint( xCreatedTask );\r
\r
- xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xCreatedTask );\r
+ xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xCreatedTask );\r
xPortUsesFloatingPoint( xCreatedTask );\r
\r
- xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xCreatedTask );\r
+ xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xCreatedTask );\r
xPortUsesFloatingPoint( xCreatedTask );\r
}\r
/*-----------------------------------------------------------*/\r
struct httpd_state *s = ( struct httpd_state * ) arg;\r
\r
conn = &uip_conns[s->count];\r
- return sprintf( ( char * ) uip_appdata, \r
+ return sprintf( ( char * ) uip_appdata,\r
"<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", htons(conn->lport),\r
htons(conn->ripaddr.u16[0]) >> 8, htons(conn->ripaddr.u16[0]) & 0xff, htons(conn->ripaddr.u16[1]) >> 8,\r
htons(conn->ripaddr.u16[1]) & 0xff, htons(conn->rport), states[conn->tcpstateflags & UIP_TS_MASK], conn->nrtx, conn->timer,\r
- (uip_outstanding(conn)) ? '*' : ' ', (uip_stopped(conn)) ? '!' : ' ' ); \r
+ (uip_outstanding(conn)) ? '*' : ' ', (uip_stopped(conn)) ? '!' : ' ' );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskList( signed char *pcWriteBuffer );\r
+extern void vTaskList( char *pcWriteBuffer );\r
extern char *pcGetTaskStatusMessage( void );\r
static char cCountBuf[128];\r
long lRefreshCount = 0;\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", ( int ) lRefreshCount, pcGetTaskStatusMessage() );\r
- vTaskList( uip_appdata );\r
+ vTaskList( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
}\r
\r
/*---------------------------------------------------------------------------*/\r
-extern void vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
+extern void vTaskGetRunTimeStats( char *pcWriteBuffer );\r
static unsigned short generate_runtime_stats( void *arg )\r
{\r
( void ) arg;\r
lRefreshCount++;\r
sprintf( cCountBuf, "<p><br>Refresh count = %d", ( int ) lRefreshCount );\r
- vTaskGetRunTimeStats( uip_appdata );\r
+ vTaskGetRunTimeStats( ( char * ) uip_appdata );\r
strcat( uip_appdata, cCountBuf );\r
\r
return strlen( uip_appdata );\r
\r
/* Create the task that pends on the semaphore that is given by the\r
high frequency interrupt. */\r
- xTaskCreate( prvHighFrequencyTimerTask, ( signed char * ) "HFTmr", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
+ xTaskCreate( prvHighFrequencyTimerTask, "HFTmr", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
\r
/* Setup the interrupt itself. The STM module clock divider is setup when \r
the tick interrupt is configured - which is when the scheduler is started - \r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
\r
/* Create the register test tasks, as described at the top of this file. */\r
- xTaskCreate( prvRegisterCheckTask1, ( signed char * ) "Reg 1", configMINIMAL_STACK_SIZE, &ulRegisterTest1Count, tskIDLE_PRIORITY, NULL );\r
- xTaskCreate( prvRegisterCheckTask2, ( signed char * ) "Reg 2", configMINIMAL_STACK_SIZE, &ulRegisterTest2Count, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegisterCheckTask1, "Reg 1", configMINIMAL_STACK_SIZE, &ulRegisterTest1Count, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvRegisterCheckTask2, "Reg 2", configMINIMAL_STACK_SIZE, &ulRegisterTest2Count, tskIDLE_PRIORITY, NULL );\r
\r
/* Start the check task - which is defined in this file. */\r
- xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* This task has to be created last as it keeps account of the number of tasks\r
it expects to see running. */\r
\r
/* Create the FreeRTOS defined basic command server. This demonstrates use\r
of the lwIP sockets API. */\r
- xTaskCreate( vBasicSocketsCommandInterpreterTask, ( signed char * ) "CmdInt", configMINIMAL_STACK_SIZE * 10, NULL, configMAX_PRIORITIES - 2, NULL );\r
+ xTaskCreate( vBasicSocketsCommandInterpreterTask, "CmdInt", configMINIMAL_STACK_SIZE * 10, NULL, configMAX_PRIORITIES - 2, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
switch( iIndex )\r
{\r
case ssiTASK_STATS_INDEX :\r
- vTaskList( ( signed char * ) pcBuffer );\r
+ vTaskList( pcBuffer );\r
break;\r
\r
case ssiRUN_TIME_STATS_INDEX :\r
- vTaskGetRunTimeStats( ( signed char * ) pcBuffer );\r
+ vTaskGetRunTimeStats( pcBuffer );\r
break;\r
}\r
\r
tcpip_init( lwIPAppsInit, NULL );\r
\r
/* Create and start the check timer, as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
\r
/* Generate a table of task stats. */\r
strcpy( pcWriteBuffer, pcHeader );\r
- vTaskGetRunTimeStats( pcWriteBuffer + strlen( pcHeader ) );\r
+ vTaskGetRunTimeStats( ( char * ) pcWriteBuffer + strlen( pcHeader ) );\r
\r
/* There is no more data to return after this single string, so return\r
pdFALSE. */\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( ( xQueueHandle ) xMutex, ( signed portCHAR * ) "Recursive_Mutex" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Recursive_Mutex" );\r
\r
\r
if( xMutex != NULL )\r
{\r
- xTaskCreate( prvRecursiveMutexControllingTask, ( signed portCHAR * ) "Rec1Ctrl", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
- xTaskCreate( prvRecursiveMutexBlockingTask, ( signed portCHAR * ) "Rec2Blck", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
- xTaskCreate( prvRecursiveMutexPollingTask, ( signed portCHAR * ) "Rec3Poll", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, &xPollingTaskHandle );\r
+ xTaskCreate( prvRecursiveMutexControllingTask, "Rec1Ctrl", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
+ xTaskCreate( prvRecursiveMutexBlockingTask, "Rec2Blck", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
+ xTaskCreate( prvRecursiveMutexPollingTask, "Rec3Poll", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, &xPollingTaskHandle );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
The simply blinky demo is implemented and described in main_blinky.c. The more \r
comprehensive test and demo application is implemented and described in \r
main_full.c. */\r
-#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0\r
\r
/*\r
* main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
\r
void vAssertCalled( unsigned long ulLine, const char * const pcFileName )\r
{\r
+static portBASE_TYPE xPrinted = pdFALSE;\r
+\r
/* Parameters are not used. */\r
( void ) ulLine;\r
( void ) pcFileName;\r
taskDISABLE_INTERRUPTS();\r
\r
/* Stop the trace recording. */\r
- if( xTraceRunning == pdTRUE )\r
+ if( xPrinted == pdFALSE )\r
{\r
+ xPrinted = pdTRUE;\r
+ if( xTraceRunning == pdTRUE )\r
+ {\r
vTraceStop();\r
prvSaveTraceFile();\r
+ }\r
}\r
- \r
for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* application. It is provided as a convenient development and demonstration\r
* test bed only. This was tested using Windows XP on a dual core laptop.\r
*\r
- * Windows will not be running the FreeRTOS simulator threads continuously, so \r
- * the timing information in the FreeRTOS+Trace logs have no meaningful units. \r
- * See the documentation page for the Windows simulator for an explanation of \r
+ * Windows will not be running the FreeRTOS simulator threads continuously, so\r
+ * the timing information in the FreeRTOS+Trace logs have no meaningful units.\r
+ * See the documentation page for the Windows simulator for an explanation of\r
* the slow timing:\r
* http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
* - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -\r
*\r
* NOTE 2: This project provides two demo applications. A simple blinky style\r
* project, and a more comprehensive test and demo application. The\r
- * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select \r
- * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY \r
+ * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select\r
+ * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\r
* in main.c. This file implements the simply blinky style version.\r
*\r
* NOTE 3: This file only contains the source code that is specific to the\r
- * basic demo. Generic functions, such FreeRTOS hook functions, are defined \r
+ * basic demo. Generic functions, such FreeRTOS hook functions, are defined\r
* in main.c.\r
******************************************************************************\r
*\r
* The queue send task is implemented by the prvQueueSendTask() function in\r
* this file. prvQueueSendTask() sits in a loop that causes it to repeatedly\r
* block for 200 (simulated as far as the scheduler is concerned, but in\r
- * reality much longer - see notes above) milliseconds, before sending the \r
- * value 100 to the queue that was created within main_blinky(). Once the \r
- * value is sent, the task loops back around to block for another 200 \r
+ * reality much longer - see notes above) milliseconds, before sending the\r
+ * value 100 to the queue that was created within main_blinky(). Once the\r
+ * value is sent, the task loops back around to block for another 200\r
* (simulated) milliseconds.\r
*\r
* The Queue Receive Task:\r
* in this file. prvQueueReceiveTask() sits in a loop where it repeatedly\r
* blocks on attempts to read data from the queue that was created within\r
* main_blinky(). When data is received, the task checks the value of the\r
- * data, and if the value equals the expected 100, outputs a message. The \r
- * 'block time' parameter passed to the queue receive function specifies that \r
- * the task should be held in the Blocked state indefinitely to wait for data \r
+ * data, and if the value equals the expected 100, outputs a message. The\r
+ * 'block time' parameter passed to the queue receive function specifies that\r
+ * the task should be held in the Blocked state indefinitely to wait for data\r
* to be available on the queue. The queue receive task will only leave the\r
* Blocked state when the queue send task writes to the queue. As the queue\r
- * send task writes to the queue every 200 (simulated - see notes above) \r
- * milliseconds, the queue receive task leaves the Blocked state every 200 \r
+ * send task writes to the queue every 200 (simulated - see notes above)\r
+ * milliseconds, the queue receive task leaves the Blocked state every 200\r
* milliseconds, and therefore outputs a message every 200 milliseconds.\r
*/\r
\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
portTickType xNextWakeTime;\r
const unsigned long ulValueToSend = 100UL;\r
\r
- /* Remove compiler warning in the case that configASSERT() is not \r
+ /* Remove compiler warning in the case that configASSERT() is not\r
defined. */\r
( void ) pvParameters;\r
\r
{\r
unsigned long ulReceivedValue;\r
\r
- /* Remove compiler warning in the case that configASSERT() is not \r
+ /* Remove compiler warning in the case that configASSERT() is not\r
defined. */\r
( void ) pvParameters;\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* application. It is provided as a convenient development and demonstration\r
* test bed only. This was tested using Windows XP on a dual core laptop.\r
*\r
- * Windows will not be running the FreeRTOS simulator threads continuously, so \r
- * the timing information in the FreeRTOS+Trace logs have no meaningful units. \r
- * See the documentation page for the Windows simulator for an explanation of \r
+ * Windows will not be running the FreeRTOS simulator threads continuously, so\r
+ * the timing information in the FreeRTOS+Trace logs have no meaningful units.\r
+ * See the documentation page for the Windows simulator for an explanation of\r
* the slow timing:\r
* http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
* - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -\r
*\r
* NOTE 2: This project provides two demo applications. A simple blinky style\r
* project, and a more comprehensive test and demo application. The\r
- * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select \r
- * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY \r
+ * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select\r
+ * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\r
* in main.c. This file implements the comprehensive test and demo version.\r
*\r
* NOTE 3: This file only contains the source code that is specific to the\r
- * basic demo. Generic functions, such FreeRTOS hook functions, are defined in \r
+ * basic demo. Generic functions, such FreeRTOS hook functions, are defined in\r
* main.c.\r
*******************************************************************************\r
*\r
- * main() creates all the demo application tasks, then starts the scheduler. \r
- * The web documentation provides more details of the standard demo application \r
- * tasks, which provide no particular functionality but do provide a good \r
+ * main() creates all the demo application tasks, then starts the scheduler.\r
+ * The web documentation provides more details of the standard demo application\r
+ * tasks, which provide no particular functionality but do provide a good\r
* example of how to use the FreeRTOS API.\r
*\r
* In addition to the standard demo tasks, the following tasks and tests are\r
/* Task function prototypes. */\r
static void prvCheckTask( void *pvParameters );\r
\r
-/* A task that is created from the idle task to test the functionality of \r
+/* A task that is created from the idle task to test the functionality of\r
eTaskStateGet(). */\r
static void prvTestTask( void *pvParameters );\r
\r
int main_full( void )\r
{\r
/* Start the check task as described at the top of this file. */\r
- xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Create the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
vStartQueuePeekTasks();\r
vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
- vStartRecursiveMutexTasks(); \r
+ vStartRecursiveMutexTasks();\r
vStartCountingSemaphoreTasks();\r
vStartDynamicPriorityTasks();\r
vStartQueueSetTasks();\r
- vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY ); \r
- xTaskCreate( prvDemoQueueSpaceFunctions, ( signed char * ) "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );\r
+ xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
vStartEventGroupTasks();\r
\r
#if( configUSE_PREEMPTION != 0 )\r
#endif\r
\r
/* The suicide tasks must be created last as they need to know how many\r
- tasks were running prior to their creation. This then allows them to \r
- ascertain whether or not the correct/expected number of tasks are running at \r
+ tasks were running prior to their creation. This then allows them to\r
+ ascertain whether or not the correct/expected number of tasks are running at\r
any given time. */\r
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
\r
/* Start the scheduler itself. */\r
vTaskStartScheduler();\r
\r
- /* Should never get here unless there was not enough heap space to create \r
+ /* Should never get here unless there was not enough heap space to create\r
the idle and other system tasks. */\r
return 0;\r
}\r
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
{\r
pcStatusMessage = "Error: IntMath";\r
- } \r
+ }\r
else if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
- { \r
+ {\r
pcStatusMessage = "Error: GenQueue";\r
}\r
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
pcStatusMessage = "Error: Queue overwrite";\r
}\r
\r
- /* This is the only task that uses stdout so its ok to call printf() \r
+ /* This is the only task that uses stdout so its ok to call printf()\r
directly. */\r
printf( "%s - %d\r\n", pcStatusMessage, xTaskGetTickCount() );\r
}\r
prvDemonstrateTaskStateAndHandleGetFunctions();\r
\r
/* If xMutexToDelete has not already been deleted, then delete it now.\r
- This is done purely to demonstrate the use of, and test, the \r
+ This is done purely to demonstrate the use of, and test, the\r
vSemaphoreDelete() macro. Care must be taken not to delete a semaphore\r
that has tasks blocked on it. */\r
if( xMutexToDelete != NULL )\r
xMutexToDelete = NULL;\r
}\r
\r
- /* Exercise heap_4 a bit. The malloc failed hook will trap failed \r
+ /* Exercise heap_4 a bit. The malloc failed hook will trap failed\r
allocations so there is no need to test here. */\r
pvAllocated = pvPortMalloc( ( rand() % 100 ) + 1 );\r
vPortFree( pvAllocated );\r
/* Call the periodic queue overwrite from ISR demo. */\r
vQueueOverwritePeriodicISRDemo();\r
\r
- /* Write to a queue that is in use as part of the queue set demo to \r
+ /* Write to a queue that is in use as part of the queue set demo to\r
demonstrate using queue sets from an ISR. */\r
vQueueSetAccessQueueSetFromISR();\r
}\r
static portBASE_TYPE xPerformedOneShotTests = pdFALSE;\r
xTaskHandle xTestTask;\r
\r
- /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and \r
+ /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and\r
xTaskGetIdleTaskHandle() functions. Also try using the function that sets\r
the task number. */\r
xIdleTaskHandle = xTaskGetIdleTaskHandle();\r
vTaskSetTaskNumber( xIdleTaskHandle, ( unsigned long ) ucConstTaskNumber );\r
configASSERT( uxTaskGetTaskNumber( xIdleTaskHandle ) == ucConstTaskNumber );\r
\r
- /* This is the idle hook, so the current task handle should equal the \r
+ /* This is the idle hook, so the current task handle should equal the\r
returned idle task handle. */\r
if( xTaskGetCurrentTaskHandle() != xIdleTaskHandle )\r
{\r
{\r
/* Ask how many messages are available... */\r
uxReturn = uxQueueMessagesWaiting( xQueue );\r
- \r
+\r
/* Check the number of messages being reported as being available\r
is as expected, and force an assert if not. */\r
if( uxReturn != x )\r
\r
/* Ask how many spaces remain in the queue... */\r
uxReturn = uxQueueSpacesAvailable( xQueue );\r
- \r
+\r
/* Check the number of spaces being reported as being available\r
is as expected, and force an assert if not. */\r
if( uxReturn != ( uxQueueLength - x ) )\r
}\r
\r
uxReturn = uxQueueSpacesAvailable( xQueue );\r
- \r
+\r
if( uxReturn != 0 )\r
{\r
configASSERT( xQueue == NULL );\r
is not being used. The call to vQueueAddToRegistry() will be removed\r
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
defined to be less than 1. */\r
- vQueueAddToRegistry( ( xQueueHandle ) xMutex, ( signed portCHAR * ) "Recursive_Mutex" );\r
+ vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Recursive_Mutex" );\r
\r
\r
if( xMutex != NULL )\r
{\r
- xTaskCreate( prvRecursiveMutexControllingTask, ( signed portCHAR * ) "Rec1Ctrl", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
- xTaskCreate( prvRecursiveMutexBlockingTask, ( signed portCHAR * ) "Rec2Blck", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
- xTaskCreate( prvRecursiveMutexPollingTask, ( signed portCHAR * ) "Rec3Poll", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, &xPollingTaskHandle );\r
+ xTaskCreate( prvRecursiveMutexControllingTask, "Rec1Ctrl", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
+ xTaskCreate( prvRecursiveMutexBlockingTask, "Rec2Blck", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
+ xTaskCreate( prvRecursiveMutexPollingTask, "Rec3Poll", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, &xPollingTaskHandle );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
The simply blinky demo is implemented and described in main_blinky.c. The more \r
comprehensive test and demo application is implemented and described in \r
main_full.c. */\r
-#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1\r
\r
/*\r
* main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
\r
/*-----------------------------------------------------------*/\r
\r
-\r
int main( void )\r
{\r
/* Initialise the trace recorder and create the label used to post user\r
events to the trace recording on each tick interrupt. */\r
vTraceInitTraceData();\r
- printf( "Trace started. Hit a key to dump trace file to disk. Note stdin does not work when using the Eclipse console with MingW.\r\n" );\r
- fflush( stdout );\r
-\r
xTickTraceUserEvent = xTraceOpenLabel( "tick" );\r
\r
/* Start the trace recording - the recording is written to a file if\r
configASSERT() is called. */\r
+ printf( "\r\nTrace started. Hit a key to dump trace file to disk (does not work from Eclipse console).\r\n" );\r
+ fflush( stdout );\r
uiTraceStart();\r
\r
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top\r
memory allocated by the kernel to any task that has since been deleted. */\r
\r
/* The trace can be stopped with any key press. */\r
- if( kbhit() != pdFALSE )\r
+ if( _kbhit() != pdFALSE )\r
{\r
if( xTraceRunning == pdTRUE )\r
{\r
\r
void vAssertCalled( unsigned long ulLine, const char * const pcFileName )\r
{\r
+static portBASE_TYPE xPrinted = pdFALSE;\r
+\r
/* Parameters are not used. */\r
( void ) ulLine;\r
( void ) pcFileName;\r
__asm volatile( "int $3" );\r
\r
/* Stop the trace recording. */\r
- if( xTraceRunning == pdTRUE )\r
+ if( xPrinted == pdFALSE )\r
{\r
+ xPrinted = pdTRUE;\r
+ if( xTraceRunning == pdTRUE )\r
+ {\r
vTraceStop();\r
prvSaveTraceFile();\r
+ }\r
}\r
\r
taskENABLE_INTERRUPTS();\r
fwrite( RecorderDataPtr, sizeof( RecorderDataType ), 1, pxOutputFile );\r
fclose( pxOutputFile );\r
printf( "\r\nTrace output saved to Trace.dump\r\n" );\r
- fflush( stdout );\r
}\r
else\r
{\r
printf( "\r\nFailed to create trace dump file\r\n" );\r
- fflush( stdout );\r
}\r
}\r
/* Start the two tasks as described in the comments at the top of this\r
file. */\r
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */\r
- ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */\r
( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */\r
NULL ); /* The task handle is not required, so NULL is passed. */\r
\r
- xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
int main_full( void )\r
{\r
/* Start the check task as described at the top of this file. */\r
- xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Create the standard demo tasks. */\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vStartDynamicPriorityTasks();\r
vStartQueueSetTasks();\r
vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );\r
- xTaskCreate( prvDemoQueueSpaceFunctions, ( signed char * ) "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
vStartEventGroupTasks();\r
\r
#if( configUSE_PREEMPTION != 0 )\r
{\r
xTaskHandle xIdleTaskHandle, xTimerTaskHandle;\r
const unsigned char ucConstTaskNumber = 0x55U;\r
-signed char *pcTaskName;\r
+char *pcTaskName;\r
static portBASE_TYPE xPerformedOneShotTests = pdFALSE;\r
xTaskHandle xTestTask;\r
\r
xPerformedOneShotTests = pdTRUE;\r
\r
/* Create a test task to use to test other eTaskStateGet() return values. */\r
- if( xTaskCreate( prvTestTask, ( const signed char * const ) "Test", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTestTask ) == pdPASS )\r
+ if( xTaskCreate( prvTestTask, "Test", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTestTask ) == pdPASS )\r
{\r
/* If this task is running, the test task must be in the ready state. */\r
if( eTaskStateGet( xTestTask ) != eReady )\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
1 tab == 4 spaces!\r
*/\r
\r
-/* \r
+/*\r
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
- The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+ The processor MUST be in supervisor mode when vTaskStartScheduler is\r
called. The demo applications included in the FreeRTOS.org download switch\r
to supervisor mode prior to main being called. If you are not using one of\r
these demo application projects then ensure Supervisor mode is used.\r
\r
/*\r
* Program entry point.\r
- * \r
+ *\r
* main() is responsible for setting up the microcontroller peripherals, then\r
* starting the demo application tasks. Once the tasks have been created the\r
* scheduler is started and main() should never complete.\r
\r
/*\r
* The Olimex demo board has a single built in LED. This function simply\r
- * toggles its state. \r
+ * toggles its state.\r
*/\r
void prvToggleOnBoardLED( void );\r
\r
static void prvErrorChecks( void *pvParameters );\r
\r
/*\r
- * Return true if the demo tasks are executing without error - otherwise \r
+ * Return true if the demo tasks are executing without error - otherwise\r
* return false.\r
*/\r
static void prvMainCheckOtherTasksAreStillRunning( void );\r
\r
/*\r
* Application entry point:\r
- * Starts all the other tasks, then starts the scheduler. \r
+ * Starts all the other tasks, then starts the scheduler.\r
*/\r
int main( void )\r
{\r
/* Setup the hardware for use with the Olimex demo board. */\r
prvSetupHardware();\r
\r
- /* Start the standard flash tasks so the WEB server is not the only thing \r
+ /* Start the standard flash tasks so the WEB server is not the only thing\r
running. */\r
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
vStartSemaphoreTasks( tskIDLE_PRIORITY );\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
\r
/* Start the WEB server task and the error check task. */\r
- xTaskCreate( vHTTPServerTask, ( signed char * ) "HTTP", configMINIMAL_STACK_SIZE, NULL, mainHTTP_TASK_PRIORITY, NULL );\r
- xTaskCreate( prvErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainERROR_CHECK_PRIORITY, NULL );\r
- \r
+ xTaskCreate( vHTTPServerTask, "HTTP", configMINIMAL_STACK_SIZE, NULL, mainHTTP_TASK_PRIORITY, NULL );\r
+ xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainERROR_CHECK_PRIORITY, NULL );\r
+\r
/* Now all the tasks have been started - start the scheduler.\r
\r
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
- The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+ The processor MUST be in supervisor mode when vTaskStartScheduler is\r
called. The demo applications included in the FreeRTOS.org download switch\r
to supervisor mode prior to main being called. If you are not using one of\r
these demo application projects then ensure Supervisor mode is used. */\r
SCB_MEMMAP = 2;\r
#endif\r
\r
- /* Set all GPIO to output other than the P0.14 (BSL), and the JTAG pins. \r
- The JTAG pins are left as input as I'm not sure what will happen if the \r
+ /* Set all GPIO to output other than the P0.14 (BSL), and the JTAG pins.\r
+ The JTAG pins are left as input as I'm not sure what will happen if the\r
Wiggler is connected after powerup - not that it would be a good idea to\r
do that anyway. */\r
GPIO_IODIR = ~( mainJTAG_PORT );\r
else\r
{\r
GPIO_IOSET = mainON_BOARD_LED_BIT;\r
- } \r
+ }\r
}\r
/*-----------------------------------------------------------*/\r
\r
for( ;; )\r
{\r
/* How long we delay depends on whether an error has been detected\r
- or not. Therefore the flash rate of the on board LED indicates \r
+ or not. Therefore the flash rate of the on board LED indicates\r
whether or not an error has occurred. */\r
vTaskDelay( xDelay );\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
1 tab == 4 spaces!\r
*/\r
\r
-/* \r
+/*\r
* Very simple task that responds with a single WEB page to http requests.\r
*\r
- * The WEB page displays task and system status. A semaphore is used to \r
- * wake the task when there is processing to perform as determined by the \r
+ * The WEB page displays task and system status. A semaphore is used to\r
+ * wake the task when there is processing to perform as determined by the\r
* interrupts generated by the Ethernet interface.\r
*/\r
\r
static void prvNetifInit( void );\r
\r
/*\r
- * Generate the dynamic components of the served WEB page and transmit the \r
+ * Generate the dynamic components of the served WEB page and transmit the\r
* entire page through the socket.\r
*/\r
static void prvTransmitHTTP( unsigned char socket );\r
\r
if( ( sLen = select( i, SEL_RECV ) ) > 0 )\r
{\r
- if( sLen > httpSOCKET_BUFFER_SIZE ) \r
+ if( sLen > httpSOCKET_BUFFER_SIZE )\r
{\r
sLen = httpSOCKET_BUFFER_SIZE;\r
}\r
\r
disable();\r
- \r
- sLen = recv( i, ucSocketBuffer, sLen ); \r
+\r
+ sLen = recv( i, ucSocketBuffer, sLen );\r
\r
if( ucConnection[ i ] == 1 )\r
- { \r
+ {\r
/* This is our first time processing a HTTP\r
request on this connection. */\r
prvTransmitHTTP( i );\r
/* See definition of 'sysinit' in socket.c\r
- 8 KB transmit buffer, and 8 KB receive buffer available. These buffers\r
are shared by all 4 channels.\r
- - (0x55, 0x55) configures the send and receive buffers at \r
+ - (0x55, 0x55) configures the send and receive buffers at\r
httpSOCKET_BUFFER_SIZE bytes for each of the 4 channels. */\r
sysinit( 0x55, 0x55 );\r
}\r
send( socket, ( unsigned char * ) HTML_OUTPUT_BEGIN, strlen( HTML_OUTPUT_BEGIN ) );\r
\r
/* Generate then send the table showing the status of each task. */\r
- vTaskList( ucSocketBuffer );\r
+ vTaskList( ( char * ) ucSocketBuffer );\r
send( socket, ( unsigned char * ) ucSocketBuffer, strlen( ucSocketBuffer ) );\r
\r
/* Send the number of times the idle task has looped. */\r
sprintf( ucSocketBuffer, "The tick count is 0x%08lx<br>", xTaskGetTickCount() );\r
send( socket, ( unsigned char * ) ucSocketBuffer, strlen( ucSocketBuffer ) );\r
\r
- /* Show a message indicating whether or not the check task has discovered \r
+ /* Show a message indicating whether or not the check task has discovered\r
an error in any of the standard demo tasks. */\r
if( usCheckStatus == 0 )\r
{\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
static void prvSetupLCD( void );\r
\r
-/* \r
- * Move to the first (0) or second (1) row of the LCD. \r
+/*\r
+ * Move to the first (0) or second (1) row of the LCD.\r
*/\r
static void prvLCDGotoRow( unsigned portSHORT usRow );\r
\r
-/* \r
- * Write a string of text to the LCD. \r
+/*\r
+ * Write a string of text to the LCD.\r
*/\r
static void prvLCDPutString( portCHAR *pcString );\r
\r
-/* \r
- * Clear the LCD. \r
+/*\r
+ * Clear the LCD.\r
*/\r
static void prvLCDClear( void );\r
\r
#define PMAEN *( ( unsigned short * ) 0x60c )\r
\r
/* LCD R/W signal. */\r
-#define lcdRW LATDbits.LATD5 \r
+#define lcdRW LATDbits.LATD5\r
\r
/* LCD lcdRS signal. */\r
-#define lcdRS LATBbits.LATB15 \r
+#define lcdRS LATBbits.LATB15\r
\r
/* LCD lcdE signal . */\r
-#define lcdE LATDbits.LATD4 \r
+#define lcdE LATDbits.LATD4\r
\r
/* Control signal pin direction. */\r
-#define RW_TRIS TRISDbits.TRISD5 \r
+#define RW_TRIS TRISDbits.TRISD5\r
#define RS_TRIS TRISBbits.TRISB15\r
#define E_TRIS TRISDbits.TRISD4\r
\r
/* Port for LCD data */\r
-#define lcdDATA LATE \r
+#define lcdDATA LATE\r
#define lcdDATAPORT PORTE\r
\r
/* I/O setup for data Port. */\r
-#define TRISDATA TRISE \r
+#define TRISDATA TRISE\r
\r
/* The length of the queue used to send messages to the LCD gatekeeper task. */\r
#define lcdQUEUE_SIZE 3\r
\r
/* Start the task that will write to the LCD. The LCD hardware is\r
initialised from within the task itself so delays can be used. */\r
- xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );\r
+ xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );\r
\r
return xLCDQueue;\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvLCDCommand( portCHAR cCommand ) \r
+static void prvLCDCommand( portCHAR cCommand )\r
{\r
/* Prepare RD0 - RD7. */\r
- lcdDATA &= 0xFF00; \r
+ lcdDATA &= 0xFF00;\r
\r
/* Command byte to lcd. */\r
- lcdDATA |= cCommand; \r
+ lcdDATA |= cCommand;\r
\r
/* Ensure lcdRW is 0. */\r
- lcdRW = 0; \r
+ lcdRW = 0;\r
lcdRS = 0;\r
\r
/* Toggle lcdE line. */\r
- lcdE = 1; \r
+ lcdE = 1;\r
vTaskDelay( lcdVERY_SHORT_DELAY );\r
lcdE = 0;\r
\r
static void prvLCDData( portCHAR cChar )\r
{\r
/* ensure lcdRW is 0. */\r
- lcdRW = 0; \r
+ lcdRW = 0;\r
\r
/* Assert register select to 1. */\r
- lcdRS = 1; \r
+ lcdRS = 1;\r
\r
/* Prepare RD0 - RD7. */\r
- lcdDATA &= 0xFF00; \r
+ lcdDATA &= 0xFF00;\r
\r
/* Data byte to lcd. */\r
- lcdDATA |= cChar; \r
- lcdE = 1; \r
+ lcdDATA |= cChar;\r
+ lcdE = 1;\r
Nop();\r
Nop();\r
Nop();\r
\r
/* Toggle lcdE signal. */\r
- lcdE = 0; \r
+ lcdE = 0;\r
\r
/* Negate register select to 0. */\r
- lcdRS = 0; \r
+ lcdRS = 0;\r
\r
vTaskDelay( lcdVERY_SHORT_DELAY );\r
}\r
{\r
/* Wait for proper power up. */\r
vTaskDelay( lcdLONG_DELAY );\r
- \r
+\r
/* Set initial states for the data and control pins */\r
- LATE &= 0xFF00; \r
+ LATE &= 0xFF00;\r
\r
/* R/W state set low. */\r
- lcdRW = 0; \r
+ lcdRW = 0;\r
\r
/* lcdRS state set low. */\r
- lcdRS = 0; \r
+ lcdRS = 0;\r
\r
/* lcdE state set low. */\r
- lcdE = 0; \r
+ lcdE = 0;\r
\r
/* Set data and control pins to outputs */\r
TRISE &= 0xFF00;\r
\r
/* lcdRW pin set as output. */\r
- RW_TRIS = 0; \r
+ RW_TRIS = 0;\r
\r
/* lcdRS pin set as output. */\r
- RS_TRIS = 0; \r
+ RS_TRIS = 0;\r
\r
/* lcdE pin set as output. */\r
- E_TRIS = 0; \r
+ E_TRIS = 0;\r
\r
/* 1st LCD initialization sequence */\r
lcdDATA &= 0xFF00;\r
lcdDATA |= 0x0038;\r
- lcdE = 1; \r
+ lcdE = 1;\r
Nop();\r
Nop();\r
Nop();\r
\r
/* Toggle lcdE signal. */\r
- lcdE = 0; \r
+ lcdE = 0;\r
\r
vTaskDelay( lcdSHORT_DELAY );\r
vTaskDelay( lcdSHORT_DELAY );\r
vTaskDelay( lcdSHORT_DELAY );\r
- \r
+\r
/* 2nd LCD initialization sequence */\r
lcdDATA &= 0xFF00;\r
lcdDATA |= 0x0038;\r
- lcdE = 1; \r
+ lcdE = 1;\r
+ Nop();\r
Nop();\r
Nop();\r
- Nop(); \r
\r
/* Toggle lcdE signal. */\r
- lcdE = 0; \r
+ lcdE = 0;\r
\r
vTaskDelay( lcdSHORT_DELAY );\r
\r
/* 3rd LCD initialization sequence */\r
lcdDATA &= 0xFF00;\r
lcdDATA |= 0x0038;\r
- lcdE = 1; \r
+ lcdE = 1;\r
+ Nop();\r
Nop();\r
Nop();\r
- Nop(); \r
\r
/* Toggle lcdE signal. */\r
- lcdE = 0; \r
+ lcdE = 0;\r
\r
vTaskDelay( lcdSHORT_DELAY );\r
\r
\r
/* Function set. */\r
- prvLCDCommand( 0x38 ); \r
+ prvLCDCommand( 0x38 );\r
\r
/* Display on/off control, cursor blink off (0x0C). */\r
- prvLCDCommand( 0x0C ); \r
+ prvLCDCommand( 0x0C );\r
\r
/* Entry mode set (0x06). */\r
- prvLCDCommand( 0x06 ); \r
+ prvLCDCommand( 0x06 );\r
\r
- prvLCDCommand( lcdCLEAR ); \r
+ prvLCDCommand( lcdCLEAR );\r
}\r
/*-----------------------------------------------------------*/\r
\r
usRow++;\r
prvLCDPutString( xMessage.pcMessage );\r
\r
- /* Delay the requested amount of time to ensure the text just written \r
+ /* Delay the requested amount of time to ensure the text just written\r
to the LCD is not overwritten. */\r
- vTaskDelay( xMessage.xMinDisplayTime ); \r
+ vTaskDelay( xMessage.xMinDisplayTime );\r
}\r
}\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* defined and/or created within this file:\r
*\r
* "Fast Interrupt Test" - A high frequency periodic interrupt is generated\r
- * using a free running timer to demonstrate the use of the \r
- * configKERNEL_INTERRUPT_PRIORITY configuration constant. The interrupt \r
+ * using a free running timer to demonstrate the use of the\r
+ * configKERNEL_INTERRUPT_PRIORITY configuration constant. The interrupt\r
* service routine measures the number of processor clocks that occur between\r
- * each interrupt - and in so doing measures the jitter in the interrupt \r
- * timing. The maximum measured jitter time is latched in the usMaxJitter \r
- * variable, and displayed on the LCD by the 'Check' as described below. \r
- * The fast interrupt is configured and handled in the timer_test.c source \r
+ * each interrupt - and in so doing measures the jitter in the interrupt\r
+ * timing. The maximum measured jitter time is latched in the usMaxJitter\r
+ * variable, and displayed on the LCD by the 'Check' as described below.\r
+ * The fast interrupt is configured and handled in the timer_test.c source\r
* file.\r
*\r
* "LCD" task - the LCD task is a 'gatekeeper' task. It is the only task that\r
* is permitted to access the LCD directly. Other tasks wishing to write a\r
- * message to the LCD send the message on a queue to the LCD task instead of \r
- * accessing the LCD themselves. The LCD task just blocks on the queue waiting \r
+ * message to the LCD send the message on a queue to the LCD task instead of\r
+ * accessing the LCD themselves. The LCD task just blocks on the queue waiting\r
* for messages - waking and displaying the messages as they arrive. The LCD\r
- * task is defined in lcd.c. \r
- * \r
- * "Check" task - This only executes every three seconds but has the highest \r
- * priority so is guaranteed to get processor time. Its main function is to \r
+ * task is defined in lcd.c.\r
+ *\r
+ * "Check" task - This only executes every three seconds but has the highest\r
+ * priority so is guaranteed to get processor time. Its main function is to\r
* check that all the standard demo tasks are still operational. Should any\r
* unexpected behaviour within a demo task be discovered the 'check' task will\r
- * write "FAIL #n" to the LCD (via the LCD task). If all the demo tasks are \r
+ * write "FAIL #n" to the LCD (via the LCD task). If all the demo tasks are\r
* executing with their expected behaviour then the check task writes the max\r
* jitter time to the LCD (again via the LCD task), as described above.\r
*/\r
prvSetupHardware();\r
\r
/* Create the standard demo tasks. */\r
- vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); \r
+ vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
vCreateBlockTimeTasks();\r
\r
/* Create the test tasks defined within this file. */\r
- xTaskCreate( vCheckTask, ( signed char * ) "Check", mainCHECK_TAKS_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ xTaskCreate( vCheckTask, "Check", mainCHECK_TAKS_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the task that will control the LCD. This returns the handle\r
to the queue used to write text out to the task. */\r
static void vCheckTask( void *pvParameters )\r
{\r
/* Used to wake the task at the correct frequency. */\r
-portTickType xLastExecutionTime; \r
+portTickType xLastExecutionTime;\r
\r
/* The maximum jitter time measured by the fast interrupt test. */\r
extern unsigned short usMaxJitter ;\r
usErrorDetected = pdTRUE;\r
sprintf( cStringBuffer, "FAIL #1" );\r
}\r
- \r
+\r
if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
usErrorDetected = pdTRUE;\r
strcat( cDynamicPage, "<p><pre>Task State Priority Stack #<br>************************************************<br>" );\r
\r
/* ... Then the list of tasks and their status... */\r
- vTaskList( ( signed portCHAR * ) cDynamicPage + strlen( cDynamicPage ) );\r
+ vTaskList( cDynamicPage + strlen( cDynamicPage ) );\r
\r
/* ... Finally the page footer. */\r
strcat( cDynamicPage, webHTML_END );\r
vTaskPrioritySet( NULL, uxPriority );\r
\r
/* Create the task that handles the MACB. */\r
- // xTaskCreate( ethernetif_input, ( signed portCHAR * ) "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );\r
+ // xTaskCreate( ethernetif_input, "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );\r
sys_thread_new( ethernetif_input, NULL, netifINTERFACE_TASK_PRIORITY );\r
}\r
\r
#define archMESG_QUEUE_LENGTH ( 6 )\r
#define archPOST_BLOCK_TIME_MS ( ( unsigned portLONG ) 10000 )\r
\r
-struct timeoutlist \r
+struct timeoutlist\r
{\r
struct sys_timeouts timeouts;\r
xTaskHandle pid;\r
// Posts the "msg" to the mailbox.\r
void\r
sys_mbox_post(sys_mbox_t mbox, void *data)\r
-{ \r
+{\r
xQueueSend( mbox, &data, ( portTickType ) ( archPOST_BLOCK_TIME_MS / portTICK_RATE_MS ) );\r
}\r
\r
timeout.\r
\r
Note that a function with a similar name, sys_mbox_fetch(), is\r
- implemented by lwIP. \r
+ implemented by lwIP.\r
*/\r
u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)\r
{\r
{\r
msg = &dummyptr;\r
}\r
- \r
+\r
if( timeout != 0 )\r
{\r
if(pdTRUE == xQueueReceive( mbox, &(*msg), timeout ) )\r
}\r
\r
return ( Elapsed ); // return time blocked\r
- \r
+\r
}\r
}\r
\r
each thread has a list of timeouts which is represented as a linked\r
list of sys_timeout structures. The sys_timeouts structure holds a\r
pointer to a linked list of timeouts. This function is called by\r
- the lwIP timeout scheduler and must not return a NULL value. \r
+ the lwIP timeout scheduler and must not return a NULL value.\r
\r
In a single threaded sys_arch implementation, this function will\r
simply return a pointer to a global sys_timeouts variable stored in\r
{\r
int i;\r
xTaskHandle pid;\r
-struct timeoutlist *tl; \r
+struct timeoutlist *tl;\r
\r
pid = xTaskGetCurrentTaskHandle( );\r
\r
\r
/*-----------------------------------------------------------------------------------*/\r
/*-----------------------------------------------------------------------------------*/\r
-// TBD \r
+// TBD\r
/*-----------------------------------------------------------------------------------*/\r
/*\r
Starts a new thread with priority "prio" that will begin its execution in the\r
\r
if( thread == ethernetif_input )\r
{\r
- result = xTaskCreate( thread, ( signed portCHAR * ) "ETHINT", netifINTERFACE_TASK_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "ETHINT", netifINTERFACE_TASK_STACK_SIZE, arg, prio, &CreatedTask );\r
}\r
else if( iCall == 0 )\r
{\r
/* The first time this is called we are creating the lwIP handler. */\r
- result = xTaskCreate( thread, ( signed portCHAR * ) "lwIP", lwipINTERFACE_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "lwIP", lwipINTERFACE_STACK_SIZE, arg, prio, &CreatedTask );\r
iCall++;\r
}\r
#if (HTTP_USED == 1)\r
else if (thread == vBasicWEBServer)\r
{\r
- result = xTaskCreate( thread, ( signed portCHAR * ) "WEB", lwipBASIC_WEB_SERVER_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "WEB", lwipBASIC_WEB_SERVER_STACK_SIZE, arg, prio, &CreatedTask );\r
}\r
#endif\r
#if (TFTP_USED == 1)\r
else if (thread == vBasicTFTPServer)\r
{\r
- result = xTaskCreate( thread, ( signed portCHAR * ) "TFTP", lwipBASIC_TFTP_SERVER_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "TFTP", lwipBASIC_TFTP_SERVER_STACK_SIZE, arg, prio, &CreatedTask );\r
}\r
#endif\r
#if (SMTP_USED == 1)\r
else if (thread == vBasicSMTPClient)\r
{\r
- result = xTaskCreate( thread, ( signed portCHAR * ) "SMTP", lwipBASIC_SMTP_CLIENT_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "SMTP", lwipBASIC_SMTP_CLIENT_STACK_SIZE, arg, prio, &CreatedTask );\r
}\r
#endif\r
\r
an operating system.\r
*/\r
void sys_arch_unprotect(sys_prot_t pval)\r
-{ \r
+{\r
( void ) pval;\r
vPortExitCritical();\r
}\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
Changes from V3.2.2\r
\r
- + Changed the page returned by the lwIP WEB server demo to display the \r
+ + Changed the page returned by the lwIP WEB server demo to display the\r
task status table rather than the TCP/IP statistics.\r
*/\r
\r
#include "SAM7_EMAC.h"\r
\r
/* lwIP includes. */\r
-#include "lwip/api.h" \r
+#include "lwip/api.h"\r
#include "lwip/tcpip.h"\r
-#include "lwip/memp.h" \r
+#include "lwip/memp.h"\r
#include "lwip/stats.h"\r
#include "netif/loopif.h"\r
\r
\r
/*------------------------------------------------------------*/\r
\r
-/* \r
+/*\r
* Process an incoming connection on port 80.\r
*\r
* This simply checks to see if the incoming data contains a GET request, and\r
* if so sends back a single dynamically created page. The connection is then\r
- * closed. A more complete implementation could create a task for each \r
- * connection. \r
+ * closed. A more complete implementation could create a task for each\r
+ * connection.\r
*/\r
static void vProcessConnection( struct netconn *pxNetCon );\r
\r
if( pxRxBuffer != NULL )\r
{\r
/* Where is the data? */\r
- netbuf_data( pxRxBuffer, ( void * ) &pcRxString, &usLength ); \r
- \r
+ netbuf_data( pxRxBuffer, ( void * ) &pcRxString, &usLength );\r
+\r
/* Is this a GET? We don't handle anything else. */\r
if( !strncmp( pcRxString, "GET", 3 ) )\r
{\r
strcat( cDynamicPage, cPageHits );\r
strcat( cDynamicPage, "<p><pre>Task State Priority Stack #<br>************************************************<br>" );\r
/* ... Then the list of tasks and their status... */\r
- vTaskList( ( signed char * ) cDynamicPage + strlen( cDynamicPage ) ); \r
+ vTaskList( cDynamicPage + strlen( cDynamicPage ) );\r
/* ... Finally the page footer. */\r
strcat( cDynamicPage, webHTML_END );\r
\r
/* Write out the dynamically generated page. */\r
netconn_write(pxNetCon, cDynamicPage, (u16_t)strlen( cDynamicPage ), NETCONN_COPY );\r
}\r
- \r
+\r
netbuf_delete( pxRxBuffer );\r
}\r
\r
{\r
/* Initialize lwIP and its interface layer. */\r
sys_init();\r
- mem_init(); \r
+ mem_init();\r
memp_init();\r
- pbuf_init(); \r
+ pbuf_init();\r
netif_init();\r
ip_init();\r
tcpip_init( NULL, NULL );\r
\r
/* bring it up */\r
netif_set_up(&EMAC_if);\r
- \r
+\r
/* Create a new tcp connection handle */\r
\r
pxHTTPListener = netconn_new( NETCONN_TCP );\r
/*\r
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.\r
- * All rights reserved. \r
- * \r
- * Redistribution and use in source and binary forms, with or without modification, \r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without modification,\r
* are permitted provided that the following conditions are met:\r
*\r
* 1. Redistributions of source code must retain the above copyright notice,\r
* this list of conditions and the following disclaimer in the documentation\r
* and/or other materials provided with the distribution.\r
* 3. The name of the author may not be used to endorse or promote products\r
- * derived from this software without specific prior written permission. \r
+ * derived from this software without specific prior written permission.\r
*\r
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED \r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF \r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT \r
- * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \r
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \r
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING \r
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY \r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\r
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\r
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\r
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY\r
* OF SUCH DAMAGE.\r
*\r
* This file is part of the lwIP TCP/IP stack.\r
- * \r
+ *\r
* Author: Adam Dunkels <adam@sics.se>\r
*\r
*/\r
#define archMESG_QUEUE_LENGTH ( 6 )\r
#define archPOST_BLOCK_TIME_MS ( ( unsigned long ) 10000 )\r
\r
-struct timeoutlist \r
+struct timeoutlist\r
{\r
struct sys_timeouts timeouts;\r
xTaskHandle pid;\r
__asm volatile ( "NOP" );\r
}\r
\r
- vQueueDelete( mbox ); \r
+ vQueueDelete( mbox );\r
}\r
\r
/*-----------------------------------------------------------------------------------*/\r
// Posts the "msg" to the mailbox.\r
void\r
sys_mbox_post(sys_mbox_t mbox, void *data)\r
-{ \r
+{\r
xQueueSend( mbox, &data, ( portTickType ) ( archPOST_BLOCK_TIME_MS / portTICK_RATE_MS ) );\r
}\r
\r
timeout.\r
\r
Note that a function with a similar name, sys_mbox_fetch(), is\r
- implemented by lwIP. \r
+ implemented by lwIP.\r
*/\r
u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)\r
{\r
{\r
msg = &dummyptr;\r
}\r
- \r
+\r
if( timeout != 0 )\r
{\r
if(pdTRUE == xQueueReceive( mbox, &(*msg), timeout ) )\r
{\r
Elapsed = 1;\r
}\r
- return ( Elapsed ); // return time blocked TBD test \r
+ return ( Elapsed ); // return time blocked TBD test\r
}\r
}\r
\r
{\r
Elapsed = 1;\r
}\r
- return (Elapsed); // return time blocked TBD test \r
+ return (Elapsed); // return time blocked TBD test\r
}\r
else\r
{\r
Elapsed = 1;\r
}\r
\r
- return ( Elapsed ); // return time blocked \r
- \r
+ return ( Elapsed ); // return time blocked\r
+\r
}\r
}\r
\r
void\r
sys_sem_free(sys_sem_t sem)\r
{\r
- vQueueDelete( sem ); \r
+ vQueueDelete( sem );\r
}\r
\r
/*-----------------------------------------------------------------------------------*/\r
each thread has a list of timeouts which is represented as a linked\r
list of sys_timeout structures. The sys_timeouts structure holds a\r
pointer to a linked list of timeouts. This function is called by\r
- the lwIP timeout scheduler and must not return a NULL value. \r
+ the lwIP timeout scheduler and must not return a NULL value.\r
\r
In a single threaded sys_arch implementation, this function will\r
simply return a pointer to a global sys_timeouts variable stored in\r
{\r
int i;\r
xTaskHandle pid;\r
-struct timeoutlist *tl; \r
+struct timeoutlist *tl;\r
\r
- pid = xTaskGetCurrentTaskHandle( ); \r
+ pid = xTaskGetCurrentTaskHandle( );\r
\r
- for(i = 0; i < nextthread; i++) \r
+ for(i = 0; i < nextthread; i++)\r
{\r
tl = &timeoutlist[i];\r
- if(tl->pid == pid) \r
+ if(tl->pid == pid)\r
{\r
return &(tl->timeouts);\r
}\r
\r
/*-----------------------------------------------------------------------------------*/\r
/*-----------------------------------------------------------------------------------*/\r
-// TBD \r
+// TBD\r
/*-----------------------------------------------------------------------------------*/\r
/*\r
Starts a new thread with priority "prio" that will begin its execution in the\r
if( iCall == 0 )\r
{\r
/* The first time this is called we are creating the lwIP handler. */\r
- result = xTaskCreate( thread, ( signed char * ) "lwIP", lwipTCP_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "lwIP", lwipTCP_STACK_SIZE, arg, prio, &CreatedTask );\r
iCall++;\r
}\r
else\r
{\r
- result = xTaskCreate( thread, ( signed char * ) "WEBSvr", lwipBASIC_SERVER_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "WEBSvr", lwipBASIC_SERVER_STACK_SIZE, arg, prio, &CreatedTask );\r
}\r
\r
// For each task created, store the task handle (pid) in the timers array.\r
an operating system.\r
*/\r
void sys_arch_unprotect(sys_prot_t pval)\r
-{ \r
+{\r
( void ) pval;\r
vPortExitCritical();\r
}\r
\r
xNetIf = netif;\r
\r
- /* Initialise the EMAC. This routine contains code that polls status bits. \r
- If the Ethernet cable is not plugged in then this can take a considerable \r
+ /* Initialise the EMAC. This routine contains code that polls status bits.\r
+ If the Ethernet cable is not plugged in then this can take a considerable\r
time. To prevent this starving lower priority tasks of processing time we\r
lower our priority prior to the call, then raise it back again once the\r
initialisation is complete. */\r
vTaskPrioritySet( NULL, uxPriority );\r
\r
/* Create the task that handles the EMAC. */\r
- xTaskCreate( ethernetif_input, ( signed char * ) "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );\r
+ xTaskCreate( ethernetif_input, "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * low_level_output(): Should do the actual transmission of the packet. The \r
- * packet is contained in the pbuf that is passed to the function. This pbuf \r
+ * low_level_output(): Should do the actual transmission of the packet. The\r
+ * packet is contained in the pbuf that is passed to the function. This pbuf\r
* might be chained.\r
*/\r
static err_t low_level_output( struct netif *netif, struct pbuf *p )\r
{\r
for( q = p; q != NULL; q = q->next )\r
{\r
- /* Send the data from the pbuf to the interface, one pbuf at a \r
- time. The size of the data in each pbuf is kept in the ->len \r
+ /* Send the data from the pbuf to the interface, one pbuf at a\r
+ time. The size of the data in each pbuf is kept in the ->len\r
variable. if q->next == NULL then this is the last pbuf in the\r
chain. */\r
if( !lEMACSend( q->payload, q->len, ( q->next == NULL ) ) )\r
\r
xSemaphoreGive( xTxSemaphore );\r
}\r
- \r
+\r
\r
#if ETH_PAD_SIZE\r
pbuf_header( p, ETH_PAD_SIZE ); /* reclaim the padding word */\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * low_level_input(): Should allocate a pbuf and transfer the bytes of the \r
- * incoming packet from the interface into the pbuf. \r
+ * low_level_input(): Should allocate a pbuf and transfer the bytes of the\r
+ * incoming packet from the interface into the pbuf.\r
*/\r
static struct pbuf *low_level_input( struct netif *netif )\r
{\r
{\r
/* Obtain the size of the packet. */\r
len = ulEMACInputLength();\r
- \r
+\r
if( len )\r
{\r
#if ETH_PAD_SIZE\r
len += ETH_PAD_SIZE; /* allow room for Ethernet padding */\r
#endif\r
- \r
+\r
/* We allocate a pbuf chain of pbufs from the pool. */\r
p = pbuf_alloc( PBUF_RAW, len, PBUF_POOL );\r
- \r
+\r
if( p != NULL )\r
{\r
#if ETH_PAD_SIZE\r
pbuf_header( p, -ETH_PAD_SIZE ); /* drop the padding word */\r
#endif\r
- \r
+\r
/* Let the driver know we are going to read a new packet. */\r
vEMACRead( NULL, 0, len );\r
- \r
+\r
/* We iterate over the pbuf chain until we have read the entire\r
- packet into the pbuf. */ \r
+ packet into the pbuf. */\r
for( q = p; q != NULL; q = q->next )\r
{\r
- /* Read enough bytes to fill this pbuf in the chain. The \r
+ /* Read enough bytes to fill this pbuf in the chain. The\r
available data in the pbuf is given by the q->len variable. */\r
vEMACRead( q->payload, q->len, len );\r
}\r
- \r
+\r
#if ETH_PAD_SIZE\r
pbuf_header( p, ETH_PAD_SIZE ); /* reclaim the padding word */\r
#endif\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * ethernetif_output(): This function is called by the TCP/IP stack when an \r
- * IP packet should be sent. It calls the function called low_level_output() \r
+ * ethernetif_output(): This function is called by the TCP/IP stack when an\r
+ * IP packet should be sent. It calls the function called low_level_output()\r
* to do the actual transmission of the packet.\r
*/\r
static err_t ethernetif_output( struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr )\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * ethernetif_input(): This function should be called when a packet is ready to \r
- * be read from the interface. It uses the function low_level_input() that \r
+ * ethernetif_input(): This function should be called when a packet is ready to\r
+ * be read from the interface. It uses the function low_level_input() that\r
* should handle the actual reception of bytes from the network interface.\r
*/\r
static void ethernetif_input( void * pvParameters )\r
\r
if( p == NULL )\r
{\r
- /* No packet could be read. Wait a for an interrupt to tell us \r
+ /* No packet could be read. Wait a for an interrupt to tell us\r
there is more data available. */\r
vEMACWaitForInput();\r
}\r
\r
} while( p == NULL );\r
- \r
+\r
/* points to packet payload, which starts with an Ethernet header */\r
ethhdr = p->payload;\r
- \r
+\r
#if LINK_STATS\r
lwip_stats.link.recv++;\r
#endif /* LINK_STATS */\r
- \r
+\r
ethhdr = p->payload;\r
- \r
+\r
switch( htons( ethhdr->type ) )\r
{\r
/* IP packet? */\r
case ETHTYPE_IP:\r
/* update ARP table */\r
etharp_ip_input( xNetIf, p );\r
- \r
+\r
/* skip Ethernet header */\r
pbuf_header( p, (s16_t)-sizeof(struct eth_hdr) );\r
- \r
+\r
/* pass to network layer */\r
xNetIf->input( p, xNetIf );\r
break;\r
- \r
+\r
case ETHTYPE_ARP:\r
/* pass p to ARP module */\r
etharp_arp_input( xNetIf, ethernetif->ethaddr, p );\r
break;\r
- \r
+\r
default:\r
pbuf_free( p );\r
p = NULL;\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
1 tab == 4 spaces!\r
*/\r
\r
-/* \r
+/*\r
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
- The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+ The processor MUST be in supervisor mode when vTaskStartScheduler is\r
called. The demo applications included in the FreeRTOS.org download switch\r
to supervisor mode prior to main being called. If you are not using one of\r
these demo application projects then ensure Supervisor mode is used.\r
/*\r
* Creates all the application tasks, then starts the scheduler.\r
*\r
- * A task defined by the function vBasicWEBServer is created. This executes \r
+ * A task defined by the function vBasicWEBServer is created. This executes\r
* the lwIP stack and basic WEB server sample. A task defined by the function\r
- * vUSBCDCTask. This executes the USB to serial CDC example. All the other \r
- * tasks are from the set of standard demo tasks. The WEB documentation \r
+ * vUSBCDCTask. This executes the USB to serial CDC example. All the other\r
+ * tasks are from the set of standard demo tasks. The WEB documentation\r
* provides more details of the standard demo application tasks.\r
*\r
* Main.c also creates a task called "Check". This only executes every three\r
/*\r
Changes from V3.2.2\r
\r
- + Modified the stack sizes used by some tasks to permit use of the \r
+ + Modified the stack sizes used by some tasks to permit use of the\r
command line GCC tools.\r
*/\r
\r
#include "USB-CDC.h"\r
\r
/* lwIP includes. */\r
-#include "lwip/api.h" \r
+#include "lwip/api.h"\r
\r
/* Hardware specific headers. */\r
#include "Board.h"\r
sys_thread_new( vBasicWEBServer, ( void * ) NULL, mainWEBSERVER_PRIORITY );\r
\r
/* Create the demo USB CDC task. */\r
- xTaskCreate( vUSBCDCTask, ( signed char * ) "USB", mainUSB_TASK_STACK, NULL, mainUSB_PRIORITY, NULL );\r
+ xTaskCreate( vUSBCDCTask, "USB", mainUSB_TASK_STACK, NULL, mainUSB_PRIORITY, NULL );\r
\r
/* Create the standard demo application tasks. */\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
\r
- /* Start the check task - which is defined in this file. */ \r
- xTaskCreate( vErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+ /* Start the check task - which is defined in this file. */\r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
- /* Finally, start the scheduler. \r
+ /* Finally, start the scheduler.\r
\r
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
- The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+ The processor MUST be in supervisor mode when vTaskStartScheduler is\r
called. The demo applications included in the FreeRTOS.org download switch\r
to supervisor mode prior to main being called. If you are not using one of\r
these demo application projects then ensure Supervisor mode is used here. */\r
the correct default state. This line just ensures that this does not\r
cause all interrupts to be masked at the start. */\r
AT91C_BASE_AIC->AIC_EOICR = 0;\r
- \r
+\r
/* Most setup is performed by the low level init function called from the\r
startup asm file.\r
\r
/* Delay until it is time to execute again. The delay period is\r
shorter following an error. */\r
vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );\r
- \r
+\r
/* Check all the standard demo application tasks are executing without\r
error. */\r
if( prvCheckOtherTasksAreStillRunning() != pdPASS )\r
for( cTxByte = mainFIRST_TX_CHAR; cTxByte <= mainLAST_TX_CHAR; cTxByte++ )\r
{\r
vUSBSendByte( cTxByte );\r
- } \r
+ }\r
}\r
}\r
\r
Please ensure to read the configuration and relevant port sections of the\r
online documentation.\r
\r
- http://www.FreeRTOS.org - Documentation, latest information, license and \r
+ http://www.FreeRTOS.org - Documentation, latest information, license and\r
contact details.\r
\r
- http://www.SafeRTOS.com - A version that is certified for use in safety \r
+ http://www.SafeRTOS.com - A version that is certified for use in safety\r
critical systems.\r
\r
- http://www.OpenRTOS.com - Commercial support, development, porting, \r
+ http://www.OpenRTOS.com - Commercial support, development, porting,\r
licensing and training services.\r
*/\r
\r
( void )sys_thread_new( vBasicWEBServer, NULL, mainWEB_TASK_PRIORITY );\r
\r
/* Start the check task - which is defined in this file. */\r
- xTaskCreate( vErrorChecks, ( signed char * )"Check", 512, NULL,\r
+ xTaskCreate( vErrorChecks, "Check", 512, NULL,\r
mainCHECK_TASK_PRIORITY, NULL );\r
/* Now all the tasks have been started - start the scheduler. */\r
vTaskStartScheduler( );\r
{\r
ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE;\r
xCreatedTask = mainNO_TASK;\r
- if( xTaskCreate( vMemCheckTask, ( signed char * )"MEM",\r
+ if( xTaskCreate( vMemCheckTask, "MEM",\r
configMINIMAL_STACK_SIZE, ( void * )&ulMemCheckTaskRunningCount,\r
tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )\r
{\r
Please ensure to read the configuration and relevant port sections of the\r
online documentation.\r
\r
- http://www.FreeRTOS.org - Documentation, latest information, license and \r
+ http://www.FreeRTOS.org - Documentation, latest information, license and\r
contact details.\r
\r
- http://www.SafeRTOS.com - A version that is certified for use in safety \r
+ http://www.SafeRTOS.com - A version that is certified for use in safety\r
critical systems.\r
\r
- http://www.OpenRTOS.com - Commercial support, development, porting, \r
+ http://www.OpenRTOS.com - Commercial support, development, porting,\r
licensing and training services.\r
*/\r
\r
strcat( cDynamicPage,\r
"<p><pre>Task State Priority Stack #<br>************************************************<br>" );\r
/* ... Then the list of tasks and their status... */\r
- vTaskList( ( signed char * )cDynamicPage + strlen( cDynamicPage ) );\r
+ vTaskList( cDynamicPage + strlen( cDynamicPage ) );\r
/* ... Finally the page footer. */\r
strcat( cDynamicPage, webHTML_END );\r
\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
/*\r
* Creates all the demo application tasks, then starts the scheduler. The WEB\r
* documentation provides more details of the demo application tasks.\r
- * \r
+ *\r
* This demo is configured to execute on the ES449 prototyping board from\r
* SoftBaugh. The ES449 has a built in LCD display and a single built in user\r
* LED. Therefore, in place of flashing an LED, the 'flash' and 'check' tasks\r
* toggle '*' characters on the LCD. The left most '*' represents LED 0, the\r
* next LED 1, etc.\r
*\r
- * Main. c also creates a task called 'Check'. This only executes every three \r
- * seconds but has the highest priority so is guaranteed to get processor time. \r
- * Its main function is to check that all the other tasks are still operational. \r
- * Each task that does not flash an LED maintains a unique count that is \r
- * incremented each time the task successfully completes its function. Should \r
- * any error occur within such a task the count is permanently halted. The \r
+ * Main. c also creates a task called 'Check'. This only executes every three\r
+ * seconds but has the highest priority so is guaranteed to get processor time.\r
+ * Its main function is to check that all the other tasks are still operational.\r
+ * Each task that does not flash an LED maintains a unique count that is\r
+ * incremented each time the task successfully completes its function. Should\r
+ * any error occur within such a task the count is permanently halted. The\r
* 'check' task inspects the count of each task to ensure it has changed since\r
- * the last time the check task executed. If all the count variables have \r
+ * the last time the check task executed. If all the count variables have\r
* changed all the tasks are still executing error free, and the check task\r
- * toggles an LED with a three second period. Should any task contain an error \r
+ * toggles an LED with a three second period. Should any task contain an error\r
* at any time the LED toggle rate will increase to 500ms.\r
*\r
* Please read the documentation for the MSP430 port available on\r
/* Baud rate used by the COM test tasks. */\r
#define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 19200 )\r
\r
-/* The frequency at which the 'Check' tasks executes. See the comments at the \r
+/* The frequency at which the 'Check' tasks executes. See the comments at the\r
top of the page. When the system is operating error free the 'Check' task\r
toggles an LED every three seconds. If an error is discovered in any task the\r
-rate is increased to 500 milliseconds. [in this case the '*' characters on the \r
+rate is increased to 500 milliseconds. [in this case the '*' characters on the\r
LCD represent LED's]*/\r
#define mainNO_ERROR_CHECK_DELAY ( ( portTickType ) 3000 / portTICK_RATE_MS )\r
#define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS )\r
#define intgCONST4 ( ( long ) 7 )\r
#define intgEXPECTED_ANSWER ( ( ( intgCONST1 + intgCONST2 ) * intgCONST3 ) / intgCONST4 )\r
\r
-/* \r
+/*\r
* The function that implements the Check task. See the comments at the head\r
* of the page for implementation details.\r
- */ \r
+ */\r
static void vErrorChecks( void *pvParameters );\r
\r
/*\r
*/\r
static short prvCheckOtherTasksAreStillRunning( void );\r
\r
-/* \r
+/*\r
* Perform the hardware setup required by the ES449 in order to run the demo\r
* application.\r
*/\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
\r
/* Start the 'Check' task which is defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const signed char * const ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); \r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
for( ;; )\r
{\r
/* Wait until it is time to check again. The time we wait here depends\r
- on whether an error has been detected or not. When an error is \r
+ on whether an error has been detected or not. When an error is\r
detected the time is shortened resulting in a faster LED flash rate. */\r
vTaskDelay( xDelayPeriod );\r
\r
/* See if the other tasks are all ok. */\r
if( prvCheckOtherTasksAreStillRunning() != pdPASS )\r
{\r
- /* An error occurred in one of the tasks so shorten the delay \r
+ /* An error occurred in one of the tasks so shorten the delay\r
period - which has the effect of increasing the frequency of the\r
LED toggle. */\r
xDelayPeriod = mainERROR_CHECK_DELAY;\r
static unsigned long ulLastIdleLoopCount = 0UL;\r
\r
/* The demo tasks maintain a count that increments every cycle of the task\r
- provided that the task has never encountered an error. This function \r
+ provided that the task has never encountered an error. This function\r
checks the counts maintained by the tasks to ensure they are still being\r
incremented. A count remaining at the same value between calls therefore\r
indicates that an error has been detected. Only tasks that do not flash\r
{\r
ulLastIdleLoopCount = ulIdleLoops;\r
}\r
- \r
+\r
return sNoErrorFound;\r
}\r
/*-----------------------------------------------------------*/\r
WDTCTL = WDTPW + WDTHOLD;\r
\r
/* Setup DCO+ for ( xtal * D * (N + 1) ) operation. */\r
- FLL_CTL0 |= DCOPLUS + XCAP18PF; \r
+ FLL_CTL0 |= DCOPLUS + XCAP18PF;\r
\r
/* X2 DCO frequency, 8MHz nominal DCO */\r
- SCFI0 |= FN_4; \r
+ SCFI0 |= FN_4;\r
\r
/* (121+1) x 32768 x 2 = 7.99 Mhz */\r
SCFQCTL = mainMAX_FREQUENCY;\r
lValue *= intgCONST3;\r
lValue /= intgCONST4;\r
\r
- /* If the calculation is found to be incorrect we stop setting the \r
- TaskHasExecuted variable so the check task can see an error has \r
+ /* If the calculation is found to be incorrect we stop setting the\r
+ TaskHasExecuted variable so the check task can see an error has\r
occurred. */\r
if( lValue != intgEXPECTED_ANSWER ) /*lint !e774 volatile used to prevent this being optimised out. */\r
{\r
/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
\r
/* Start the 'Check' task which is defined in this file. */\r
- xTaskCreate( vErrorChecks, ( const signed portCHAR * const ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); \r
+ xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
/* Start the scheduler. */\r
vTaskStartScheduler();\r
{\r
ulLastIdleLoopCount = ulIdleLoops;\r
}\r
- \r
+\r
return sNoErrorFound;\r
}\r
/*-----------------------------------------------------------*/\r