refactor(device): 移除备份配置文件并完善ADC模块注释
移除不再需要的 .cproject.yml.bak_dma 和 README.md 备份文件, 同时为 ADC.cpp 添加完整的 Doxygen 风格函数注释,提升代码可读性。
This commit is contained in:
@@ -8,17 +8,38 @@
|
||||
|
||||
volatile uint32_t SysTickTimer::s_ms = 0U;
|
||||
|
||||
/**
|
||||
* @brief SysTick 中断处理入口。
|
||||
* @param[in] 无。
|
||||
* @param[out] 无。
|
||||
* @retval 无返回值。
|
||||
* @note 每次 SysTick 中断到来时,将毫秒计数器自增 1。
|
||||
*/
|
||||
void SysTickTimer::onInterrupt()
|
||||
{
|
||||
s_ms++;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 执行毫秒级阻塞延时。
|
||||
* @param[in] ms 需要延时的毫秒数。
|
||||
* @param[out] 无。
|
||||
* @retval 无返回值。
|
||||
* @note 基于 SysTick 维护的毫秒计数器忙等,适用于短时初始化等待。
|
||||
*/
|
||||
void SysTickTimer::delayMs(uint32_t ms)
|
||||
{
|
||||
uint32_t start = s_ms;
|
||||
while((s_ms - start) < ms) { }
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 初始化 1ms SysTick 时基。
|
||||
* @param[in] 无。
|
||||
* @param[out] 无。
|
||||
* @retval 无返回值。
|
||||
* @note 先更新 `SystemCoreClock`,再按 1kHz 频率配置 SysTick。
|
||||
*/
|
||||
void SysTickTimer::initMs()
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
@@ -26,4 +47,11 @@ void SysTickTimer::initMs()
|
||||
}
|
||||
|
||||
/* ----- 中断入口 C 包装 ---------------------------------------------- */
|
||||
void SysTick_Handler(void) { SysTickTimer::onInterrupt(); }
|
||||
/**
|
||||
* @brief SysTick 中断向量入口。
|
||||
* @param[in] 无。
|
||||
* @param[out] 无。
|
||||
* @retval 无返回值。
|
||||
* @note C 向量包装函数,内部转调 `SysTickTimer::onInterrupt()`。
|
||||
*/
|
||||
void SysTick_Handler(void) { SysTickTimer::onInterrupt(); }
|
||||
|
||||
Reference in New Issue
Block a user