Skip to content
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

Portability fixes #35

Merged
merged 25 commits into from
Dec 16, 2016
Merged

Conversation

denravonska
Copy link
Contributor

This reduces the Arduino dependency, allowing the library to more easily be used on other platforms. This closes #33.

N2kDef defines the requirements from the library side. It needs millis() to get the
current uptime, and delay() to be able to delay execution. The header also comes with
a set of macros to be able to store constant data in a more efficient way. Most
platforms do not have a specific way of handling const data, but AVR8 needs explicit
handling to store constant data on flash without copying it to RAM.
N2kDef defines the requirements from the library side. It needs millis() to get the
current uptime, and delay() to be able to delay execution. The header also comes with
a set of macros to be able to store constant data in a more efficient way. Most
platforms do not have a specific way of handling const data, but AVR8 needs explicit
handling to store constant data on flash without copying it to RAM.
For Arduinos we can use the F(..) macro which casts the string to a streamable helper class.
Instead of inventing our own macros, use the AVR macros and functions in code and define them to nothing on non-AVR targets.
@ttlappalainen ttlappalainen merged commit 5df071e into ttlappalainen:master Dec 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Arduino dependencies
2 participants