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

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

Open
rjsberry opened this issue Feb 27, 2023 · 0 comments
Open

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

rjsberry opened this issue Feb 27, 2023 · 0 comments

Comments

@rjsberry
Copy link

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.

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

No branches or pull requests

2 participants