[Cleanup] Minor optimizations to reduce build size

This commit is contained in:
TD-er
2022-06-23 12:42:27 +02:00
parent 01514a8b3a
commit 1dc76de73f
8 changed files with 97 additions and 10 deletions
+1
View File
@@ -20,6 +20,7 @@ lib_ignore = ESP8266Ping
extends = common, core_esp32_IDF4_4__2_0_3
lib_deps =
Adafruit_ST77xx
Adafruit NeoPixel
ArduinoOTA
ESP32HTTPUpdateServer
FrogmoreScd30
+1
View File
@@ -53,6 +53,7 @@ build_unflags = -DDEBUG_ESP_PORT
-fexceptions
lib_deps =
Adafruit_ST77xx
Adafruit NeoPixel
ESP8266HTTPUpdateServer
ESP8266WebServer
FrogmoreScd30
+2 -2
View File
@@ -106,7 +106,7 @@ volatile bool PLUGIN_118_Int = false;
// Forward declarations
void PLUGIN_118_ITHOcheck();
void PLUGIN_118_Publishdata(struct EventStruct *event);
void PLUGIN_118_PluginWriteLog(const String& command);
void PLUGIN_118_PluginWriteLog(const __FlashStringHelper * command);
ICACHE_RAM_ATTR void PLUGIN_118_ITHOinterrupt()
{
@@ -584,7 +584,7 @@ void PLUGIN_118_Publishdata(struct EventStruct *event)
#endif // ifndef BUILD_NO_DEBUG
}
void PLUGIN_118_PluginWriteLog(const String& command)
void PLUGIN_118_PluginWriteLog(const __FlashStringHelper * command)
{
String log = F("Send Itho command for: ");
+5 -5
View File
@@ -1092,10 +1092,7 @@ To create/register a plugin, you have to :
#endif
#endif
// TESTING #####################################
#ifdef PLUGIN_SET_TESTING
#if defined(PLUGIN_SET_TESTING) || defined(PLUGIN_SET_TESTING_A) || defined(PLUGIN_SET_TESTING_B) || defined(PLUGIN_SET_TESTING_C) || defined(PLUGIN_SET_TESTING_D) || defined(PLUGIN_SET_TESTING_E)
#if !defined(PLUGIN_SET_MAX) && !defined(ESP32)
#ifndef LIMIT_BUILD_SIZE
#define LIMIT_BUILD_SIZE
@@ -1103,8 +1100,11 @@ To create/register a plugin, you have to :
#ifndef NOTIFIER_SET_NONE
#define NOTIFIER_SET_NONE
#endif
#endif // PLUGIN_SET_MAX
#endif
#endif
// TESTING #####################################
#ifdef PLUGIN_SET_TESTING
#define USES_P045 // MPU6050
#define USES_P047 // I2C_soil_misture
#define USES_P048 // Motoshield_v2
+44 -2
View File
@@ -126,9 +126,23 @@ void addFormNumericBox(LabelType::Enum label, int value, int min, int max
);
}
void addFormNumericBox(const __FlashStringHelper * label, const __FlashStringHelper * id, int value, int min, int max)
void addFormNumericBox(const __FlashStringHelper * label,
const __FlashStringHelper * id,
int value,
int min,
int max
#ifdef ENABLE_TOOLTIPS
,
const String& tooltip
#endif // ifdef ENABLE_TOOLTIPS
)
{
addFormNumericBox(String(label), String(id), value, min, max);
addFormNumericBox(String(label), String(id), value, min, max
#ifdef ENABLE_TOOLTIPS
, tooltip
#endif // ifdef ENABLE_TOOLTIPS
);
}
void addFormNumericBox(const String& label, const String& id, int value, int min, int max
@@ -178,6 +192,29 @@ void addFormFloatNumberBox(const String& label,
);
}
void addFormFloatNumberBox(const __FlashStringHelper * label,
const __FlashStringHelper * id,
float value,
float min,
float max,
uint8_t nrDecimals,
float stepsize
#ifdef ENABLE_TOOLTIPS
,
const String& tooltip
#endif // ifdef ENABLE_TOOLTIPS
)
{
addRowLabel_tr_id(label, id);
addFloatNumberBox(id, value, min, max, nrDecimals, stepsize
#ifdef ENABLE_TOOLTIPS
, tooltip
#endif // ifdef ENABLE_TOOLTIPS
);
}
// ********************************************************************************
// Add a task selector form
// ********************************************************************************
@@ -401,6 +438,11 @@ void addFormSelector(const __FlashStringHelper * label, const __FlashStringHelpe
addFormSelector(String(label), String(id), optionCount, options, indices, nullptr, selectedIndex, reloadonchange);
}
void addFormSelector(const __FlashStringHelper * label, const String& id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex, bool reloadonchange)
{
addFormSelector(String(label), id, optionCount, options, indices, nullptr, selectedIndex, reloadonchange);
}
void addFormSelector(const String& label, const String& id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex)
{
addFormSelector(label, id, optionCount, options, indices, nullptr, selectedIndex, false);
+26 -1
View File
@@ -74,6 +74,17 @@ void addFormNumericBox(LabelType::Enum label,
#endif // ifdef ENABLE_TOOLTIPS
);
void addFormNumericBox(const __FlashStringHelper * label,
const __FlashStringHelper * id,
int value,
int min = INT_MIN,
int max = INT_MAX
#ifdef ENABLE_TOOLTIPS
,
const String& tooltip = EMPTY_STRING
#endif // ifdef ENABLE_TOOLTIPS
);
void addFormNumericBox(const String& label,
const String& id,
int value,
@@ -85,6 +96,7 @@ void addFormNumericBox(const String& label,
#endif // ifdef ENABLE_TOOLTIPS
);
void addFormFloatNumberBox(LabelType::Enum label,
float value,
float min,
@@ -109,7 +121,19 @@ void addFormFloatNumberBox(const String& label,
const String& tooltip = EMPTY_STRING
#endif // ifdef ENABLE_TOOLTIPS
);
void addFormNumericBox(const __FlashStringHelper * label, const __FlashStringHelper * id, int value, int min = INT_MIN, int max = INT_MAX);
void addFormFloatNumberBox(const __FlashStringHelper * label,
const __FlashStringHelper * id,
float value,
float min,
float max,
uint8_t nrDecimals = 6,
float stepsize = 0.0f
#ifdef ENABLE_TOOLTIPS
,
const String& tooltip = EMPTY_STRING
#endif // ifdef ENABLE_TOOLTIPS
);
// ********************************************************************************
@@ -245,6 +269,7 @@ void addFormSelector(const String& label,
);
void addFormSelector(const __FlashStringHelper * label, const __FlashStringHelper * id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex, bool reloadonchange = false);
void addFormSelector(const __FlashStringHelper * label, const String& id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex, bool reloadonchange = false);
void addFormSelector(const String& label, const String& id, int optionCount, const __FlashStringHelper * options[], const int indices[], int selectedIndex);
void addFormSelector(const __FlashStringHelper * label, const __FlashStringHelper * id, int optionCount, const String options[], const int indices[], int selectedIndex);
+12
View File
@@ -565,12 +565,24 @@ void json_close(bool arr) {
lastLevel = level;
}
void json_number(const __FlashStringHelper * name, const String& value)
{
json_prop(name, value);
}
void json_number(const String& name, const String& value) {
json_prop(name, value);
}
void json_prop(const __FlashStringHelper * name, const String& value)
{
json_quote_name(name);
json_quote_val(value);
lastLevel = level;
}
void json_prop(const String& name, const String& value) {
json_quote_name(name);
json_quote_val(value);
+6
View File
@@ -87,9 +87,15 @@ void json_close();
void json_close(bool arr);
void json_number(const __FlashStringHelper * name,
const String& value);
void json_number(const String& name,
const String& value);
void json_prop(const __FlashStringHelper * name,
const String& value);
void json_prop(const String& name,
const String& value);