Added timer flag reset function.
This commit is contained in:
parent
dd0018ffdf
commit
e85c55a9a7
@ -253,7 +253,8 @@ void tim1_trg_com_isr(void)
|
||||
{
|
||||
static int step = 0;
|
||||
|
||||
TIM1_SR &= ~TIM_SR_COMIF;
|
||||
/* Clear the COM trigger interrupt flag. */
|
||||
timer_clear_flag(TIM1, TIM_SR_COMIF);
|
||||
|
||||
/* A simplified and inefficient implementation of PWM On
|
||||
* scheme. Look at the implementation in Open-BLDC on
|
||||
|
@ -854,6 +854,7 @@ enum tim_oc_mode {
|
||||
/* --- TIM functions ------------------------------------------------------- */
|
||||
void timer_enable_irq(u32 timer_peripheral, u32 irq);
|
||||
void timer_disable_irq(u32 timer_peripheral, u32 irq);
|
||||
void timer_clear_flag(u32 timer_peripheral, u32 flag);
|
||||
void timer_set_mode(u32 timer_peripheral, u8 clock_div,
|
||||
u8 alignment, u8 direction);
|
||||
void timer_set_clock_division(u32 timer_peripheral, u32 clock_div);
|
||||
|
@ -37,6 +37,11 @@ void timer_disable_irq(u32 timer_peripheral, u32 irq)
|
||||
TIM_DIER(timer_peripheral) &= ~irq;
|
||||
}
|
||||
|
||||
void timer_clear_flag(u32 timer_peripheral, u32 flag)
|
||||
{
|
||||
TIM_SR(timer_peripheral) &= ~flag;
|
||||
}
|
||||
|
||||
void timer_set_mode(u32 timer_peripheral, u8 clock_div,
|
||||
u8 alignment, u8 direction)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user