From 15e96a4990c0b25a7f51b9177446ebe2b4af3437 Mon Sep 17 00:00:00 2001 From: Empire Date: Fri, 29 Apr 2022 10:47:46 +0200 Subject: [PATCH] ensure compilation with bricking limits is not possible --- esp32/src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index a43c0a4..78ed413 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -751,12 +751,14 @@ void safeSetup() pinMode(OUTPUT_ENABLE_SENSOR, OUTPUT); + static_assert(HomieInternals::MAX_CONFIG_SETTING_SIZE >= MAX_CONFIG_SETTING_ITEMS, "Limits.hpp not adjusted MAX_CONFIG_SETTING_ITEMS"); if (HomieInternals::MAX_CONFIG_SETTING_SIZE < MAX_CONFIG_SETTING_ITEMS) { //increase the config settings Serial << "Limits.hpp is not adjusted, please search for this string and increase" << endl; return; } + static_assert(HomieInternals::MAX_JSON_CONFIG_FILE_SIZE >= MAX_JSON_CONFIG_FILE_SIZE_CUSTOM, "Limits.hpp not adjusted MAX_JSON_CONFIG_FILE_SIZE"); if (HomieInternals::MAX_JSON_CONFIG_FILE_SIZE < MAX_JSON_CONFIG_FILE_SIZE_CUSTOM) { //increase the config settings