Skip to content

Add internal features for device capabilities #130

@usbalbin

Description

@usbalbin

Today we have lots of places with code like this:

#[cfg(any(
    feature = "stm32g471",
    feature = "stm32g473",
    feature = "stm32g474",
    feature = "stm32g483",
    feature = "stm32g484",
    feature = "stm32g491",
    feature = "stm32g4a1",
))]
use self::config::ExternalTrigger345;

What do you think about adding a set of internal device features so something like the above instead could be written like

#[cfg(feature = "has_adc345")]
use self::config::ExternalTrigger345;

or similar?

Here is a list of device capabilities.

BTW is there any way to make these features internal/private since they are supposed to be selected as a direct consequence of selecting mcu feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions