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

Externally defined Init/Idle #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AfoHT
Copy link
Contributor

@AfoHT AfoHT commented Feb 5, 2022

Tasks support being externally defined, idle and init should too.

rtic-syntax component of fixing rtic-rs/rtic#505

Henrik Tjäder added 2 commits February 5, 2022 11:47
Tasks can be externally defined, so should idle and init
@Ridtt
Copy link

Ridtt commented Feb 19, 2022

Review this pr please, it's very important for those who use Clion without proper macro proc. Actually the only way to write code with autocomplete and syntax highlighting.

@perlindgren
Copy link
Contributor

Review this pr please, it's very important for those who use Clion without proper macro proc. Actually the only way to write code with autocomplete and syntax highlighting.

Indeed, however there is more work needed in codegen to make this work, this is the first step (the parsing).

@AfoHT
Copy link
Contributor Author

AfoHT commented Sep 28, 2022

TODO: Make sure that the visibility of the shared and local struct is pub if externalized, and propagate it

@johngigantic
Copy link

Commenting to express some interest in this feature. I'm starting to work on some more complicated apps and I'd love to put initialization in a separate module.

bors bot added a commit to rtic-rs/rtic that referenced this pull request Jun 14, 2023
767: allow #[init] and #[idle] to be externed r=korken89 a=wiktorwieclaw

I updated `rtic-macros` to a allow init and idle to be externally defined.

## Design notes
* Updated `extern_binds` example to include external #[init] and #[idle] functions.
* Added docs to Local and Shared structs. The `extern_binds` example has a `#![deny(missing_docs)]` which caused some issues.

## Testing
Apart from building the example, I also used this feature in one of my projects and ran it on a MCU [here](https://github.com/grupacosmo/cansat/blob/98ca7bd42e737adfb140a548da1ade01beb495da/crates/cansat-stm32f4/src/main.rs#L59-L74)

## Related issues
* #505

## Related PRs
* rtic-rs/rtic-syntax#71

Co-authored-by: Vixu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants