-
Notifications
You must be signed in to change notification settings - Fork 4
Add no_std support to structure
#12
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
base: master
Are you sure you want to change the base?
Conversation
|
Great! |
|
Thanks. It doesn't pass tests quite yet when you use |
|
Ah, ok. |
|
Some feedback now would be good. The problem with adding |
|
Hey @liranringel, sorry to prod again, but I'm stuck with the PR so far, and need some feedback on its current state. Thanks! |
|
@shymega it's looking good. |
|
Well, it's not complete yet. It doesn't run on |
|
@shymega I'm sorry I don't have much time these days... |
|
No worries. Been working on it some more. @birkenfeld I've pushed with my latest change, do you have a moment to look through? I'm new to macros with Rust, I barely use them, so I'm blindly coding. Thanks! Specifically, this commit: e0e4c81 I'm also going to squash all these commits into one once tests pass and it works on no_std. |
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
|
Hi @liranringel, I've fixed the commits, so this should merge nicely. I would be grateful if you could review my work, as I'm not certain it's clean. But I hope it works. |
|
Thank you @shymega! |
|
@liranringel Thanks. Shall we see if @birkenfeld has any thoughts on it too? |
|
I promise I'll have a look next week. |
| pub extern crate core2; | ||
|
|
||
| #[doc(hidden)] | ||
| pub use core2::io::{Cursor, Error, ErrorKind, Read, Result, Write}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this should only be used from core2 if std is not active. Otherwise import from std::io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I've since squashed this PR into two commits, but it seems this review is out of date, as on my branch I can't see this line. I've since changed it to only use core2 if std isn't enabled, as-per your review.
|
OK, so after running tests with |
|
Yeah, |
|
@birkenfeld Sorry, family stuff got hold of me. I'm just thinking of the best way to handle these edge cases. We could open an issue with |
|
I've just enquired about the I will keep this PR updated. |
|
The comment was replied to, it's an interesting problem. We can use I'm also wondering if it's just "easier":tm: to implement the packing methods into the firmware transfer protocol on my end, and close this PR... |
|
Just wanted to follow this up with both of you (and anyone else watching). I think the easiest solution is just to copy OR we could implement the The simplest solution is usually the easiest one, but I'm conscious of licensing, and making sure we don't end up with spaghetti code. |
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
As per @birkenfeld's review of this branch, proc-macros can use `std` during compile-time - there's no issues with `no-std`.
For `proc_macro`, as per @birkenfeld's PR review.
|
OK, so tests now pass on I'm lost with the Keen to get this PR in. It would mean I could then communicate over UART on a |
This adds a slightly modified module from `byteorder`, which should run on `no_std`. The `src/lib.rs` has been modified in light of this change.
|
@shymega sorry for not being here for a long time. |
So, currently, it works with the I did attempt to copy the ByteorderExt traits into the PR, and make them work with I'm not sure how to proceed, and it would be great to get external thoughts on the PR as it is now. |
Hey @liranringel - were you able to look into the macro? No rush :-) |
This is a draft PR that adds no_std support to the crate, thereby enabling embedded hardware to use the crate
It is a collaborative effort with @birkenfeld and @shymega (I), and so the discussion will be moved here.
I had made a grave error in originally opening a PR for this, in that I opened it here - Cosmo-CoDiOS#2 - a mistake on my part.
Hopefully, this can now be reviewed.