Microchip® Advanced Software Framework

thirdparty/freertos/demo/sam_example/main.c File Reference

FreeRTOS configuration.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include "conf_board.h"

Macros

#define TASK_LED_STACK_PRIORITY   (tskIDLE_PRIORITY)
 
#define TASK_LED_STACK_SIZE   (1024/sizeof(portSTACK_TYPE))
 
#define TASK_MONITOR_STACK_PRIORITY   (tskIDLE_PRIORITY)
 
#define TASK_MONITOR_STACK_SIZE   (2048/sizeof(portSTACK_TYPE))
 

Functions

static void configure_console (void)
 Configure the console UART. More...
 
int main (void)
 FreeRTOS Real Time Kernel example entry point. More...
 
static void task_led (void *pvParameters)
 This task, when activated, make LED blink at a fixed rate. More...
 
static void task_monitor (void *pvParameters)
 This task, when activated, send every ten seconds on debug UART the whole report of free heap and total tasks status. More...
 
void vApplicationIdleHook (void)
 This function is called by FreeRTOS idle task. More...
 
void vApplicationMallocFailedHook (void)
 
void vApplicationStackOverflowHook (xTaskHandle *pxTask, signed char *pcTaskName)
 Called if stack overflow during execution. More...
 
void vApplicationTickHook (void)
 This function is called by FreeRTOS each tick. More...
 
void xPortSysTickHandler (void)
 

#define TASK_LED_STACK_PRIORITY   (tskIDLE_PRIORITY)

Referenced by main().

#define TASK_LED_STACK_SIZE   (1024/sizeof(portSTACK_TYPE))

Referenced by main().

#define TASK_MONITOR_STACK_PRIORITY   (tskIDLE_PRIORITY)

Referenced by main().

#define TASK_MONITOR_STACK_SIZE   (2048/sizeof(portSTACK_TYPE))

Referenced by main().

static void configure_console ( void  )
static

Configure the console UART.

References uart_rs232_options::baudrate, NULL, and stdio_serial_init().

Referenced by main().

int main ( void  )
static void task_led ( void *  pvParameters)
static

This task, when activated, make LED blink at a fixed rate.

References UNUSED, and vTaskDelay().

Referenced by main().

static void task_monitor ( void *  pvParameters)
static

This task, when activated, send every ten seconds on debug UART the whole report of free heap and total tasks status.

References UNUSED, uxTaskGetNumberOfTasks(), vTaskDelay(), and vTaskList().

Referenced by main().

void vApplicationIdleHook ( void  )

This function is called by FreeRTOS idle task.

void vApplicationMallocFailedHook ( void  )

vApplicationMallocFailedHook() will only be called if configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook function that will get called if a call to pvPortMalloc() fails. pvPortMalloc() is called internally by the kernel whenever a task, queue, timer or semaphore is created. It is also called by various parts of the demo application. If heap_1.c or heap_2.c are used, then the size of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used to query the size of free heap space that remains (although it does not provide information on how the remaining heap might be fragmented).

vApplicationMallocFailedHook() will only be called if configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook function that will get called if a call to pvPortMalloc() fails. pvPortMalloc() is called internally by the kernel whenever a task, queue, timer or semaphore is created. It is also called by various parts of the demo application. If heap_1.c or heap_2.c are used, then the size of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used to query the size of free heap space that remains (although it does not provide information on how the remaining heap might be fragmented).

vApplicationMallocFailedHook() will only be called if configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook function that will get called if a call to pvPortMalloc() fails. pvPortMalloc() is called internally by the kernel whenever a task, queue, timer or semaphore is created. It is also called by various parts of the demo application. If heap_1.c or heap_2.c are used, then the size of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used to query the size of free heap space that remains (although it does not provide information on how the remaining heap might be fragmented).

References taskDISABLE_INTERRUPTS.

Referenced by pvPortMalloc().

void vApplicationStackOverflowHook ( xTaskHandle pxTask,
signed char *  pcTaskName 
)

Called if stack overflow during execution.

void vApplicationTickHook ( void  )

This function is called by FreeRTOS each tick.

This function will be called by each tick interrupt if configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be added here, but the tick hook is called from an interrupt context, so code must not attempt to block, and only the interrupt safe FreeRTOS API functions can be used (those that end in FromISR()).

This function will be called by each tick interrupt if configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be added here, but the tick hook is called from an interrupt context, so code must not attempt to block, and only the interrupt safe FreeRTOS API functions can be used (those that end in FromISR()).

This function will be called by each tick interrupt if configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be added here, but the tick hook is called from an interrupt context, so code must not attempt to block, and only the interrupt safe FreeRTOS API functions can be used (those that end in FromISR()).

Referenced by vTaskIncrementTick(), and xTaskIncrementTick().

void xPortSysTickHandler ( void  )