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:
parent
a688d4c5ed
commit
8315560daa
1 changed files with 99 additions and 103 deletions
|
@ -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 {}
|
||||
|
|
Loading…
Reference in a new issue