本代码实现了定时器3的中断初始化,并在中断中实现了一些功能。其中,定时器3的时钟选择为APB1的2倍,即时钟频率为36MHz。定时器的自动重装值为arr,时钟预分频数为psc。在中断中,每50ms会将time50ms自增1,并进行一些操作,如设置disFlag标志位、判断uartbusy是否为0等等。

解读#include timerh#include ledh通用定时器中断初始化这里时钟选择为APB1的2倍而APB1为36Marr:自动重装值。psc:时钟预分频数这里使用的是定时器3!u32 time50ms=0;		50ms 时间片extern u8 disFlag ;extern unsigned char firstin;extern unsigned char Count;exter

原文地址: https://www.cveoy.top/t/topic/bNpv 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录