wake-0 / fhvOS

This repository contains an os for the arm cortex a8 in combination with beaglebone.
GNU General Public License v2.0
7 stars 1 forks source link

[General] Refactoring acc. code conventions #17

Open trylimits opened 9 years ago

trylimits commented 9 years ago

Code conventions as follows:

1.) Always use { } for code blocks 2.) extern functions start with an upper case letter, e.g. GPIOSetPinValue 3.) static functions start with a lower case letter, e.g. doIt(..) 4.) Each "module method" starts with the module its name, e.g. GPIOBlub 5.) Each "module define" starts with the module its name, followed by an underline, all upper case, e.g. "GPIO_BLUB"

trylimits commented 9 years ago

6.) typedefs should start with a lower case letter, and end with _t, e.g. timer_t

trylimits commented 9 years ago

7.) typedefs of structs should be as follows:

typedef struct {
    [...]
} name_t;
trylimits commented 9 years ago

8.) No empty while-loops 9.) switch-case instead of else if

trylimits commented 9 years ago

10.) Comments which are within a code block should be C-style, i.e. // A comment. Comments which describe a method should be /* A function comment */

trylimits commented 9 years ago

11.) No int type in os code. hal/platform.h includes inttypes.h which should always be used.