Skip to content

Commit

Permalink
clock/v2: Fix Rust 2021 incompatible prefixed identifies
Browse files Browse the repository at this point in the history
  • Loading branch information
glaeqen committed Nov 2, 2021
1 parent d2bf8a3 commit 447f5db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions hal/src/thumbv7em/clock/v2/gclk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,19 @@ pub mod marker {
impl_gclk1_source!(Gclk0);

seq!(N in 2..=11 {
impl_gclk1_source!(Gclk#N);
impl_gclk1_source!(Gclk #N);
});

seq!(N in 2..=11 {
/// Type which serves as a source marker for the corresponding
/// [`super::Gclk`] and provides numerical identity for it
///
/// Standard division factor, see [`GclkDiv`]
pub enum Gclk#N {}
impl Sealed for Gclk#N {}
impl NotGclk0 for Gclk#N {}
impl NotGclk1 for Gclk#N {}
impl GclkNum for Gclk#N {
pub enum Gclk #N {}
impl Sealed for Gclk #N {}
impl NotGclk0 for Gclk #N {}
impl NotGclk1 for Gclk #N {}
impl GclkNum for Gclk #N {
const NUM: usize = N;
type DividerType = GclkDiv;
}
Expand Down Expand Up @@ -716,7 +716,7 @@ impl<T: GclkSourceMarker> Enabled<Gclk0<T>, U1> {

seq!(G in 0..=11 {
/// Alias of [`Gclk`]`<marker::GclkX, _>`
pub type Gclk#G<S> = Gclk<marker::Gclk#G, S>;
pub type Gclk #G<S> = Gclk<marker::Gclk #G, S>;
});

//==============================================================================
Expand All @@ -727,7 +727,7 @@ seq!(N in 1..=11 {
/// [`Gclk`] tokens ensuring there only exists one instance of each [`Gclk`]
pub struct Tokens {
#( /// GclkToken for Gclk#N
pub gclk#N: GclkToken<marker::Gclk#N>, )*
pub gclk #N: GclkToken<marker::Gclk #N>, )*
}

impl Tokens {
Expand All @@ -738,7 +738,7 @@ seq!(N in 1..=11 {
// Return all tokens when initially created
unsafe {
Tokens {
#( gclk#N: GclkToken::new(), )*
#( gclk #N: GclkToken::new(), )*
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions hal/src/thumbv7em/clock/v2/gclkio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,18 +386,18 @@ seq!(N in 0..=11 {
/// Tokens for every [`GclkIn`] and [`GclkOut`]
pub struct Tokens {
#( /// GclkIn #N
pub gclk_in#N: GclkInToken<marker::Gclk#N>, )*
pub gclk_in #N: GclkInToken<marker::Gclk #N>, )*
#( /// GclkOut #N
pub gclk_out#N: GclkOutToken<marker::Gclk#N>, )*
pub gclk_out #N: GclkOutToken<marker::Gclk #N>, )*
}

impl Tokens {
// Populate the Tokens struct and return it
#[inline]
pub(super) unsafe fn new() -> Tokens {
Tokens {
#( gclk_in#N: GclkInToken::new(), )*
#( gclk_out#N: GclkOutToken::new(), )*
#( gclk_in #N: GclkInToken::new(), )*
#( gclk_out #N: GclkOutToken::new(), )*
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions hal/src/thumbv7em/clock/v2/pclk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ pub trait PclkSourceMarker: GclkNum + SourceMarker {
}

seq!(N in 0..=11 {
impl PclkSourceMarker for marker::Gclk#N {
const PCLK_SRC: PclkSourceEnum = PclkSourceEnum::GCLK#N;
impl PclkSourceMarker for marker::Gclk #N {
const PCLK_SRC: PclkSourceEnum = PclkSourceEnum::GCLK #N;
}
});

Expand Down

0 comments on commit 447f5db

Please sign in to comment.