AmboVent-1690-108 / AmboVent

AmboVent 1690.108
The Unlicense
206 stars 69 forks source link

Code Formatting: use stdint.h types #35

Open ElectricRCAircraftGuy opened 4 years ago

ElectricRCAircraftGuy commented 4 years ago

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

ElectricRCAircraftGuy commented 4 years ago

PR #46 resolves a tiny portion of this issue