Skip to content

Consider adding declarative macros in cortex-m-rt #473

Open
@rjsberry

Description

@rjsberry

It would be great to have a "lite" version of the macros in cortex-m-rt which are written without proc-macro and related dependencies. For smaller applications which do not have a lot of crates in their dependency graphs this would be a nice way to reduce compile times a bit.

This would be a similar to what pin-project-lite is to pin-project. There is probably a discussion around whether this warrants a new crate (such as cortex-m-rt-lite) or simply a feature flag in cortex-m-rt to swap between procedural and declarative macro implementations.

This would allow users to write code like:

#![no_main]
#![no_std]

extern crate panic_halt;

use cortex_m_rt_lite::{entry, exception};

entry! {
    fn main() -> ! {
        // init...

        loop {
            // app logic...
        }
    }
}

exception! {
    fn SysTick() {
        // ...
    }
}

If you broadly agree with the change I'd be happy to implement it and submit a PR.

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