aboutsummaryrefslogtreecommitdiff
path: root/config-check.h
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-07-25 06:21:11 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-07-25 19:37:44 +0200
commita64156388fc92da1d151a1094e25d9d89240bb38 (patch)
treef65eb7c8b4d7dccb400b67ebc7b82e861ffec13c /config-check.h
parent77e261f12089bd7db854d21fc81a42eaa60e0b67 (diff)
downloadtrygvisio_soil_moisture-a64156388fc92da1d151a1094e25d9d89240bb38.tar.gz
trygvisio_soil_moisture-a64156388fc92da1d151a1094e25d9d89240bb38.tar.bz2
trygvisio_soil_moisture-a64156388fc92da1d151a1094e25d9d89240bb38.tar.xz
trygvisio_soil_moisture-a64156388fc92da1d151a1094e25d9d89240bb38.zip
o Cleaning up #if usage and config.h.
Diffstat (limited to 'config-check.h')
-rw-r--r--config-check.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/config-check.h b/config-check.h
new file mode 100644
index 0000000..f259706
--- /dev/null
+++ b/config-check.h
@@ -0,0 +1,110 @@
+#ifndef CONFIG_CHECK_H
+#define CONFIG_CHECK_H
+
+/*
+ * You have to edit config.h to your likings. The file has to include this:
+ *
+ * #define CONFIF_VERSION <value>
+ *
+ * where value is the value defined below in this file.
+ *
+ * Read the "Configuration Section" below for the defines you can set.
+ */
+
+#include "config.h"
+
+// Arduino IDE or the pre-processed code doesn't complain when an include file is not found.
+#if CONFIG_VERSION != 20150725
+#error *** Read the notes in config-check.h ***
+#endif
+
+/*
+ *
+ * Configuration Section.
+ *
+ * This lists all available configuration items. The items that have default values doesn't have to be included in config.h. The items that are of boolean types evaluate to false if defined to '0' or true for any other value. Some items are default to true if not defined to false.
+ *
+ */
+
+/*******************************************************************************
+ * Board version: SM_BOARD_VERSION
+ *
+ * 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
+ *
+ * No default, has to be specified in config.h
+ */
+
+ /*******************************************************************************
+ * Wait for serial before starting: WAIT_FOR_SERIAL_BEFORE_STARING
+ *
+ * Type: boolean
+ *
+ * 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.
+ */
+
+#ifndef WAIT_FOR_SERIAL_BEFORE_STARING
+#define WAIT_FOR_SERIAL_BEFORE_STARING 1
+#endif
+
+#if WAIT_FOR_SERIAL_BEFORE_STARING == 0
+#undef WAIT_FOR_SERIAL_BEFORE_STARING
+#endif
+
+/*******************************************************************************
+ * Persistent configuration: PERSISTENT_CONFIGURATION_SUPPORT
+ *
+ * Type: boolean
+ *
+ * If enabled the settings for each sensor will be persisted in EEPROM
+ */
+
+#ifndef PERSISTENT_CONFIGURATION_SUPPORT
+#define PERSISTENT_CONFIGURATION_SUPPORT 1
+#endif
+
+#if PERSISTENT_CONFIGURATION_SUPPORT == 0
+#undef PERSISTENT_CONFIGURATION_SUPPORT
+#endif
+
+/*******************************************************************************
+ * Use low power mode: USE_LOW_POWER_MODE
+ *
+ * Type: boolean
+ *
+ * If enabled the device will try to use as little power as possible.
+ *
+ * Not fully functional yet so it is disabled by default.
+ */
+
+// Disabled by default for now
+
+#if USE_LOW_POWER_MODE == 0
+#undef USE_LOW_POWER_MODE
+#endif
+
+/*******************************************************************************
+ * Debug sink: DEBUG_SINK
+ *
+ * Selects where all debug logging will go.
+ *
+ * Values:
+ * 1: no logging, all logging is discarded
+ * 2: Use Serial. Uses the platforms default Serial port, usually the USB or hardware serial ports on your board.
+ */
+
+#ifndef DEBUG_SINK
+// Default to Serial
+#define DEBUG_SINK 2
+#endif
+
+#endif