Skip to content

Commit

Permalink
Rename a name from a copy/paste and fix SCL pin type
Browse files Browse the repository at this point in the history
The macro i2c_pins was probably copied from the uart one.
The type for the SCL pin was also changed from OutputMode to OD<Floating>.
  • Loading branch information
dkm committed Jul 19, 2020
1 parent 44b0fdf commit 71b2988
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tm4c-hal/src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ pub enum Error {
#[macro_export]
/// Implements the traits for an I2C peripheral
macro_rules! i2c_pins {
($UARTn:ident,
($I2Cn:ident,
scl: [$(($($sclgpio: ident)::*, $sclaf: ident)),*],
sda: [$(($($sdagpio: ident)::*, $sdaaf: ident)),*],
) => {
$(
unsafe impl SclPin<$UARTn> for $($sclgpio)::*<AlternateFunction<$sclaf, OpenDrain<Floating>>>
unsafe impl<T> SclPin<$I2Cn> for $($sclgpio)::*<AlternateFunction<$sclaf, T>>
where
T: OutputMode,
{}
)*

$(
unsafe impl<T> SdaPin<$UARTn> for $($sdagpio)::*<AlternateFunction<$sdaaf, T>>
unsafe impl<T> SdaPin<$I2Cn> for $($sdagpio)::*<AlternateFunction<$sdaaf, T>>
where
T: OutputMode,
{}
Expand Down

0 comments on commit 71b2988

Please sign in to comment.