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]
|
#[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 {}
|
||||||
|
|
Loading…
Reference in a new issue