mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
fix typo in cyclic interrupt handling on stm32, don't enable interrupt by default.. require sei
This commit is contained in:
parent
e64f9ef3bb
commit
ee759a1c4b
@ -839,6 +839,9 @@ int platform_s_timer_set_match_int( unsigned id, u32 period_us, int type )
|
||||
TIM_OCInitStructure.TIM_Pulse = final;
|
||||
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
|
||||
TIM_OC1Init( base, &TIM_OCInitStructure );
|
||||
|
||||
// Patch timer configuration to reload when period is reached
|
||||
TIM_SetAutoreload( base, final );
|
||||
|
||||
TIM_OC1PreloadConfig( base, TIM_OCPreload_Enable );
|
||||
|
||||
@ -846,7 +849,7 @@ int platform_s_timer_set_match_int( unsigned id, u32 period_us, int type )
|
||||
|
||||
TIM_SetCounter( base, 0 );
|
||||
TIM_Cmd( base, ENABLE );
|
||||
TIM_ITConfig( base, TIM_IT_CC1, ENABLE );
|
||||
//TIM_ITConfig( base, TIM_IT_CC1, ENABLE );
|
||||
|
||||
return PLATFORM_TIMER_INT_OK;
|
||||
}
|
||||
|
@ -145,12 +145,14 @@ static void tmr_int_handler( int id )
|
||||
if (TIM_GetITStatus( base, TIM_IT_CC1) != RESET)
|
||||
{
|
||||
TIM_ClearITPendingBit( base, TIM_IT_CC1 );
|
||||
|
||||
if( id == VTMR_TIMER_ID )
|
||||
cmn_virtual_timer_cb();
|
||||
else
|
||||
cmn_int_handler( INT_TMR_MATCH, id );
|
||||
if( stm32_timer_int_periodic_flag[ id ] != PLATFORM_TIMER_INT_CYCLIC );
|
||||
//TIM_ITConfig( base, TIM_IT_CC1, DISABLE );
|
||||
|
||||
if( stm32_timer_int_periodic_flag[ id ] != PLATFORM_TIMER_INT_CYCLIC )
|
||||
TIM_ITConfig( base, TIM_IT_CC1, DISABLE );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user