From 6dd0909fb054067d779e96128a5439420fa1968b Mon Sep 17 00:00:00 2001 From: Andre Stefanov Date: Wed, 30 Nov 2022 23:08:47 +0100 Subject: [PATCH 1/2] added config version validation --- ConfigurationValidation.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ConfigurationValidation.hpp b/ConfigurationValidation.hpp index b05989d2..a40fe0a8 100644 --- a/ConfigurationValidation.hpp +++ b/ConfigurationValidation.hpp @@ -6,6 +6,12 @@ // //////// ////////////////////////////////////// +#define MIN_CONFIG_VERSION 1 + +#if CONFIG_VERSION < MIN_CONFIG_VERSION + #error This firmware requires more recent configuration, visit https://config.openastrotech.com/ +#endif + // Platform #if defined(ESP32) || defined(__AVR_ATmega2560__) // Valid platform From 9dc9d1d44d90d1e900754cfe5953cdb7570c1b53 Mon Sep 17 00:00:00 2001 From: Andre Stefanov Date: Thu, 1 Dec 2022 20:06:23 +0100 Subject: [PATCH 2/2] added handling of undefined CONFIG_VERSION --- ConfigurationValidation.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConfigurationValidation.hpp b/ConfigurationValidation.hpp index a40fe0a8..40afb2f5 100644 --- a/ConfigurationValidation.hpp +++ b/ConfigurationValidation.hpp @@ -8,7 +8,7 @@ #define MIN_CONFIG_VERSION 1 -#if CONFIG_VERSION < MIN_CONFIG_VERSION +#if !defined(CONFIG_VERSION) || CONFIG_VERSION < MIN_CONFIG_VERSION #error This firmware requires more recent configuration, visit https://config.openastrotech.com/ #endif