summaryrefslogtreecommitdiff
path: root/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/main.c')
-rw-r--r--FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/main.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/main.c b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/main.c
index db025bebe..e7062c689 100644
--- a/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/main.c
+++ b/FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/main.c
@@ -1,5 +1,5 @@
/*
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
@@ -251,9 +251,9 @@ typedef struct
/*-----------------------------------------------------------*/
-/* The linker script can be used to test the FreeRTOS ports use of 20bit
-addresses by locating all code in high memory. The following pragma ensures
-that main remains in low memory when that is done. The ISR_CODE segment is used
+/* The linker script can be used to test the FreeRTOS ports use of 20bit
+addresses by locating all code in high memory. The following pragma ensures
+that main remains in low memory when that is done. The ISR_CODE segment is used
for convenience as ISR functions are always placed in low memory. */
#pragma location="ISR_CODE"
void main( void )
@@ -278,22 +278,22 @@ void main( void )
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartDynamicPriorityTasks();
vStartGenericQueueTasks( mainGENERIC_QUEUE_TEST_PRIORITY );
-
+
/* Create the LCD, button poll and register test tasks, as described at
the top of this file. */
- xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL );
- xTaskCreate( prvButtonPollTask, ( signed char * ) "BPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
- xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
- xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
+ xTaskCreate( prvLCDTask, "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL );
+ xTaskCreate( prvButtonPollTask, "BPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
+ xTaskCreate( vRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
+ xTaskCreate( vRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
/* Start the scheduler. */
vTaskStartScheduler();
}
-
+
/* If all is well then this line will never be reached. If it is reached
then it is likely that there was insufficient (FreeRTOS) heap memory space
to create the idle task. This may have been trapped by the malloc() failed
- hook function, if one is configured. */
+ hook function, if one is configured. */
for( ;; );
}
/*-----------------------------------------------------------*/
@@ -313,19 +313,19 @@ unsigned char ucLine = 1;
/* This function is the only function that uses printf(). If printf() is
used from any other function then some sort of mutual exclusion on stdout
will be necessary.
-
+
This is also the only function that is permitted to access the LCD.
-
+
First print out the number of bytes that remain in the FreeRTOS heap. This
can be viewed in the terminal IO window within the IAR Embedded Workbench. */
printf( "%d bytes of heap space remain unallocated\n", ( int ) xPortGetFreeHeapSize() );
-
+
/* Just as a test of the port, and for no functional reason, check the task
parameter contains its expected value. */
if( pvParameters != mainTASK_PARAMETER_CHECK_VALUE )
{
halLcdPrintLine( "Invalid parameter", ucLine, OVERWRITE_TEXT );
- ucLine++;
+ ucLine++;
}
for( ;; )
@@ -343,7 +343,7 @@ unsigned char ucLine = 1;
halLcdClearScreen();
ucLine = 0;
}
-
+
/* What is this message? What does it contain? */
switch( xReceivedMessage.cMessageID )
{
@@ -362,9 +362,9 @@ unsigned char ucLine = 1;
the terminal IO window in the IAR
embedded workbench. */
printf( "\nTask\t Abs Time\t %%Time\n*****************************************" );
- vTaskGetRunTimeStats( ( signed char * ) cBuffer );
+ vTaskGetRunTimeStats( cBuffer );
printf( cBuffer );
-
+
/* Also print out a message to
the LCD - in this case the
pointer to the string to print
@@ -375,7 +375,7 @@ unsigned char ucLine = 1;
technique. */
sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.ulMessageValue );
break;
-
+
case mainMESSAGE_STATUS : /* The tick interrupt hook
function has just informed this
task of the system status.
@@ -383,11 +383,11 @@ unsigned char ucLine = 1;
with the status value. */
prvGenerateStatusMessage( cBuffer, xReceivedMessage.ulMessageValue );
break;
-
+
default : sprintf( cBuffer, "Unknown message" );
break;
}
-
+
/* Output the message that was placed into the cBuffer array within the
switch statement above, then move onto the next line ready for the next
message to arrive on the queue. */
@@ -430,13 +430,13 @@ xQueueMessage xMessage;
{
/* Check the button state. */
ucState = ( halButtonsPressed() & BUTTON_UP );
-
+
if( ucState != 0 )
{
/* The button was pressed. */
ucState = pdTRUE;
}
-
+
if( ucState != ucLastState )
{
/* The state has changed, send a message to the LCD task. */
@@ -445,7 +445,7 @@ xQueueMessage xMessage;
ucLastState = ucState;
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );
}
-
+
/* Block for 10 milliseconds so this task does not utilise all the CPU
time and debouncing of the button is not necessary. */
vTaskDelay( 10 / portTICK_RATE_MS );
@@ -472,7 +472,7 @@ static void prvSetupHardware( void )
halLcdInit();
halLcdSetContrast( 100 );
halLcdClearScreen();
-
+
halLcdPrintLine( " www.FreeRTOS.org", 0, OVERWRITE_TEXT );
}
/*-----------------------------------------------------------*/
@@ -507,11 +507,11 @@ static xQueueMessage xStatusMessage = { mainMESSAGE_STATUS, pdPASS };
{
xStatusMessage.ulMessageValue = mainERROR_DYNAMIC_TASKS;
}
-
+
if( xAreGenericQueueTasksStillRunning() != pdPASS )
{
xStatusMessage.ulMessageValue = mainERROR_GEN_QUEUE_TEST;
- }
+ }
/* Check the reg test tasks are still cycling. They will stop
incrementing their loop counters if they encounter an error. */
@@ -527,7 +527,7 @@ static xQueueMessage xStatusMessage = { mainMESSAGE_STATUS, pdPASS };
usLastRegTest1Counter = usRegTest1Counter;
usLastRegTest2Counter = usRegTest2Counter;
-
+
/* As this is the tick hook the lHigherPriorityTaskWoken parameter is not
needed (a context switch is going to be performed anyway), but it must
still be provided. */
@@ -564,7 +564,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
xQueueSendFromISR( xLCDQueue, &xMessage, &xHigherPriorityTaskWoken );
P2IFG = 0;
-
+
/* If writing to xLCDQueue caused a task to unblock, and the unblocked task
has a priority equal to or above the task that this interrupt interrupted,
then lHigherPriorityTaskWoken will have been set to pdTRUE internally within
@@ -630,7 +630,7 @@ void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName
{
( void ) pxTask;
( void ) pcTaskName;
-
+
/* Run time stack overflow checking is performed if
configconfigCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected. */