Skip to content

Commit

Permalink
refactor(core): re-export usb crates in rmk
Browse files Browse the repository at this point in the history
Signed-off-by: HaoboGu <[email protected]>
  • Loading branch information
HaoboGu committed Nov 28, 2023
1 parent 5917773 commit af6a778
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions boards/rp2040/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ cortex-m-rt = "0.7.3"
log = "0.4.19"
rtic = { version = "2.0.0", features = ["thumbv6-backend"] }
rtic-monotonics = { version = "1.0.0", features = ["cortex-m-systick"] }
usb-device = "0.2.9"
usbd-hid = "0.6.1"

[features]
# avoid having to use --allow-multiple-definition linker flag
Expand Down
2 changes: 1 addition & 1 deletion boards/rp2040/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mod app {
use rmk::{
config::KEYBOARD_CONFIG, eeprom::EepromStorageConfig, flash::EmptyFlashWrapper,
initialize_keyboard_and_usb_device, keyboard::Keyboard, usb::KeyboardUsbDevice,
usb_device::class_prelude::UsbBusAllocator,
};
use rp_pico::{
hal::{
Expand All @@ -25,7 +26,6 @@ mod app {
Pins, XOSC_CRYSTAL_FREQ,
};
use rtic_monotonics::systick::*;
use usb_device::class_prelude::UsbBusAllocator;

// Static usb bus instance
static mut USB_BUS: Option<UsbBusAllocator<UsbBus>> = None;
Expand Down
2 changes: 0 additions & 2 deletions boards/stm32h7/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ rtt-target = "0.4.0"
log = "0.4.19"
rtic = { version = "2.0.1", features = ["thumbv7-backend"] }
rtic-monotonics = { version = "1.0.0", features = ["cortex-m-systick"] }
usb-device = "0.2.9"
usbd-hid = "0.6.1"
packed_struct = { version = "0.10.1", default-features = false }
embedded-storage = { version = "0.3" }

Expand Down
2 changes: 1 addition & 1 deletion boards/stm32h7/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ mod app {
&ccdr.clocks,
);
let usb_allocator = cortex_m::singleton!(
: usb_device::class_prelude::UsbBusAllocator<UsbBus<USB1>> =
: rmk::usb_device::class_prelude::UsbBusAllocator<UsbBus<USB1>> =
UsbBus::new(usb, unsafe { &mut EP_MEMORY })
)
.unwrap();
Expand Down
3 changes: 3 additions & 0 deletions rmk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ use keyboard::Keyboard;
use usb::KeyboardUsbDevice;
use usb_device::class_prelude::{UsbBus, UsbBusAllocator};

pub use usb_device;
pub use usbd_hid;

pub mod action;
pub mod config;
pub mod debounce;
Expand Down

0 comments on commit af6a778

Please sign in to comment.