-
Notifications
You must be signed in to change notification settings - Fork 206
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
How to claim resources without a token? #84
Comments
That's how
This is not possible. Resource proxies (the If you need fine-grained locks, i.e. a struct that contains a resource proxy, you'll have to write a generic struct (e.g. |
Thanks, I'll take a look at mutexes. It'll be hard to do initialisation different, though. |
I think the original question has been answer. If you have additional questions please open a new issue. |
84: refactor the linker script r=therealprof a=japaric to make it more compatible with LLD. This commit contains no functional changes. fixes rtic-rs#70 Overview of changes: - Alignment checks are enabled now that rust-lld (LLD 7.0) supports the modulo operator. - Removed some private symbols (e.g. __foo) in favor of ADDR and SIZEOF. - Turned .got into a NOLOAD section now that rust-lld supports it. - Replaced `ABSOLUTE(.)` with `.` as an old LLD overlap bug seems to be gone and ABSOLUTE seems to cause problems, like rtic-rs#70, on bigger programs. - Made the linker assertion messages more uniform. - Extended test suite to check that linking works with both rust-lld and GNU LD. r? therealprof (chosen at random) Co-authored-by: Jorge Aparicio <jorge@japaric.io>
I am trying to use the clean architecture for my device - i.e. the main application logic is not dependent on the hardware, but is written with a generic output trait that can be instantiated with different types.
For testing, I can instantiate the
Output
with a growing vector where I can inspect the results after processing various example inputs.In the application, I can instantiate the
Output
with a producer that writes into a buffer, getting consumed from the serial port interrupt:Here's the catch: the
SerialBufferProducer
wrapper that implements the appOutput
is supposed to enable the uart tx event after writing to the buffer, and it would need to claim theuart
resource for that!Let's assume that
app
in other tasks as well, so I can't just instantiate it withinidle
and use its token and uart resource in the construction of theSerialBufferProducer
.uart
resource or using bit banding - I really need to prevent otheruart
-using interruptsI think I need a way to access a
uart
resource in theinit
function so that I can put it into theSerialBufferProducer
, and then a way to claim it without being passed a token. The clean architecture prevents me from passing the token that is accessible at the call site ofprocess
through to thewrite
call. What do you think?The text was updated successfully, but these errors were encountered: