Update timer.h
- clear the IRQ flag before enabling the IRQ
This commit is contained in:
parent
c66ca2ae9c
commit
dfb5bd4c30
|
@ -828,6 +828,7 @@ static inline void timer_dma_disable_req(timer_dev *dev, uint8 channel) {
|
||||||
* @see timer_channel
|
* @see timer_channel
|
||||||
*/
|
*/
|
||||||
static inline void timer_enable_irq(timer_dev *dev, uint8 interrupt) {
|
static inline void timer_enable_irq(timer_dev *dev, uint8 interrupt) {
|
||||||
|
*bb_perip(&(dev->regs).adv->SR, interrupt) = 0; // clear interrupt flag
|
||||||
*bb_perip(&(dev->regs).adv->DIER, interrupt) = 1;
|
*bb_perip(&(dev->regs).adv->DIER, interrupt) = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue