Microchip® Advanced Software Framework

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

FreeRTOS configuration.

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

#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "partest.h"
#include "demo-tasks.h"
#include "conf_example.h"
#include "sysclk.h"

Macros

#define mainCDC_CLI_TASK_PRIORITY   (tskIDLE_PRIORITY + 1)
 
#define mainCDC_CLI_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)
 
#define mainDEMONSTRATE_ASYNCHRONOUS_API   (0)
 
#define mainDONT_BLOCK   (0)
 
#define mainERROR_LED   (1)
 
#define mainSOFTWARE_TIMER_LED   (0)
 
#define mainSOFTWARE_TIMER_RATE   (200 / portTICK_RATE_MS)
 
#define mainSPI_FLASH_TASK_PRIORITY   (tskIDLE_PRIORITY)
 
#define mainSPI_FLASH_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)
 
#define mainTWI_EEPROM_TASK_PRIORITY   (tskIDLE_PRIORITY)
 
#define mainTWI_EEPROM_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)
 
#define mainUART_CLI_TASK_PRIORITY   (tskIDLE_PRIORITY + 1)
 
#define mainUART_CLI_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)
 
#define mainUSART_CLI_TASK_PRIORITY   (tskIDLE_PRIORITY + 1)
 
#define mainUSART_CLI_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)
 
#define mainUSART_ECHO_TASK_PRIORITY   (tskIDLE_PRIORITY)
 
#define mainUSART_ECHO_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE)
 

Functions

void assert_triggered (const char *file, uint32_t line)
 
int main (void)
 
static void prvLEDTimerCallback (void *pvParameters)
 
static void prvSetupHardware (void)
 
void vApplicationIdleHook (void)
 
void vApplicationMallocFailedHook (void)
 
void vApplicationStackOverflowHook (xTaskHandle pxTask, signed char *pcTaskName)
 
void vApplicationTickHook (void)
 This function is called by FreeRTOS each tick. More...
 

#define mainCDC_CLI_TASK_PRIORITY   (tskIDLE_PRIORITY + 1)

Referenced by main().

#define mainCDC_CLI_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)

Referenced by main().

#define mainDEMONSTRATE_ASYNCHRONOUS_API   (0)

Referenced by main().

#define mainDONT_BLOCK   (0)

Referenced by main().

#define mainERROR_LED   (1)

Referenced by prvLEDTimerCallback().

#define mainSOFTWARE_TIMER_LED   (0)

Referenced by prvLEDTimerCallback().

#define mainSOFTWARE_TIMER_RATE   (200 / portTICK_RATE_MS)

Referenced by main().

#define mainSPI_FLASH_TASK_PRIORITY   (tskIDLE_PRIORITY)

Referenced by main().

#define mainSPI_FLASH_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)

Referenced by main().

#define mainTWI_EEPROM_TASK_PRIORITY   (tskIDLE_PRIORITY)

Referenced by main().

#define mainTWI_EEPROM_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)

Referenced by main().

#define mainUART_CLI_TASK_PRIORITY   (tskIDLE_PRIORITY + 1)

Referenced by main().

#define mainUART_CLI_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)

Referenced by main().

#define mainUSART_CLI_TASK_PRIORITY   (tskIDLE_PRIORITY + 1)

Referenced by main().

#define mainUSART_CLI_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE * 2)

Referenced by main().

#define mainUSART_ECHO_TASK_PRIORITY   (tskIDLE_PRIORITY)

Referenced by main().

#define mainUSART_ECHO_TASK_STACK_SIZE   (configMINIMAL_STACK_SIZE)

Referenced by main().

void assert_triggered ( const char *  file,
uint32_t  line 
)
static void prvLEDTimerCallback ( void *  pvParameters)
static
static void prvSetupHardware ( void  )
static

References board_init(), sysclk_init(), and vParTestInitialise().

Referenced by main().

void vApplicationIdleHook ( void  )
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).

void vApplicationStackOverflowHook ( xTaskHandle  pxTask,
signed char *  pcTaskName 
)

Run time stack overflow checking is performed if configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is called if a stack overflow is detected.

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()).