679: Reexport unborrow macro in HALs r=Dirbaio a=matoushybl

Removes the need to depend on embassy-hal-common in the case of developing custom peripheral drivers.

Co-authored-by: Matous Hybl <hyblmatous@gmail.com>
This commit is contained in:
bors[bot] 2022-04-07 11:41:15 +00:00 committed by GitHub
commit b6f40aca57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 2 deletions

View File

@ -115,6 +115,9 @@ pub use chip::pac;
#[cfg(not(feature = "unstable-pac"))]
pub(crate) use chip::pac;
pub use embassy::util::Unborrow;
pub use embassy_hal_common::unborrow;
pub use chip::{peripherals, Peripherals};
pub mod interrupt {

View File

@ -7,6 +7,9 @@ pub use rp2040_pac2 as pac;
#[cfg(not(feature = "unstable-pac"))]
pub(crate) use rp2040_pac2 as pac;
pub use embassy::util::Unborrow;
pub use embassy_hal_common::unborrow;
// This mod MUST go first, so that the others see its macros.
pub(crate) mod fmt;

View File

@ -9,6 +9,9 @@ pub use stm32_metapac as pac;
#[cfg(not(feature = "unstable-pac"))]
pub(crate) use stm32_metapac as pac;
pub use embassy::util::Unborrow;
pub use embassy_hal_common::unborrow;
// This must go FIRST so that all the other modules see its macros.
pub mod fmt;
include!(concat!(env!("OUT_DIR"), "/_macros.rs"));

View File

@ -11,7 +11,6 @@ resolver = "2"
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] }
embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] }
embassy-hal-common = { path = "../../embassy-hal-common", default-features = false, features = ["defmt"] }
defmt = "0.3"
defmt-rtt = "0.3"

View File

@ -10,11 +10,11 @@ use defmt::*;
use embassy::executor::Spawner;
use embassy::time::{Duration, Timer};
use embassy::util::Unborrow;
use embassy_hal_common::unborrow;
use embassy_stm32::gpio::low_level::AFType;
use embassy_stm32::gpio::Speed;
use embassy_stm32::pwm::*;
use embassy_stm32::time::{Hertz, U32Ext};
use embassy_stm32::unborrow;
use embassy_stm32::{Config, Peripherals};
pub fn config() -> Config {