Skip to content

Code Formatting: use stdint.h types #35

@ElectricRCAircraftGuy

Description

@ElectricRCAircraftGuy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions