-
Notifications
You must be signed in to change notification settings - Fork 69
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
Code Formatting: use stdint.h types #35
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a sub-issue of #11. Don't close #11 until all sub-issues are resolved.
I will help with this. Just want to teach the principle too is all since you'll write code faster than I can reformat it :).
To make the code cross-platform and clear, each type should have an explicit size.
unsigned int
on an ATMega328 is 2 bytes, but on an STM32 it is 4 bytes.uint16_t
, however, is always 2 bytes on any platform, period. People may want to move your code to a new platform in the future. This will make the process much better.Here are the standard types: http://www.cplusplus.com/reference/cstdint/
unsigned int
-->uint16_t
unsigned long
-->uint32_t
int
-->int16_t
long
-->int32_t
etc.
nit-picks:
also
byte
-->uint8_t
boolean
-->bool
The text was updated successfully, but these errors were encountered: