Atmel Software Framework

thirdparty/freertos/demo/avr32_uc3_example/main.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "power_clocks_lib.h"
#include "FreeRTOS.h"
#include "task.h"
#include "partest.h"
#include "serial.h"
#include "integer.h"
#include "comtest.h"
#include "flash.h"
#include "PollQ.h"
#include "semtest.h"
#include "dynamic.h"
#include "BlockQ.h"
#include "death.h"
#include "flop.h"

Macros

#define mainCHECK_PERIOD   ( ( portTickType ) 3000 / portTICK_RATE_MS )
 The period between executions of the check task. More...
 
#define mainCHECK_TASK_LED   ( 6 )
 LED that is toggled by the check task. More...
 
#define mainCOM_TEST_BAUD_RATE   ( ( unsigned portLONG ) 57600 )
 Baud rate used by the serial port tasks. More...
 
#define mainCOM_TEST_LED   ( 3 )
 LED used by the serial port tasks. More...
 
#define mainERROR_FLASH_RATE   ( (portTickType) 500 / portTICK_RATE_MS )
 If an error is detected in a task, the vErrorChecks task will enter in an infinite loop flashing the LED at this rate. More...
 
#define mainERROR_LED   ( 7 )
 LED that is set upon error. More...
 
Priority definitions for most of the tasks in the demo application.

Some tasks just use the idle priority.

#define mainLED_TASK_PRIORITY   ( tskIDLE_PRIORITY + 1 )
 
#define mainCOM_TEST_PRIORITY   ( tskIDLE_PRIORITY + 2 )
 
#define mainQUEUE_POLL_PRIORITY   ( tskIDLE_PRIORITY + 2 )
 
#define mainSEM_TEST_PRIORITY   ( tskIDLE_PRIORITY + 1 )
 
#define mainBLOCK_Q_PRIORITY   ( tskIDLE_PRIORITY + 3 )
 
#define mainCHECK_TASK_PRIORITY   ( tskIDLE_PRIORITY + 4 )
 
#define mainCREATOR_TASK_PRIORITY   ( tskIDLE_PRIORITY + 3 )
 
Constants used by the vMemCheckTask() task.
#define mainCOUNT_INITIAL_VALUE   ( ( unsigned portLONG ) 0 )
 
#define mainNO_TASK   ( 0 )
 
The size of the memory blocks allocated by the vMemCheckTask() task.
#define mainMEM_CHECK_SIZE_1   ( ( size_t ) 51 )
 
#define mainMEM_CHECK_SIZE_2   ( ( size_t ) 52 )
 
#define mainMEM_CHECK_SIZE_3   ( ( size_t ) 15 )
 

Functions

int main (void)
 
static portBASE_TYPE prvCheckOtherTasksAreStillRunning (void)
 Checks that all the demo application tasks are still executing without error. More...
 
static void prvIndicateError (void)
 
static void vErrorChecks (void *pvParameters)
 The task function for the "Check" task. More...
 
static void vMemCheckTask (void *pvParameters)
 Dynamically created and deleted during each cycle of the vErrorChecks() task. This is done to check the operation of the memory allocator. See the top of vErrorChecks for more details. More...
 

#define mainBLOCK_Q_PRIORITY   ( tskIDLE_PRIORITY + 3 )

Referenced by main().

#define mainCHECK_PERIOD   ( ( portTickType ) 3000 / portTICK_RATE_MS )

The period between executions of the check task.

Referenced by vErrorChecks().

#define mainCHECK_TASK_LED   ( 6 )

LED that is toggled by the check task.

The check task periodically checks that all the other tasks are operating without error. If no errors are found the LED is toggled. If an error is found at any time the LED toggles faster.

Referenced by prvIndicateError(), and vErrorChecks().

#define mainCHECK_TASK_PRIORITY   ( tskIDLE_PRIORITY + 4 )

Referenced by main().

#define mainCOM_TEST_BAUD_RATE   ( ( unsigned portLONG ) 57600 )

Baud rate used by the serial port tasks.

Referenced by main().

#define mainCOM_TEST_LED   ( 3 )

LED used by the serial port tasks.

This is toggled on each character Tx, and mainCOM_TEST_LED + 1 is toggled on each character Rx.

Referenced by main().

#define mainCOM_TEST_PRIORITY   ( tskIDLE_PRIORITY + 2 )

Referenced by main().

#define mainCOUNT_INITIAL_VALUE   ( ( unsigned portLONG ) 0 )

Referenced by vErrorChecks(), and vMemCheckTask().

#define mainCREATOR_TASK_PRIORITY   ( tskIDLE_PRIORITY + 3 )

Referenced by vErrorChecks().

#define mainERROR_FLASH_RATE   ( (portTickType) 500 / portTICK_RATE_MS )

If an error is detected in a task, the vErrorChecks task will enter in an infinite loop flashing the LED at this rate.

Referenced by prvIndicateError().

#define mainERROR_LED   ( 7 )

LED that is set upon error.

Referenced by prvIndicateError().

#define mainLED_TASK_PRIORITY   ( tskIDLE_PRIORITY + 1 )

Referenced by main().

#define mainMEM_CHECK_SIZE_1   ( ( size_t ) 51 )

Referenced by vMemCheckTask().

#define mainMEM_CHECK_SIZE_2   ( ( size_t ) 52 )

Referenced by vMemCheckTask().

#define mainMEM_CHECK_SIZE_3   ( ( size_t ) 15 )

Referenced by vMemCheckTask().

#define mainNO_TASK   ( 0 )

Referenced by vErrorChecks().

#define mainQUEUE_POLL_PRIORITY   ( tskIDLE_PRIORITY + 2 )

Referenced by main().

#define mainSEM_TEST_PRIORITY   ( tskIDLE_PRIORITY + 1 )

Referenced by main().

static portBASE_TYPE prvCheckOtherTasksAreStillRunning ( void  )
static
static void prvIndicateError ( void  )
static
static void vMemCheckTask ( void *  pvParameters)
static

Dynamically created and deleted during each cycle of the vErrorChecks() task. This is done to check the operation of the memory allocator. See the top of vErrorChecks for more details.

Parameters
*pvParametersParameters for the task (can be of any kind)

References mainCOUNT_INITIAL_VALUE, mainMEM_CHECK_SIZE_1, mainMEM_CHECK_SIZE_2, mainMEM_CHECK_SIZE_3, NULL, pdFALSE, pdTRUE, pvPortMalloc(), vPortFree(), vTaskSuspendAll(), and xTaskResumeAll().

Referenced by vErrorChecks().