V2.05
重写延时等待函数,解决与模块之间通信间隔有可能过短的问题 修改硬件版本号时自动修改can波特率
This commit is contained in:
@@ -24,7 +24,7 @@ void CtrlGpio_DefInit(void)
|
||||
GPIO_ResetBits(GPIOA,GPIO_InitStructure.GPIO_Pin);
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = SEG0_Pin;
|
||||
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IPU;
|
||||
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING;
|
||||
GPIO_Init(GPIOA,&GPIO_InitStructure);
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void CtrlGpio_DefInit(void)
|
||||
|
||||
//GPIO 配置
|
||||
GPIO_InitStructure.GPIO_Pin=SEG4_Pin|SEG3_Pin|SEG1_Pin|SEG2_Pin;
|
||||
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IPU;
|
||||
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING;
|
||||
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
|
||||
GPIO_Init(GPIOC,&GPIO_InitStructure);
|
||||
|
||||
|
@@ -363,3 +363,15 @@ uint16_t GetCountTimerCnt()
|
||||
return TIM2->CNT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TimerCount_Off(void)
|
||||
{
|
||||
TIM_Cmd(TIM2,DISABLE);
|
||||
TIM2->CNT = 0;
|
||||
TIM2->PSC = (uint32_t)7200-1;//10K 0.1ms
|
||||
TIM2->EGR |= TIM_EventSource_Update;
|
||||
TIM2->SR = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -65,4 +65,9 @@ uint16_t GetCountTimerCnt(void);
|
||||
使用轮询的方式检测校准结束
|
||||
*/
|
||||
void FireBus_ClkAmendCycle(void);
|
||||
|
||||
// 复位并关闭定时器
|
||||
void TimerCount_Off(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user