HTTP Netconn Example.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include "task_defs.h"
#include "ethernet.h"
#include "status_codes.h"
#include "conf_uart_serial.h"
#include "uart_serial.h"
#include "stdio_serial.h"
#include "tc.h"
Macros | |
#define | STRING_EOL "\n" |
#define | STRING_HEADER |
Functions | |
static void | configure_console (void) |
Configure UART console. More... | |
void | configure_timer_for_run_time_stats (void) |
uint32_t | get_run_time_counter_value (void) |
void | main (void) |
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 STRING_EOL "\n" |
#define STRING_HEADER |
Referenced by main().
|
static |
Configure UART console.
Configure console UART.
References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().
Referenced by prvSetupHardware().
void configure_timer_for_run_time_stats | ( | void | ) |
References pmc_enable_periph_clk(), tc_init(), tc_start(), and tc_write_rc().
uint32_t get_run_time_counter_value | ( | void | ) |
void main | ( | void | ) |
Prepare the hardware to run this demo.
Print example information.
Create GFX task.
Create WebServer task.
Start the RTOS scheduler.
References create_gfx_task(), create_http_task(), mainGFX_TASK_PRIORITY, mainGFX_TASK_STACK_SIZE, mainHTTP_TASK_PRIORITY, mainHTTP_TASK_STACK_SIZE, prvSetupHardware(), STRING_HEADER, and vTaskStartScheduler().
|
static |
Initialize the console uart
References board_init(), configure_console(), and sysclk_init().
Referenced by main().
void vApplicationIdleHook | ( | void | ) |
vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle task. It is essential that code added to this hook function never attempts to block in any way (for example, call xQueueReceive() with a block time specified, or call vTaskDelay()). If the application makes use of the vTaskDelete() API function (as this demo application does) then it is also important that vApplicationIdleHook() is permitted to return to its calling function, because it is the responsibility of the idle task to clean up memory allocated by the kernel to any task that has since been deleted.
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.
References taskDISABLE_INTERRUPTS.
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()).