diff --git a/general/standards/embedded-coding-standard.rst b/general/standards/embedded-coding-standard.rst index d1d9891..7902035 100644 --- a/general/standards/embedded-coding-standard.rst +++ b/general/standards/embedded-coding-standard.rst @@ -1,2 +1,46 @@ Embedded (Firmware) Coding Standard -=================================== +*********************************** + +Coding Style +============ + +Use snake case for variable and function name (snake_case) +100 character max per line +Use const and #define instead of magic number + +Include Order +------------- +* C Standard Library (e.g. ) +* Platform specific system header (e.g. ) +* Project local header file (e.g. "imu.h") + +Include Guards +-------------- + +For most firmware: + +.. code-block:: c + + #ifndef _FILENAME_H + #define _FILENAME_H + + /* Your code here */ + + #endif + +For firmware libraries: + +.. code-block:: c + + #ifndef _LIBRARY_FILENAME_H + #define _LIBRARY_FILENAME_H + + /* Your code here */ + + #endif + +Formatting +---------- +Just use `team-wide clang-format config `_ + +