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