Skip to content

Commit

Permalink
feat(arch): re-export Embassy gpio modules
Browse files Browse the repository at this point in the history
The gpio modules need to be re-exported under `arch`, so that we can
access the relevant one when codegening sensor initialization.
  • Loading branch information
ROMemories authored and kaspar030 committed Apr 24, 2024
1 parent c16dd7c commit 1690ba8
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/riot-rs-embassy/src/arch/dummy/gpio.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//! See your architecture's Embassy crate documentation.
1 change: 1 addition & 0 deletions src/riot-rs-embassy/src/arch/dummy/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Dummy module used to satisfy platform-independent tooling.

mod executor;
pub mod gpio;

#[cfg(feature = "hwrng")]
pub mod hwrng;
Expand Down
1 change: 1 addition & 0 deletions src/riot-rs-embassy/src/arch/esp/gpio.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use esp_hal::gpio::*;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pub mod gpio;

use esp_hal::{clock::ClockControl, embassy, prelude::*, timer::TimerGroup};

pub use esp_hal::{
Expand Down
1 change: 1 addition & 0 deletions src/riot-rs-embassy/src/arch/nrf/gpio.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use embassy_nrf::gpio::*;
2 changes: 2 additions & 0 deletions src/riot-rs-embassy/src/arch/nrf/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pub mod gpio;

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

Expand Down
1 change: 1 addition & 0 deletions src/riot-rs-embassy/src/arch/rp2040/gpio.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use embassy_rp::gpio::*;
2 changes: 2 additions & 0 deletions src/riot-rs-embassy/src/arch/rp2040/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pub mod gpio;

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

Expand Down
2 changes: 1 addition & 1 deletion src/riot-rs-embassy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cfg_if::cfg_if! {
#[path = "arch/rp2040/mod.rs"]
pub mod arch;
} else if #[cfg(context = "esp")] {
#[path = "arch/esp.rs"]
#[path = "arch/esp/mod.rs"]
pub mod arch;
} else if #[cfg(context = "riot-rs")] {
compile_error!("this architecture is not supported");
Expand Down

0 comments on commit 1690ba8

Please sign in to comment.