Microchip® Advanced Software Framework

thirdparty/lwip/netconn_http_stats_example/main.c File Reference

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
Value:
"-- HTTP Netconn Example --"STRING_EOL \
"-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL
#define BOARD_NAME
Definition: inc/app_init.h:140
#define STRING_EOL
Definition: thirdparty/lwip/netconn_http_stats_example/main.c:87

Referenced by main().

static void configure_console ( void  )
static
void configure_timer_for_run_time_stats ( 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 void prvSetupHardware ( void  )
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).

References configASSERT, and NULL.

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