Update timer.h

- clear the IRQ flag before enabling the IRQ
This commit is contained in:
stevstrong 2017-11-13 13:02:27 +01:00 committed by GitHub
parent c66ca2ae9c
commit dfb5bd4c30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -828,6 +828,7 @@ static inline void timer_dma_disable_req(timer_dev *dev, uint8 channel) {
* @see timer_channel
*/
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;
}