38 lines
737 B
C++
38 lines
737 B
C++
#include "main.h"
|
|||
|
|
#include "sys/initial.h"
|
||
|
|
#include "sys/task_runner.h"
|
||
|
|
#include "sys/config.h"
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 打印应用启动横幅与系统时钟信息。
|
||
|
|
* @note 该函数仅负责串口输出启动提示,不修改系统控制状态。
|
||
|
|
*/
|
||
|
|
void App::printBanner() const
|
||
|
|
{
|
||
|
|
printf("\r\n%s\r\n", APP_BANNER_TEXT);
|
||
|
|
printf("SystemCoreClock=%u Hz\r\n", SystemCoreClock);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 运行应用主循环。
|
||
|
|
* @retval int 固定返回 0;在嵌入式常驻循环场景下通常不会真正返回。
|
||
|
|
*/
|
||
|
|
int App::run()
|
||
|
|
{
|
||
|
|
AppInitializer::init();
|
||
|
|
TaskRunner::init();
|
||
|
|
printBanner();
|
||
|
|
|
||
|
|
while(1) {
|
||
|
|
TaskRunner::runPending();
|
||
|
|
}
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
int main(void)
|
||
|
|
{
|
||
|
|
App app;
|
||
|
|
return app.run();
|
||
|
|
}
|