Skip to content

Commit

Permalink
riot-rs-embassy: refactor exports
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Feb 19, 2024
1 parent 14946f4 commit 489c831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/riot-rs-embassy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod define_peripherals;
pub mod arch;

#[cfg(feature = "usb")]
mod usb;
pub mod usb;

#[cfg(feature = "net")]
pub mod network;
Expand All @@ -32,7 +32,7 @@ pub use static_cell::make_static;

pub use embassy_executor::Spawner;

#[cfg(feature = "usb")]
#[cfg(feature = "usb_ethernet")]
use usb::ethernet::NetworkDevice;

#[cfg(feature = "wifi_cyw43")]
Expand Down
8 changes: 4 additions & 4 deletions src/riot-rs-embassy/src/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
//! }
//! ```

use crate::arch::usb::UsbDriver;
pub use crate::arch::usb::UsbDriver;

pub type UsbBuilder = embassy_usb::Builder<'static, UsbDriver>;

#[linkme::distributed_slice]
pub static USB_BUILDER_HOOKS: [&crate::delegate::Delegate<UsbBuilder>] = [..];

#[embassy_executor::task]
pub async fn usb_task(mut device: embassy_usb::UsbDevice<'static, UsbDriver>) -> ! {
pub(crate) async fn usb_task(mut device: embassy_usb::UsbDevice<'static, UsbDriver>) -> ! {
device.run().await
}

#[cfg(feature = "usb_ethernet")]
pub mod ethernet {
pub(crate) mod ethernet {
use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner};

use crate::{arch::usb::UsbDriver, network::ETHERNET_MTU};
Expand All @@ -33,7 +33,7 @@ pub mod ethernet {
}
}

pub fn config() -> embassy_usb::Config<'static> {
pub(crate) fn config() -> embassy_usb::Config<'static> {
#[cfg(not(feature = "override-usb-config"))]
{
// Create embassy-usb Config
Expand Down

0 comments on commit 489c831

Please sign in to comment.