summaryrefslogtreecommitdiffstats
path: root/usb/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'usb/src/main.rs')
-rw-r--r--usb/src/main.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/usb/src/main.rs b/usb/src/main.rs
index 36e4d1e..523d275 100644
--- a/usb/src/main.rs
+++ b/usb/src/main.rs
@@ -13,7 +13,7 @@ use bootkbd::BootKeyboard;
use clint::HandlerArray;
use core::mem;
use core::panic::PanicInfo;
-use cortex_m::asm::wfi;
+use cortex_m::{asm::wfi, peripheral::NVIC};
use cortex_m_rt::{entry, exception, ExceptionFrame};
use embedded_hal::{blocking::i2c::Write, digital::v2::OutputPin};
use log::{info, LevelFilter};
@@ -57,7 +57,6 @@ fn main() -> ! {
&mut clocks,
115_200.hz(),
dp.SERCOM0,
- &mut cp.NVIC,
&mut dp.PM,
pins.d3,
pins.d4,
@@ -132,12 +131,16 @@ fn main() -> ! {
HANDLERS.with_overrides(|hs| {
hs.register(0, &mut rtc_handler);
- unsafe { cp.NVIC.set_priority(Interrupt::USB, 0) };
- cp.NVIC.enable(Interrupt::RTC);
+ unsafe {
+ cp.NVIC.set_priority(Interrupt::USB, 0);
+ NVIC::unmask(Interrupt::RTC);
+ };
hs.register(1, &mut usb_handler);
- unsafe { cp.NVIC.set_priority(Interrupt::USB, 1) };
- cp.NVIC.enable(Interrupt::USB);
+ unsafe {
+ cp.NVIC.set_priority(Interrupt::USB, 1);
+ NVIC::unmask(Interrupt::USB);
+ };
info!("Bootstrap complete.");