Make TicArduino compile for Particle devices #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves a few compile-time incompatibilities:
The Spark implementation of
Stream
that Particle is based on useschar*
buffers instead ofuint8_t*
. This required one small tweak in Tic.cpp. I hope this still compiles on other implementations; I don't have the setup to test it unfortunately.The Particle device-os headers do a terrible thing and
#define SPI ...
and other pin constants instead of declaring them as C/C++const
orconstexpr
. This breaks the (beautifullyenum class
'd)TicPin
enum. Since I can't readily change the headers that the Particle cloud-based compiler uses, I'm introducing new aliases that aren't broken by the preprocessor. A#ifndef
guard also allows the existingenum
values if the global namespace hasn't already been littered.The Particle
gcc
config is pretty up-tight about bracing on bit math so I'm adding a few semi-optional parentheses.I have tested this with the latest Particle tool chain.