@@ -97,18 +97,18 @@ impl<B: PinBank> Iterator for BankInterruptsIter<B> {
9797 match self . idx {
9898 32 .. => {
9999 // We have iterated over all pins: nothing more to do.
100- return None ;
100+ None
101101 }
102102 idx if self . irq & ( 1 << idx) != 0 => {
103103 // Pin number `idx` had a pending interrupt.
104104 let pin = self . idx ;
105- self . idx = self . idx + 1 ;
105+ self . idx += 1 ;
106106 Some ( pin)
107107 }
108108 _ => {
109109 // Pin number `idx` did not have a pending interrupt:
110110 // advance to the next pin.
111- self . idx = self . idx + 1 ;
111+ self . idx += 1 ;
112112 self . next ( )
113113 }
114114 }
@@ -253,28 +253,41 @@ macro_rules! bank {
253253macro_rules! banks {
254254 (
255255 $(
256+ $( #[ $cfg1: meta] ) ?
256257 $Bank: ident {
257258 $(
258- $( #[ $cfg : meta] ) ?
259+ $( #[ $cfg2 : meta] ) ?
259260 ( $Id: ident, $NUM: literal) ,
260261 ) +
261262 }
262263 ) +
263264 ) => {
264265 $(
265- $(
266- $( #[ $cfg] ) ?
267- pin_id!( $Bank, $Id, $NUM) ;
268- ) +
269- bank!(
270- $Bank,
271- $(
272- $( #[ $cfg] ) ?
273- $Id,
274- ) +
275- ) ;
276- impl PinBank for $Bank {
277- const DYN : DynBank = DynBank :: $Bank;
266+ paste! {
267+ $( #[ $cfg1] ) ?
268+ mod [ <$Bank: lower _impl>] {
269+ use super :: * ;
270+
271+ $(
272+ $( #[ $cfg2] ) ?
273+ pin_id!( $Bank, $Id, $NUM) ;
274+ ) +
275+
276+ bank!(
277+ $Bank,
278+ $(
279+ $( #[ $cfg2] ) ?
280+ $Id,
281+ ) +
282+ ) ;
283+
284+ impl PinBank for $Bank {
285+ const DYN : DynBank = DynBank :: $Bank;
286+ }
287+
288+ }
289+ $( #[ $cfg1] ) ?
290+ pub use [ <$Bank: lower _impl>] :: * ;
278291 }
279292 ) +
280293 } ;
@@ -288,6 +301,7 @@ banks!(
288301 ( PA3 , 3 ) ,
289302 ( PA4 , 4 ) ,
290303 ( PA5 , 5 ) ,
304+ #[ cfg( feature = "pins-144" ) ]
291305 ( PA6 , 6 ) ,
292306 ( PA7 , 7 ) ,
293307 ( PA8 , 8 ) ,
@@ -311,6 +325,7 @@ banks!(
311325 ( PA26 , 26 ) ,
312326 ( PA27 , 27 ) ,
313327 ( PA28 , 28 ) ,
328+ #[ cfg( feature = "pins-144" ) ]
314329 ( PA29 , 29 ) ,
315330 ( PA30 , 30 ) ,
316331 ( PA31 , 31 ) ,
@@ -331,6 +346,7 @@ banks!(
331346 ( PB13 , 13 ) ,
332347 }
333348
349+ #[ cfg( feature = "pins-144" ) ]
334350 C {
335351 ( PC0 , 0 ) ,
336352 ( PC1 , 1 ) ,
@@ -390,17 +406,20 @@ banks!(
390406 ( PD20 , 20 ) ,
391407 ( PD21 , 21 ) ,
392408 ( PD22 , 22 ) ,
409+ #[ cfg( feature = "pins-144" ) ]
393410 ( PD23 , 23 ) ,
394411 ( PD24 , 24 ) ,
395412 ( PD25 , 25 ) ,
396413 ( PD26 , 26 ) ,
397414 ( PD27 , 27 ) ,
398415 ( PD28 , 28 ) ,
416+ #[ cfg( feature = "pins-144" ) ]
399417 ( PD29 , 29 ) ,
400418 ( PD30 , 30 ) ,
401419 ( PD31 , 31 ) ,
402420 }
403421
422+ #[ cfg( feature = "pins-144" ) ]
404423 E {
405424 ( PE0 , 0 ) ,
406425 ( PE1 , 1 ) ,
0 commit comments