From bdb94ac0cac9f4a95033a41abc420cc01c75ffad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Thu, 15 Jun 2017 23:52:27 +0200 Subject: [PATCH] Create CONTRIBUTING.md --- CONTRIBUTING.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 36c5c4f..b1a3538 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,10 +10,15 @@ ## Naming identifiers -Functions are written with UpperCamelCase and verb is followed by noun. +Extern functions and variables are written with UpperCamelCase, non-extern functions and variables are written with lowerCamelCase. + +Function names are composed of a verb followed by a noun. ``` -DoThis(); +DoThisExtern(); +doThisNonExtern(); +uint8 ExternVariable; +uint8 nonExternVariable; ``` Whenever a file exposes a group of functions as a consistent API, their function names should be prefixed with the group name, followed by `_`, followed by the individual function names. @@ -24,12 +29,6 @@ void LedDriver_WriteRegister(uint8_t i2cAddress, uint8_t reg, uint8_t val); void LedDriver_SetAllLedsTo(uint8_t val); ``` -Non-function scoped variables are written with UpperCamelCase. - -``` -uint8_t OuterVariable; -``` - Function scoped variables and function parameters are written with lowerCamelCase. ```