ensure compilation with bricking limits is not possible

This commit is contained in:
Empire 2022-04-29 10:47:46 +02:00
parent 0dd4553999
commit 15e96a4990

View File

@ -751,12 +751,14 @@ void safeSetup()
pinMode(OUTPUT_ENABLE_SENSOR, OUTPUT); 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) if (HomieInternals::MAX_CONFIG_SETTING_SIZE < MAX_CONFIG_SETTING_ITEMS)
{ {
//increase the config settings //increase the config settings
Serial << "Limits.hpp is not adjusted, please search for this string and increase" << endl; Serial << "Limits.hpp is not adjusted, please search for this string and increase" << endl;
return; 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) if (HomieInternals::MAX_JSON_CONFIG_FILE_SIZE < MAX_JSON_CONFIG_FILE_SIZE_CUSTOM)
{ {
//increase the config settings //increase the config settings