summaryrefslogtreecommitdiffstats
path: root/usb/src
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-08-31 16:05:10 -0400
committerBrian Cully <bjc@kublai.com>2019-08-31 16:05:10 -0400
commit5c7098f2a41b68fc18b4eb18482dc2da21df3d43 (patch)
treee21bdb5ef88534d30d8abfe820d6e6a1771fbd13 /usb/src
parent784db2bc6ca1dac88a60fcf5919ae5f7fa98f688 (diff)
downloadbleusb-5c7098f2a41b68fc18b4eb18482dc2da21df3d43.tar.gz
bleusb-5c7098f2a41b68fc18b4eb18482dc2da21df3d43.zip
Update for new versions of HAL &c.
Diffstat (limited to 'usb/src')
-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.");