feat: 添加GD32E508 DCU应用工程的初始结构
- 新增完整的CMSIS解决方案配置,包含AC6/GCC/IAR/CLANG编译器支持 - 添加项目配置文件,定义了设备层、系统层、应用层的模块结构 - 配置ARM::CMSIS和GigaDevice::GD32E50x_DFP软件包依赖 - 创建多层代码架构:应用入口(main)、系统层(sys)、设备层(device) - 实现任务管理系统,包含任务调度器和任务执行器分离设计 - 集成ADC、CANFD、定时器、串口、温度采样等核心功能模块 - 添加详细的README文档说明项目结构和代码组织方式 - 配置AC6链接脚本和运行时环境文件 - 设置Git忽略规则以排除编译产物和临时文件
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @file systick.cpp
|
||||
* @brief SysTick 时基模块实现。
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
#include "sys/systick.h"
|
||||
|
||||
volatile uint32_t SysTickTimer::s_ms = 0U;
|
||||
|
||||
void SysTickTimer::onInterrupt()
|
||||
{
|
||||
s_ms++;
|
||||
}
|
||||
|
||||
void SysTickTimer::delayMs(uint32_t ms)
|
||||
{
|
||||
uint32_t start = s_ms;
|
||||
while((s_ms - start) < ms) { }
|
||||
}
|
||||
|
||||
void SysTickTimer::initMs()
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
SysTick_Config(SystemCoreClock / 1000U);
|
||||
}
|
||||
|
||||
/* ----- 中断入口 C 包装 ---------------------------------------------- */
|
||||
void SysTick_Handler(void) { SysTickTimer::onInterrupt(); }
|
||||
Reference in New Issue
Block a user