50 lines
1.3 KiB
C

/**
* @file main.c
* @brief Entry: clock update, USART banner, LED init, create tasks, start scheduler.
*/
#include "n32wb03x.h"
#include <stdio.h>
#include "FreeRTOS.h"
#include "task.h"
#include "bsp_usart.h"
#include "bsp_led.h"
#include "app_tasks.h"
#include "app_cli.h"
#include "app_version.h"
/**
* @brief Main program.
*/
int main(void)
{
/* Update SystemCoreClock (configured to 64MHz HSI by SystemInit) */
SystemCoreClockUpdate();
/* USART1 init, print startup banner before the scheduler runs */
bsp_usart_init();
printf("\n========================================\n");
printf(" N32WB031 FreeRTOS + UART + LED demo\n");
printf(" Firmware version %s\n", APP_FW_VERSION);
printf(" SystemCoreClock = %lu Hz\n", (unsigned long)SystemCoreClock);
printf("========================================\n");
/* LED1(PB0) / LED2(PA6) init */
bsp_led_init();
/* Create log queue and tasks (LedTask, LedTask2, PrintTask) */
AppTasks_CreateAll();
/* Create the CLI task (command parsing/execution/response) */
AppCli_Init();
/* Start the FreeRTOS scheduler (port configures SysTick itself) */
vTaskStartScheduler();
/* We should never get here as control is now taken by the scheduler */
for (;;)
{
}
}