Skip to content

How to check version of mbed-os at compile time? #3091

@infinnovation-dev

Description

@infinnovation-dev

Description

  • Type: Question

Question

Is there a way to check which version of mbed-os is present e.g. 5.1 versus 5.2? It would be nice if there were some macro such as MBED_VERSION to check against, but I don't see one.

I was trying to get some code to compile cleanly against both 5.1 and (release candidate) 5.2. In 5.2, some methods are deprecated, resulting in warnings, but the alternatives are not available in 5.1. For example Callback(func, arg) c.f. Callback(arg, func).

Sure, I can find some other shibboleth such as MBED_CONF_CORE_STDIO_BAUD_RATE (renamed to MBED_CONF_PLATFORM_STDIO_BAUD_RATE in 5.2) but that doesn't smell right.

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