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

Something like cmim on top of GroundedCell? #6

Open
jamesmunns opened this issue Jun 1, 2024 · 0 comments
Open

Something like cmim on top of GroundedCell? #6

jamesmunns opened this issue Jun 1, 2024 · 0 comments

Comments

@jamesmunns
Copy link
Owner

jamesmunns commented Jun 1, 2024

It might be useful to revisit the concept of data "owned" by an ISR, and a container of some type that gives access to that.

I did this with cmim using the VECTACTIVE field of cortex-m: https://docs.rs/cmim/latest/cmim/, it might be nice to have a container like that with an API that lets you:

  • Make a container that starts empty, not with any ISR attached, like static CONTAINER: VectorCell<Uart> = VectorCell::new();
  • CONTAINER.give(Interrupt::Uart, data);, which you can use in main, which uses a critical section to move data into the cell and "register" that it should only be accessible by that interrupt
  • CONTAINER.get() -> Option<&mut T> which only works in the registered ISR
  • CONTAINER.take() -> Option<T> which uses a critical section to take the data back out
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

No branches or pull requests

1 participant