From a257e55403e584d9759f147a5e446cbfe726c9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sun, 11 Dec 2016 23:33:13 +0100 Subject: [PATCH] Update CONTRIBUTING.md --- CONTRIBUTING.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc4d633..7f93fe8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,3 +72,40 @@ void do_this() ``` myFunction(); ``` + +## Header file structure + +Header files are composed of sections. The order of sections is fixed. Every header file is guarded by a file-wide `#ifndef`. + +``` +#ifndef __LED_DRIVER_H__ +#define __LED_DRIVER_H__ + +// Includes: + + #include "fsl_gpio.h" + ... + +// Macros: + + #define LED_DRIVER_SDB_PORT PORTA + ... + +// Typedefs: + + typedef struct { + ... + } led_driver_state_t; + +// Variables: + + extern led_driver_state_t ledDriverState; + ... + +// Functions: + + extern void LedDriver_WriteBuffer(uint8_t i2cAddress, uint8_t buffer[], uint8_t size); + ... + +#endif +```