2026-05-10 17:28:14 +08:00
|
|
|
/**
|
|
|
|
|
* @file initial.cpp
|
|
|
|
|
* @brief 应用启动初始化实现。
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "sys/initial.h"
|
|
|
|
|
|
|
|
|
|
#include "device/canfd.h"
|
|
|
|
|
#include "device/temp_sensor.h"
|
|
|
|
|
#include "device/usart0.h"
|
|
|
|
|
#include "device/Timer.h"
|
|
|
|
|
#include "device/adc.h"
|
2026-05-30 00:24:31 +08:00
|
|
|
#include "device/watchdog.h"
|
|
|
|
|
#include "device/app_spi_command.h"
|
2026-05-10 17:28:14 +08:00
|
|
|
#include "sys/systick.h"
|
2026-05-30 00:24:31 +08:00
|
|
|
#include "sys/ota_boot_request.h"
|
2026-05-10 17:28:14 +08:00
|
|
|
#include "sys/task_manager.h"
|
|
|
|
|
|
2026-05-10 21:27:51 +08:00
|
|
|
/**
|
|
|
|
|
* @brief 执行应用级外设与调度初始化。
|
|
|
|
|
* @param[in] 无。
|
|
|
|
|
* @param[out] 无。
|
|
|
|
|
* @retval 无返回值。
|
|
|
|
|
* @note 依次完成 SysTick、USART0、ADC/温度采样、CANFD、任务管理器与调度定时器的启动。
|
|
|
|
|
*/
|
2026-05-10 17:28:14 +08:00
|
|
|
void AppInitializer::init()
|
|
|
|
|
{
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: SysTick...\r\n");
|
2026-05-10 17:28:14 +08:00
|
|
|
SysTickTimer::initMs();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: USART0...\r\n");
|
2026-05-10 17:28:14 +08:00
|
|
|
Usart0::configurePins();
|
|
|
|
|
Usart0::init();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: TempSensor...\r\n");
|
2026-05-10 17:28:14 +08:00
|
|
|
TempSensor::init();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: CANFD...\r\n");
|
2026-05-10 17:28:14 +08:00
|
|
|
CanFd::init();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: OtaBootRequest...\r\n");
|
2026-05-30 00:24:31 +08:00
|
|
|
OtaBootRequest::init();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: AppSpiCommand...\r\n");
|
2026-05-30 00:24:31 +08:00
|
|
|
AppSpiCommand::init();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: TaskManager...\r\n");
|
2026-05-10 17:28:14 +08:00
|
|
|
TaskManager::init();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: SchedulerTimer...\r\n");
|
2026-05-10 17:28:14 +08:00
|
|
|
SchedulerTimer::init();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: Watchdog...\r\n");
|
2026-05-30 00:24:31 +08:00
|
|
|
Watchdog::init();
|
2026-05-30 20:03:31 +08:00
|
|
|
printf("[APP] init: all done\r\n");
|
2026-05-30 00:24:31 +08:00
|
|
|
}
|