adamgreig / assign-resources

Rust macro to split up fields of a Peripherals struct into new structs
31 stars 3 forks source link

Attributes not passed to type aliases #9

Open JuliDi opened 10 months ago

JuliDi commented 10 months ago

I am trying to reuse the resources struct with a new hardware iteration that has some pin changes. However, I would like to keep the old config around and switch between the assignments with a feature.

Unfortunately, I am not make the macro repeat the feature attribute again before the type alias and I keep getting "the name ResetPin is defined multiple times" errors. Any ideas how this could be fixed?

#[cfg(feature="feat")]
reset: PD7 = ResetPin,
#[cfg(not(feature = "feat"))]
reset: PG3 = ResetPin,