fw-rust: Use chip-generic interrupt utilities

Instead of manually enabling and disabling interrupts use the
chip-generic interrupt utilities.
This commit is contained in:
finga 2022-03-06 16:54:48 +01:00
parent a688d4c5ed
commit 8315560daa

View file

@ -63,9 +63,7 @@ static ONDERS_ORG: [[u8; 48]; 2] = [
#[atmega_hal::entry]
fn main() -> ! {
// Disable interrupts when initializing
interrupt::disable();
interrupt::free(|_cs| {
// Get peripherals, pins and delay
let dp = Peripherals::take().unwrap();
let pins = pins!(dp);
@ -181,9 +179,7 @@ fn main() -> ! {
delay.delay_ms(1_u8);
lcd_cd.set_low();
}
// Enable interrupts
unsafe { interrupt::enable() };
});
#[allow(clippy::empty_loop)]
loop {}