Giter VIP home page Giter VIP logo

Comments (4)

hannobraun avatar hannobraun commented on September 22, 2024

Oh man, that really sucks! This means that RTFM is incompatible with any crate taking ownership of CorePeriphals/Peripherals, like my lpc82x-hal crate.

This is bad, in my opinion, because I think the whole extension trait pattern the other HALs have going on is deeply flawed. I wrote about that earlier. I've been planning to write a more detailed article about this issue. I need to prioritize this.

Unless there's some easy way out that I can't see right now, either someone needs to prove me wrong, or RTFM needs to be fixed. Otherwise we'll get to choose between sup-par static guarantees in HAL APIs and a split ecosystem (although, to be honest, I seem to be the only one who's split from the rest of the ecosystem right now :-) ).

from rust-dwm1001.

hannobraun avatar hannobraun commented on September 22, 2024

I'm mostly through your stream now. I think your particular problem can be solved, or at least alleviated, by making the constructors of Led, DW_RST and other such structs public. Then you could construct your own versions of those from what RTFM gives you.

The more general problem I talked about in my previous comment remains. Pretty sure I couldn't do this in lpc82x-hal without significantly weakening its static guarantees.

from rust-dwm1001.

hannobraun avatar hannobraun commented on September 22, 2024

@jamesmunns, @japaric (don't want to ping him needlessly), and I talked about this topic on IRC yesterday. Since RTFM only actually requires CorePeripherals, and handles Peripherals just as a convenience to the user, the broader problem of RTFM clashing with all libraries that take Peripherals can be solved in RTFM. See https://github.com/japaric/cortex-m-rtfm/issues/163.

The more specific problem in this library can be solved by the following action items:

  1. Make constructors of Led, DW_RST, and similiar structs public, as previously mentioned.
  2. Remove anything related to CorePeripherals from DWM1001, or somehow make it optional. I'm not sure right now whether having CorePeripherals is just a convenience or actually required. If it's a convenience, it would be nice to make it optional, if that wouldn't be too complex, but removing it would be fine. If it's required, a solution needs to be found.
  3. Make constructor of DWM1001 public too. I'm have this as a separate item, since the constructor may need to change, depending on how item 2. shakes out.

from rust-dwm1001.

hannobraun avatar hannobraun commented on September 22, 2024

I'm going to close this. The immediate problem was fixed in #82. The more general problem is being discussed in https://github.com/japaric/cortex-m-rtfm/issues/163.

from rust-dwm1001.

Related Issues (12)

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.