Skip to content

Recommend defining standardized MCU and CPU identification macros in platform specification #988

Open
@trlafleur

Description

@trlafleur

The IDE, using the variant.h file knows what CPU the user has selected and then can make a decision on the proper flags to invoke to build the project...

On the compile line is uses the "-mcpu" to define the CPU family to use. "-mcpu=cortex-m4".
This information should ALSO be added as a "-D" flag, to give a consistent format for the user to determine the processor class he is using at run time. -Dcortex-m4

Also as the IDE knows the exact processor it using, it should also be added as a -D flag.
-D__SAMD51G19A__

In reviewing a number of variant.h file, it's very inconsistent from manufacturer to manufacturer on what -D flags are included.

Doing this would add a very consistent format that code developers could depend on...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions