-
Notifications
You must be signed in to change notification settings - Fork 89
Support 8-bit microcontrollers #79
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
Conversation
Changed Node and Reader APIs to read doubles and convert to floats when MPACK_DOUBLES is disabled.
|
Thanks for the PR. The last commit to replace Also, I mentioned in #74 that I'm a bit uncomfortable with the double to float conversion code being copied from ArduinoJson without attribution. ArduinoJson appears to also be MIT-licensed so it's not much of an issue but I'll probably add at least a link to it. @ethanjli Are you OK with your commits to support |
|
@ludocode the problem is with platforms where UINT32_MAX is much larger than SIZE_MAX (e.g AVR where size_t is 16 bit). My code wouldn't compile without this change. Knowing what you explained, I can think of another change that will check the proper size of size_t but not allow it to be bigger than 32 bit. I can also add attribution. Would those changes make the code correct enough to be accepted here as a PR? |
|
Thanks for making the PR - I haven't had time to look at this in the past several weeks, but I'm OK with my commits being merged into this repo. |
Floats and doubles can now be parsed as raw data if the platform does not support `float` or `double`. On platforms that support only `float` and not `double`, this implements a manual conversion from a 64-bit double to `float` to allow parsing doubles as floats. (See #79 for a bit of discussion on this.)
This is a fix for the incomplete maxsize change from #79.
|
I believe this is now all fixed.
The unit tests don't actually work on AVR yet. For one thing the unit test suite is way too big so it doesn't link, and for another, I don't have the entry point set up properly or something because e.g. |
This PR integrates the fixes by @ethanjli as well as a small fix by me to prevent an overflow error