stm32f7xx-hal icon indicating copy to clipboard operation
stm32f7xx-hal copied to clipboard

Timer Interrupt clear is incorrect

Open jonathanpallant opened this issue 4 years ago • 0 comments

This code in timer.rs:

pub fn unlisten(&mut self, event: Event) {
    match event {
        Event::TimeOut => {
            // Enable update event interrupt
            self.tim.dier.write(|w| w.uie().clear_bit());
        }
    }
}

should be

pub fn unlisten(&mut self, event: Event) {
    match event {
        Event::TimeOut => {
            // Enable update event interrupt
            self.tim.dier.modify(|_r, w| w.uie().clear_bit());
        }
    }
}

The write call will disable all the interrupts, not just that specified one.

jonathanpallant avatar May 24 '21 15:05 jonathanpallant