InfiniTime.git

commit e4f0a95af8ce6cfb71602c5f5e437ab68dd582ec

Author: JF <jf@codingfield.com>

Add coding conventions in contribute.md

 doc/contribute.md | 22 +++++++++++++++++++++-


diff --git a/doc/contribute.md b/doc/contribute.md
index 53c6ac0650873a4158e1091ae26febbefaba24ad..40441cd29edaddaa053c7249a67db6bd2176055f 100644
--- a/doc/contribute.md
+++ b/doc/contribute.md
@@ -21,4 +21,24 @@ Then, you can submit a pull-request for review. Try to describe your pull request as much as possible: what did you do in this branch, how does it work, how is it designed, are there any limitations,... This will help the contributors to understand and review your code easily.
 
 Other contributors can post comments about the pull request, maybe ask for more info or adjustements in the code.
 
-Once the pull request is reviewed an accepted, it'll be merge in **develop** and will be released in the next release version of the firmware.
\ No newline at end of file
+Once the pull request is reviewed an accepted, it'll be merge in **develop** and will be released in the next release version of the firmware.
+
+# Coding convention
+## Language
+The language of this project is **C++**, and all new code must be written in C++. (Modern) C++ provides a lot of useful tools and functionalities that are beneficial for embedded software development like `constexpr`, `template` and anything that provides zero-cost abstraction.  
+
+It's OK to include C code if this code comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK. 
+
+## Coding style
+The most important rule to follow is to try to keep the code as easy to read and maintain as possible. 
+
+ - **Identation** : 2 spaces, no tabulation
+ - **Opening brace** at the end of the line
+ - **Naming** : Choose self-describing variable name
+    - **class** : PascalCase
+    - **namespace** : PascalCase
+    - **variable** : camelCase, **no** prefix/suffix ('_', 'm_',...) for class members
+ - **Include guard** : `#pragma once` (no `#ifdef __MODULE__ / #define __MODULE__ / #endif`)
+ - **Includes** :
+    - files from the project : `#include "relative/path/to/the/file.h"`
+    - external files and std : `#include <file.h>`
\ No newline at end of file