Comments (4)
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.
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.
@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:
- Make constructors of
Led
,DW_RST
, and similiar structs public, as previously mentioned. - Remove anything related to
CorePeripherals
fromDWM1001
, or somehow make it optional. I'm not sure right now whether havingCorePeripherals
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. - 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.
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)
- Consider adding board to bobbin-sdk HOT 2
- Add type parameter to `Led` to identify pin HOT 1
- `dw1000_id` example doesn't work with LLD HOT 1
- Add support for the buttons on the dev board HOT 2
- Build currently broken due to missing git dep HOT 1
- Apply range bias to distance measurement HOT 4
- Current build is broken due to ieee802154 changes HOT 4
- Enable correct feature for nrf52832-hal dependency
- Ranging examples (possibly) don't work in release mode HOT 1
- Make DW_IRQ and DW_RST constructors public HOT 2
- Use latest version of embedded-hal traits HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-dwm1001.