添加发送失败信息记录
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
static int init(timer_def *t){
|
||||
static int inited=0;
|
||||
// if(inited!=0) return 0;
|
||||
if(inited!=0) return 0;
|
||||
inited=1;
|
||||
TIM_TimeBaseInitTypeDef timer;
|
||||
|
||||
@@ -24,7 +24,7 @@ static int init(timer_def *t){
|
||||
TIM_SetCounter(TIM4,0);
|
||||
TIM_ARRPreloadConfig(TIM4, ENABLE);
|
||||
TIM_SelectOutputTrigger(TIM4,TIM_TRGOSource_Update);
|
||||
TIM_Cmd(TIM4, ENABLE);
|
||||
// TIM_Cmd(TIM4, ENABLE);
|
||||
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM5, ENABLE );
|
||||
NVIC_DisableIRQ(TIM5_IRQn);
|
||||
@@ -38,7 +38,7 @@ static int init(timer_def *t){
|
||||
TIM_SetCounter(TIM5,0);
|
||||
TIM_ARRPreloadConfig(TIM5, ENABLE);
|
||||
TIM_ITRxExternalClockConfig(TIM5, TIM_TS_ITR2);
|
||||
TIM_Cmd(TIM5, ENABLE);
|
||||
// TIM_Cmd(TIM5, ENABLE);
|
||||
|
||||
|
||||
return 0;
|
||||
@@ -75,9 +75,19 @@ static int write(timer_def *t,const uint32_t value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int start(timer_def *t)
|
||||
{
|
||||
TIM_Cmd(TIM4,ENABLE);
|
||||
TIM_Cmd(TIM5,ENABLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stop(timer_def *t)
|
||||
{
|
||||
TIM_Cmd(TIM4,DISABLE);
|
||||
TIM_Cmd(TIM5,DISABLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
timer_init_export(timer,init,deinit,read,write,0);
|
||||
timer_init_export(timer,init,deinit,read,write,stop,start,0);
|
||||
|
||||
|
Reference in New Issue
Block a user