2424
2525use core:: { convert:: Infallible , marker:: PhantomData } ;
2626
27+ pub use frunk:: hlist:: { HList , Plucker } ;
28+
2729use crate :: peripherals:: { GPIO , IO_MUX } ;
2830#[ cfg( xtensa) ]
2931pub ( crate ) use crate :: rtc_pins;
3032pub use crate :: soc:: gpio:: * ;
31- pub ( crate ) use crate :: { gpiopin_HList, gpiopin_hlist, analog, gpio} ;
32- pub use frunk:: hlist:: { HList , Plucker } ;
33-
33+ pub ( crate ) use crate :: { analog, gpio, gpiopin_HList, gpiopin_hlist} ;
3434
3535/// Convenience type-alias for a no-pin / don't care - pin
3636pub type NoPinType = Gpio0 < Unknown > ;
@@ -1308,14 +1308,19 @@ impl IO<InitialPinHList> {
13081308 }
13091309}
13101310impl < T > IO < T > {
1311- pub fn pluck_pin < const NUM : u8 , Remaining > ( self ) -> ( GpioPin < Unknown , NUM > , IO < T :: Remainder > )
1311+ pub fn pluck_pin < const NUM : u8 , Remaining > ( self ) -> ( GpioPin < Unknown , NUM > , IO < T :: Remainder > )
13121312 where
13131313 T : Plucker < GpioPin < Unknown , NUM > , Remaining > ,
13141314 GpioPin < Unknown , NUM > : GpioProperties ,
13151315 {
13161316 let ( pin, remaining_pins) = self . pins . pluck ( ) ;
1317- ( pin, IO { _io_mux : self . _io_mux , pins : remaining_pins } )
1318-
1317+ (
1318+ pin,
1319+ IO {
1320+ _io_mux : self . _io_mux ,
1321+ pins : remaining_pins,
1322+ } ,
1323+ )
13191324 }
13201325}
13211326pub trait GpioProperties {
@@ -1326,6 +1331,7 @@ pub trait GpioProperties {
13261331}
13271332
13281333/// ```
1334+ /// #[rustfmt::skip]
13291335/// let expected = frunk::hlist!(
13301336/// GpioPin::<Unknown>, 0>::new(),
13311337/// GpioPin::<Unknown>, 1>::new(),
@@ -1339,20 +1345,23 @@ macro_rules! gpiopin_hlist {
13391345 frunk:: hlist![ $( GpioPin :: <Unknown , $gpionum>:: new( ) ) ,+]
13401346 } ;
13411347}
1342- ///```
1348+ /// ```
13431349/// // This should macro-expand to the same as `Expected`
13441350/// type GeneratedType = gpio_HList!(0, 1, 2);
13451351///
1346- /// // expected expantion
1352+ /// // expected expantion
1353+ /// #[rustfmt::skip]
13471354/// type ExpectedType = HCons<GpioPin<Unknown, { 0 }>,
1348- /// HCons<GpioPin<Unknown, { 1 }>,
1349- /// HCons<GpioPin<Unknown, { 2 }>,
1350- /// HNil>>>;
1355+ /// HCons<GpioPin<Unknown, { 1 }>,
1356+ /// HCons<GpioPin<Unknown, { 2 }>,
1357+ /// HNil>>>;
13511358///
13521359/// // let's set up a means to put the type-checker to use
13531360/// struct ExpectedMaker;
13541361/// impl ExpectedMaker {
1355- /// fn make() -> ExpectedType {unimplemented!()}
1362+ /// fn make() -> ExpectedType {
1363+ /// unimplemented!()
1364+ /// }
13561365/// }
13571366///
13581367/// fn main() {
@@ -1361,7 +1370,7 @@ macro_rules! gpiopin_hlist {
13611370/// // ...but if it doesn't conform to the actual expansion, this doc-test fails
13621371/// let test: GeneratedType = ExpectedMaker::make();
13631372/// }
1364- ///```
1373+ /// ```
13651374#[ macro_export]
13661375macro_rules! gpiopin_HList {
13671376 ( $( $gpionum: expr) ,+) => {
0 commit comments