From c78be523bbcdc802929ce8f6fb119836dcbf99d5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 28 Feb 2015 10:54:19 +0100 Subject: o Creating a way to configure the code for multiple boards. Look at config.h --- config.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 config.h (limited to 'config.h') diff --git a/config.h b/config.h new file mode 100644 index 0000000..e18a655 --- /dev/null +++ b/config.h @@ -0,0 +1,86 @@ +#ifndef CONFIG_H +#define CONFIG_H + +/* + +TL; DR; If you are using Arduino IDE, you have to configure this file. +See the first section. + +This file controls how the sketch work so this is where your should +start to adjust settings. If you are using Arduino-Makefile you can +set these values by editing the EXTRA_FLAGS Makefile variable. + +If you are using the Arduino IDE and want to set a configuration +value, change the lines that look like this: + +// #define FOO ... + +to + +#define FOO 1 + +*/ + +/* + +Configuration Section + +If you are using the Arduino IDE, change stuff in this section. All +values are commented out, but some have default values + +*/ + +// You have to set this to match your board. The build will fail if +// you don't set it. +// +// Values: +// 1: prototype-a, the hand assembled PCB +// 2: prototype-b, the china produced PCB +// +// Default: not set, you have to set it +// #define SM_BOARD_VERSION ... + +// If enabled the code won't start until you open the serial port +// monitor or otherwise connect to the serial port. +// +// This is useful to have defined when using the device with the +// Arduino IDE, but when you want to use it with a plant you don't +// want this to be set. +// +// Values: +// 0: Do not wait +// 1: Wait +// Default: 1 +// #define WAIT_FOR_SERIAL_BEFORE_STARING ... + +// If enabled the sensor's name will be persisted in EEPROM +// +// Values: +// 0: disabled +// 1: enabled +// Default: 0 +// #define PERSISTENT_CONFIGURATION_SUPPORT ... + +/* + +Default Values Section + +Do not touch stuff in this section, it only sets default values. + +*/ + +#ifndef WAIT_FOR_SERIAL_BEFORE_STARING +#define WAIT_FOR_SERIAL_BEFORE_STARING 1 +#endif + +#ifndef PERSISTENT_CONFIGURATION_SUPPORT +// Default to off, the code is not fully functional yet +#define PERSISTENT_CONFIGURATION_SUPPORT 0 +#endif + +#ifndef SM_DEBUG +#define SM_DEBUG 1 +#endif + +#endif + -- cgit v1.2.3