Git Product home page Git Product logo

Comments (3)

japaric avatar japaric commented on August 26, 2024

How to claim resources without a token?

That's how Mutex.lock works in v0.4.0; you don't need a token -- the Threshold token is gone in v0.4.0.

I think I need a way to access a uart resource in the init function

This is not possible. Resource proxies (the structs that implement the Mutex trait) are tied to the stack frame of the task that owns them; they are not Send, either, so even if you could create one in init you would not be able to move into any task.

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. struct Foo<R> where R: Mutex<Data = u32> { resource: R, state: State } and re-instantiate it in every task where you need it.

from rtic.

bergus avatar bergus commented on August 26, 2024

Thanks, I'll take a look at mutexes. It'll be hard to do initialisation different, though.

from rtic.

japaric avatar japaric commented on August 26, 2024

I think the original question has been answer. If you have additional questions please open a new issue.

from rtic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.