From 96b3081127f2c89e4b2e04fa5ca6690f7cd1ea9a Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 28 Dec 2019 20:23:36 +0100 Subject: Add config.h --- sw/Makefile | 1 + sw/config.h | 27 +++++++++++++++++++++++++++ sw/main.cpp | 4 +++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 sw/config.h (limited to 'sw') diff --git a/sw/Makefile b/sw/Makefile index 931455a..86ff8a6 100644 --- a/sw/Makefile +++ b/sw/Makefile @@ -23,6 +23,7 @@ BUILD_DIR=build APP_NAME = sw HEADERS = \ + config.h \ pins.hpp \ common.hpp \ relays.hpp \ diff --git a/sw/config.h b/sw/config.h new file mode 100644 index 0000000..a35da46 --- /dev/null +++ b/sw/config.h @@ -0,0 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2019 Matthias P. Braendli + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + +#pragma once + +#define ENABLE_STORE_TO_EEPROM 0 diff --git a/sw/main.cpp b/sw/main.cpp index 77d394f..e4f0a67 100644 --- a/sw/main.cpp +++ b/sw/main.cpp @@ -22,6 +22,8 @@ * SOFTWARE. */ +#include "config.h" + #include #include #include @@ -404,7 +406,7 @@ int main() // One second blink interval pins_set_status(time_now.seconds_ % 2 == 0); -#if 0 +#if ENABLE_STORE_TO_EEPROM /* EEPROM has an endurance of at least 100'000 write/erase cycles. * (Datasheet 8.4 EEPROM Data Memory) * Storing every five hours gives us several years of endurance. -- cgit v1.2.3