-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(arch): split the
rp2040
arch into multiple submodule files
Split the `rp2040` arch to make it more manageable when it keeps growing.
- Loading branch information
1 parent
bb8e08f
commit bead939
Showing
3 changed files
with
21 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use embassy_rp::{ | ||
bind_interrupts, peripherals, | ||
usb::{Driver, InterruptHandler}, | ||
}; | ||
|
||
use crate::arch; | ||
|
||
bind_interrupts!(struct Irqs { | ||
USBCTRL_IRQ => InterruptHandler<peripherals::USB>; | ||
}); | ||
|
||
pub type UsbDriver = Driver<'static, peripherals::USB>; | ||
|
||
pub fn driver(peripherals: &mut arch::OptionalPeripherals) -> UsbDriver { | ||
let usb = peripherals.USB.take().unwrap(); | ||
Driver::new(usb, Irqs) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters