44 lines
1.1 KiB
C
44 lines
1.1 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"
|
|
|
|
/**
|
|
* @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(" 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();
|
|
|
|
/* Start the FreeRTOS scheduler (port configures SysTick itself) */
|
|
vTaskStartScheduler();
|
|
|
|
/* We should never get here as control is now taken by the scheduler */
|
|
for (;;)
|
|
{
|
|
}
|
|
}
|