/* Board */
#include "board.h"
#include "clock_config.h"
#include "peripherals.h"
#include "pin_mux.h"

/* FreeRTOS */
#include "FreeRTOS.h"
#include "task.h"

/* Debug console */
#include "fsl_debug_console.h"

/* WHD */
#include "whd.h"
#include "whd_wifi_api.h"

/* LwIP */
#include "lwip/init.h"

void task_hello_init(void);

int main(void) {
    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    BOARD_InitBootPeripherals();
    BOARD_ConfigMPU();

    BOARD_InitDebugConsole();

    CLOCK_SetMode(kCLOCK_ModeRun);

    PRINTF("CPU frequency: %dMHz\r\n", CLOCK_GetCoreSysClkFreq() / 1000000);

    task_hello_init();

    lwip_init();

    vTaskStartScheduler();

    for (;;) {
        __WFI();
    }
}
