Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADC code relies on deprecated feature macros #229

Open
bcattle opened this issue Aug 29, 2023 · 1 comment
Open

ADC code relies on deprecated feature macros #229

bcattle opened this issue Aug 29, 2023 · 1 comment

Comments

@bcattle
Copy link

bcattle commented Aug 29, 2023

Hello everyone!

In src/adc.rs analog input pins are enabled based on feature macros like the following:

#[cfg(all(
    feature = "stm32l072",
    any(
        feature = "lqfp64",
        feature = "lqfp100",
        feature = "tfbga64",
        feature = "ufbga64",
        feature = "ufbga100",
        feature = "wlcsp49",
    ),
))]
adc_pins! {
    Channel10: (gpioc::PC0<Analog>, 10u8),
    Channel11: (gpioc::PC1<Analog>, 11u8),
    Channel12: (gpioc::PC2<Analog>, 12u8),
}

However the "stm32l072" feature is not defined in Cargo.tomland appears to have been replaced:

# Legacy features (don't use those anymore)
# ...
stm32l072 = ["stm32l0x2"]
#...

# Later for example ... 
mcu-STM32L072V8Tx = ["stm32l0x2", "lqfp100", "io-STM32L071", "eeprom-3072", "flash-64", "ram-20"]
m
# ...

Should I update adc.rs to use the new macros? Thanks.

@jamwaffles
Copy link
Contributor

Hey, good catch! Yes if you don't mind updating them I'd happily accept a PR. I haven't touched this crate in a while so maybe this isn't the best way, but you could use something like this instead:

#[cfg(any(
    feature = "io-STM32L051",
    feature = "io-STM32L071",
    feature = "stm32l0x2",
    feature = "stm32l0x3"
))]

(based on this code) - ymmv!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants