Merge branch 'mega' into feature/build_core_3_0_0

This commit is contained in:
TD-er
2021-10-22 12:03:28 +02:00
committed by GitHub
101 changed files with 322 additions and 274 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ jobs:
key: ${{ runner.os }}-esp8266-${{ hashFiles('platformio*.ini') }}
- name: Dependencies
run: |
sudo apt install binutils
sudo apt install binutils build-essential libffi-dev python-dev libgit2-dev
pip install -r requirements.txt
platformio update
- name: Build and archive
+1 -1
View File
@@ -53,7 +53,7 @@ jobs:
key: ${{ runner.os }}-esp8266-${{ hashFiles('platformio*.ini') }}
- name: Dependencies
run: |
sudo apt install binutils
sudo apt install binutils build-essential libffi-dev python-dev libgit2-dev
pip install -r requirements.txt
platformio update
- name: Build and archive
+25 -4
View File
@@ -1,11 +1,32 @@
recommonmark==0.6.0
Sphinx==4.0.2
Jinja2==3.0.2
MarkupSafe==2.0.1
Pygments==2.10.0
Sphinx==4.2.0
alabaster==0.7.12
babel==2.9.1
certifi==2021.10.8
charset-normalizer==2.0.7
colorama==0.4.4
commonmark==0.9.1
docutils==0.17.1
idna==3.3
imagesize==1.2.0
livereload==2.6.3
packaging==21.0
pyparsing==2.4.7
pytz==2021.3
recommonmark==0.7.1
requests==2.26.0
six==1.16.0
snowballstemmer==2.1.0
sphinx-autobuild==2021.3.14
sphinx-bootstrap-theme==0.7.1
sphinx-bootstrap-theme==0.8.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-websupport==1.2.4
sphinxcontrib-websupport==1.2.4
tornado==6.1
urllib3==1.26.7
+1 -1
View File
@@ -18,7 +18,7 @@
const uint16_t kHeader = 2; // Usual nr. of header entries.
const uint16_t kFooter = 2; // Usual nr. of footer (stop bits) entries.
const uint16_t kStartOffset = 1; // Usual rawbuf entry to start from.
#define MS_TO_USEC(x) (x * 1000U) // Convert milli-Seconds to micro-Seconds.
#define MS_TO_USEC(x) ((x) * 1000U) // Convert milli-Seconds to micro-Seconds.
// Marks tend to be 100us too long, and spaces 100us too short
// when received due to sensor lag.
const uint16_t kMarkExcess = 50;
+4 -4
View File
@@ -99,10 +99,10 @@ namespace irutils {
bool getBit(const uint64_t data, const uint8_t position,
const uint8_t size = 64);
bool getBit(const uint8_t data, const uint8_t position);
#define GETBIT8(a, b) (a & ((uint8_t)1 << b))
#define GETBIT16(a, b) (a & ((uint16_t)1 << b))
#define GETBIT32(a, b) (a & ((uint32_t)1 << b))
#define GETBIT64(a, b) (a & ((uint64_t)1 << b))
#define GETBIT8(a, b) ((a) & ((uint8_t)1 << (b)))
#define GETBIT16(a, b) ((a) & ((uint16_t)1 << (b)))
#define GETBIT32(a, b) ((a) & ((uint32_t)1 << (b)))
#define GETBIT64(a, b) ((a) & ((uint64_t)1 << (b)))
#define GETBITS8(data, offset, size) \
(((data) & (((uint8_t)UINT8_MAX >> (8 - (size))) << (offset))) >> (offset))
#define GETBITS16(data, offset, size) \
+1 -1
View File
@@ -89,7 +89,7 @@ monitor_speed = 115200
targets =
extra_scripts = pre:tools/pio/pre_default_check.py
${extra_scripts_esp8266.extra_scripts}
src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<*/Commands/> -<*/ControllerQueue/> -<*/PluginStructs/> -<*/WebServer/>
src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<*/Commands/> -<*/ControllerQueue/> -<*/Globals/> -<*/Helpers/> -<*/PluginStructs/> -<*/WebServer/>
+1 -1
View File
@@ -10,7 +10,7 @@ lib_ignore = ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266H
[esp32_common]
extends = common, core_esp32_3_3_0
lib_deps = td-er/ESPeasySerial @ 2.0.7, adafruit/Adafruit ILI9341 @ ^1.5.6, Adafruit GFX Library, LOLIN_EPD, Adafruit BusIO, VL53L0X @ 1.3.0, SparkFun VL53L1X 4m Laser Distance Sensor @ 1.2.9, td-er/SparkFun MAX1704x Fuel Gauge Arduino Library @ ^1.0.1
lib_deps = td-er/ESPeasySerial @ 2.0.7, adafruit/Adafruit ILI9341 @ ^1.5.6, Adafruit GFX Library, LOLIN_EPD, Adafruit BusIO, VL53L0X @ 1.3.0, SparkFun VL53L1X 4m Laser Distance Sensor @ 1.2.9, td-er/SparkFun MAX1704x Fuel Gauge Arduino Library @ ^1.0.1, ArduinoOTA, ESP32HTTPUpdateServer
lib_ignore = ${esp32_always.lib_ignore}, ESP32_ping, IRremoteESP8266, HeatpumpIR
board_build.f_flash = 80000000L
board_build.flash_mode = dout
+1 -1
View File
@@ -48,7 +48,7 @@ extends = common
board_build.f_cpu = 80000000L
build_flags = ${debug_flags.build_flags} ${mqtt_flags.build_flags} -DHTTPCLIENT_1_1_COMPATIBLE=0
build_unflags = -DDEBUG_ESP_PORT
lib_deps = td-er/ESPeasySerial @ 2.0.7, adafruit/Adafruit ILI9341 @ ^1.5.6, Adafruit GFX Library, LOLIN_EPD, adafruit/Adafruit BusIO @ ~1.9.0, bblanchon/ArduinoJson @ ^6.17.2, VL53L0X @ 1.3.0, SparkFun VL53L1X 4m Laser Distance Sensor @ 1.2.9, td-er/RABurton ESP8266 Mutex @ ^1.0.2, td-er/SparkFun MAX1704x Fuel Gauge Arduino Library @ ^1.0.1
lib_deps = td-er/ESPeasySerial @ 2.0.7, adafruit/Adafruit ILI9341 @ ^1.5.6, Adafruit GFX Library, LOLIN_EPD, adafruit/Adafruit BusIO @ ~1.9.0, bblanchon/ArduinoJson @ ^6.17.2, VL53L0X @ 1.3.0, SparkFun VL53L1X 4m Laser Distance Sensor @ 1.2.9, td-er/RABurton ESP8266 Mutex @ ^1.0.2, td-er/SparkFun MAX1704x Fuel Gauge Arduino Library @ ^1.0.1, ESP8266HTTPUpdateServer
lib_ignore = ${esp82xx_defaults.lib_ignore}, IRremoteESP8266, HeatpumpIR, LittleFS(esp8266), ServoESP32, TinyWireM
board = esp12e
monitor_filters = esp8266_exception_decoder
+16
View File
@@ -55,6 +55,22 @@ board = esp32dev
extra_scripts = ${esp32_common.extra_scripts}
pre:tools/pio/pre_custom_esp32.py
[env:spec_debug_max_ESP32_16M8M]
extends = esp32_common, debug_pio
lib_ignore = ${esp32_always.lib_ignore}, ESP32_ping
lib_deps = ${esp32_common.lib_deps}, VL53L0X
board_upload.maximum_size = 4194304
build_flags = ${esp32_common.build_flags}
${debug_pio.build_flags}
-DFEATURE_ARDUINO_OTA
-DPLUGIN_BUILD_MAX_ESP32
-DPLUGIN_BUILD_IR_EXTENDED
; TODO: To enable PS-RAM Support needs more build flags than these 2, for now define ESP32_ENABLE_PSRAM is used to en/disable detecting PS-Ram size on Info page
; -DBOARD_HAS_PSRAM // both flags already enabled for Lolin D32 Pro board by PlatformIO
; -mfix-esp32-psram-cache-issue
board = lolin_d32_pro
+29 -29
View File
@@ -1,39 +1,39 @@
alabaster==0.7.12
alabaster==0.7.12
argh==0.26.2
Babel==2.9.1
bottle==0.12.19
cached-property==1.5.2
certifi==2021.5.30
cffi==1.14.5
cached-property==1.5.2
certifi==2021.10.8
cffi==1.15.0
chardet==4.0.0
click==7.1.2
colorama==0.4.3
commonmark==0.9.1
docutils==0.16
idna==2.10
click==8.0.3
colorama==0.4.4
commonmark==0.9.1
docutils==0.17.1
idna==3.3
imagesize==1.2.0
Jinja2==2.11.3
livereload==2.6.2
MarkupSafe==1.1.1
marshmallow==3.7.1
packaging==20.4
Jinja2==3.0.2
livereload==2.6.3
MarkupSafe==2.0.1
marshmallow==3.14.0
packaging==21.0
pathtools==0.1.2
platformio>=5.0.1
port-for==0.3.1
platformio>=5.2.2
port-for==0.6.1
pycparser==2.20
pyelftools==0.27
pygit2==1.6.0
Pygments==2.7.4
pygit2==1.7.0
Pygments==2.10.0
pyparsing==2.4.7
pyserial==3.4
pytz==2020.1
PyYAML==5.4
recommonmark==0.6.0
requests==2.25.1
pyserial==3.5
pytz==2021.3
PyYAML==6.0
recommonmark==0.7.1
requests==2.26.0
semantic-version==2.8.5
six==1.15.0
snowballstemmer==2.0.0
tabulate==0.8.7
tornado==6.0.4
urllib3==1.26.5
watchdog==0.10.3
six==1.16.0
snowballstemmer==2.1.0
tabulate==0.8.9
tornado==6.1
urllib3==1.26.7
watchdog==2.1.6
+1 -1
View File
@@ -71,7 +71,7 @@ bool CPlugin_001(CPlugin::Function function, struct EventStruct *event, String&
url += event->idx;
url += F("&switchcmd=");
if (UserVar[event->BaseVarIndex] == 0) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 0.0f)) {
url += F("Off");
} else {
if (sensorType == Sensor_VType::SENSOR_TYPE_SWITCH) {
+1 -1
View File
@@ -63,7 +63,7 @@ bool CPlugin_008(CPlugin::Function function, struct EventStruct *event, String&
String pubname;
{
// Place the ControllerSettings in a scope to free the memory as soon as we got all relevant information.
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addLog(LOG_LEVEL_ERROR, F("C008 : Generic HTTP - Cannot send, out of RAM"));
+1 -1
View File
@@ -69,7 +69,7 @@ bool CPlugin_010(CPlugin::Function function, struct EventStruct *event, String&
{
String pubname;
{
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
break;
+2 -2
View File
@@ -59,7 +59,7 @@ bool CPlugin_011(CPlugin::Function function, struct EventStruct *event, String&
case CPlugin::Function::CPLUGIN_INIT:
{
{
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (AllocatedControllerSettings()) {
LoadControllerSettings(event->ControllerIndex, ControllerSettings);
@@ -114,7 +114,7 @@ bool CPlugin_011(CPlugin::Function function, struct EventStruct *event, String&
}
{
// Place in scope to delete ControllerSettings as soon as it is no longer needed
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addHtmlError(F("Out of memory, cannot load page"));
+2 -2
View File
@@ -74,7 +74,7 @@ bool CPlugin_016(CPlugin::Function function, struct EventStruct *event, String&
case CPlugin::Function::CPLUGIN_INIT:
{
{
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (AllocatedControllerSettings()) {
LoadControllerSettings(event->ControllerIndex, ControllerSettings);
@@ -124,7 +124,7 @@ bool CPlugin_016(CPlugin::Function function, struct EventStruct *event, String&
break;
}
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
LoadControllerSettings(event->ControllerIndex, ControllerSettings);
success = C016_DelayHandler->addToQueue(std::move(element));
Scheduler.scheduleNextDelayQueue(ESPEasy_Scheduler::IntervalTimer_e::TIMER_C016_DELAY_QUEUE,
+1 -1
View File
@@ -853,7 +853,7 @@ bool C018_init(struct EventStruct *event) {
}
{
// Allocate ControllerSettings object in a scope, so we can destruct it as soon as possible.
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
return false;
+5 -7
View File
@@ -159,6 +159,7 @@ boolean Plugin_003(uint8_t function, struct EventStruct *event, String& string)
switch (PCONFIG(P003_IDX_COUNTERTYPE))
{
case P003_CT_INDEX_COUNTER:
case P003_CT_INDEX_COUNTER_TOTAL:
{
P003_data->pulseHelper.setPulseCounter(UserVar[event->BaseVarIndex + P003_IDX_pulseCounter]);
break;
@@ -173,16 +174,13 @@ boolean Plugin_003(uint8_t function, struct EventStruct *event, String& string)
{
break;
}
case P003_CT_INDEX_COUNTER_TOTAL:
{
P003_data->pulseHelper.setPulseCounter(UserVar[event->BaseVarIndex + P003_IDX_pulseCounter]);
break;
}
}
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
String log; log.reserve(20);
log = F("INIT : PulsePin: "); log += Settings.TaskDevicePin1[event->TaskIndex];
String log;
log.reserve(20);
log = F("INIT : PulsePin: ");
log += Settings.TaskDevicePin1[event->TaskIndex];
addLog(LOG_LEVEL_INFO, log);
}
+2 -2
View File
@@ -249,7 +249,7 @@ boolean Plugin_013(uint8_t function, struct EventStruct *even
log += formatUserVarNoCheck(event->TaskIndex, 0);
log += (measuringUnit == UNIT_CM) ? F(" cm ") : F(" inch ");
if (value == NO_ECHO)
if (essentiallyEqual(value, NO_ECHO))
{
log += F(" Error: ");
log += Plugin_013_getErrorStatusString(event->TaskIndex);
@@ -271,7 +271,7 @@ boolean Plugin_013(uint8_t function, struct EventStruct *even
uint8_t state = 0;
float value = Plugin_013_read(event->TaskIndex);
if ((value != NO_ECHO) && (value < threshold)) {
if (!essentiallyEqual(value, NO_ECHO) && definitelyLessThan(value, threshold)) {
state = 1;
}
+3 -3
View File
@@ -54,7 +54,7 @@ IRsend *Plugin_035_irSender = nullptr;
#define from_32hex(c) ((((c) | ('A' ^ 'a')) - '0') % 39)
#define P35_Ntimings 250 //Defines the ammount of timings that can be stored. Used in RAW and RAW2 encodings
#define P35_Ntimings 250u //Defines the ammount of timings that can be stored. Used in RAW and RAW2 encodings
boolean Plugin_035(uint8_t function, struct EventStruct *event, String &command)
{
@@ -385,7 +385,7 @@ bool handleRawRaw2Encoding(const String &cmd) {
char c = IrRaw[i++];
if (c == '*')
{
if (i + 2 >= total || idx + (rep = from_32hex(IrRaw[i++])) * 2 > sizeof(buf[0]) * P35_Ntimings)
if (((i + 2) >= total) || (idx + (rep = from_32hex(IrRaw[i++])) * 2) > (sizeof(buf[0]) * P35_Ntimings))
{
delete[] buf;
buf = nullptr;
@@ -395,7 +395,7 @@ bool handleRawRaw2Encoding(const String &cmd) {
}
else
{
if ((c == '^' && i + 1 >= total) || idx >= sizeof(buf[0]) * P35_Ntimings)
if ((c == '^' && ((i + 1u) >= total)) || ((idx + 2u) >= (sizeof(buf[0]) * P35_Ntimings)))
{
delete[] buf;
buf = nullptr;
+11 -11
View File
@@ -596,7 +596,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
return success;
}
if ((UserVar[event->BaseVarIndex] == 1) && (P036_data->disableFrameChangeCnt)) {
if ((essentiallyEqual(UserVar[event->BaseVarIndex], 1.0f)) && (P036_data->disableFrameChangeCnt)) {
// display is on
// disableFrameChangeCnt==0 enables next page change after JumpToPage
P036_data->disableFrameChangeCnt--;
@@ -606,7 +606,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
if ((validGpio(CONFIG_PIN3)) && P036_data->ButtonState)
{
if (bitRead(P036_FLAGS_0, P036_FLAG_STEP_PAGES_BUTTON) && (UserVar[event->BaseVarIndex] == 1)) { // Bit 19 When display already on, switch to next page when enabled
if (bitRead(P036_FLAGS_0, P036_FLAG_STEP_PAGES_BUTTON) && (essentiallyEqual(UserVar[event->BaseVarIndex], 1.0f))) { // Bit 19 When display already on, switch to next page when enabled
if (P036_data->ScrollingPages.Scrolling == 0) { // page scrolling not running -> switch to next page is allowed
P036_data->P036_JumpToPage(event, 0xFF); // Start to display the next page, function needs 65ms!
}
@@ -643,7 +643,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
#ifdef P036_SEND_EVENTS
uint8_t currentFrame = P036_data->currentFrameToDisplay;
#endif
if ((UserVar[event->BaseVarIndex] == 1) && (P036_data->ScrollingPages.Scrolling == 0)) {
if ((essentiallyEqual(UserVar[event->BaseVarIndex], 1.0f)) && (P036_data->ScrollingPages.Scrolling == 0)) {
// Display is on.
P036_data->display_scrolling_lines(); // line scrolling
}
@@ -701,7 +701,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
}
}
if (UserVar[event->BaseVarIndex] == 1) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 1.0f)) {
// Display is on.
P036_data->HeaderContent = static_cast<eHeaderContent>(get8BitFromUL(P036_FLAGS_0, P036_FLAG_HEADER)); // Bit15-8 HeaderContent
@@ -747,7 +747,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
#ifdef P036_SEND_EVENTS
uint8_t currentFrame = P036_data->currentFrameToDisplay;
#endif
if ((UserVar[event->BaseVarIndex] == 1) && P036_data->display_scroll_timer()) { // page scrolling only when the display is on
if ((essentiallyEqual(UserVar[event->BaseVarIndex], 1.0f)) && P036_data->display_scroll_timer()) { // page scrolling only when the display is on
Scheduler.setPluginTaskTimer(P36_PageScrollTimer, event->TaskIndex, event->Par1); // calls next page scrollng tick
}
#ifdef P036_SEND_EVENTS
@@ -870,7 +870,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
#ifdef P036_SEND_EVENTS
if (sendEvents) {
P036_SendEvent(event, P036_EVENT_CONTRAST, 0);
if (UserVar[event->BaseVarIndex] == 0) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 0.0f)) {
P036_SendEvent(event, P036_EVENT_DISPLAY, 1);
}
}
@@ -884,7 +884,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
#ifdef P036_SEND_EVENTS
if (sendEvents) {
P036_SendEvent(event, P036_EVENT_CONTRAST, 1);
if (UserVar[event->BaseVarIndex] == 0) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 0.0f)) {
P036_SendEvent(event, P036_EVENT_DISPLAY, 1);
}
}
@@ -898,7 +898,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
#ifdef P036_SEND_EVENTS
if (sendEvents) {
P036_SendEvent(event, P036_EVENT_CONTRAST, 2);
if (UserVar[event->BaseVarIndex] == 0) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 0.0f)) {
P036_SendEvent(event, P036_EVENT_DISPLAY, 1);
}
}
@@ -910,7 +910,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
{
success = true;
if (UserVar[event->BaseVarIndex] == 0) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 0.0f)) {
// display was OFF, turn it ON
P036_data->display->displayOn();
UserVar[event->BaseVarIndex] = 1; // Save the fact that the display is now ON
@@ -965,7 +965,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
#ifdef P036_SEND_EVENTS
uint8_t currentFrame = P036_data->currentFrameToDisplay;
#endif
if ((UserVar[event->BaseVarIndex] == 0) && !bitRead(P036_FLAGS_0, P036_FLAG_NODISPLAY_ONRECEIVE)) { // Bit 18 NoDisplayOnReceivedText
if ((essentiallyEqual(UserVar[event->BaseVarIndex], 0.0f)) && !bitRead(P036_FLAGS_0, P036_FLAG_NODISPLAY_ONRECEIVE)) { // Bit 18 NoDisplayOnReceivedText
// display was OFF, turn it ON
P036_data->display->displayOn();
UserVar[event->BaseVarIndex] = 1; // Save the fact that the display is now ON
@@ -979,7 +979,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
#endif
}
if (UserVar[event->BaseVarIndex] == 1) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 1.0f)) {
uint8_t nextFrame = ceil((static_cast<float>(LineNo)) / P036_data->ScrollingPages.linesPerFrame) - 1; // next frame shows the new content,
// 0-based
P036_data->P036_JumpToPage(event, nextFrame); // Start to display the selected page,
+9 -3
View File
@@ -292,7 +292,9 @@ struct P073_data_struct : public PluginTaskData_base {
if ((i > 0) && (textToShow.charAt(i - 1) == '.')) { // Handle consecutive periods
p++;
showperiods[p - 1] = true; // The period displays as a dot on the previous digit!
if ((p - 1) < 8) {
showperiods[p - 1] = true; // The period displays as a dot on the previous digit!
}
}
} else if (p < 8) {
# ifdef P073_7DBIN_COMMAND
@@ -2045,8 +2047,12 @@ void max7219_ShowTemp(struct EventStruct *event, uint8_t din_pin,
int alignRight = P073_data->rightAlignTempMAX7219 ? 0 : 1;
for (int i = alignRight; i < 8; i++) {
max7219_SetDigit(event, din_pin, clk_pin, cs_pin, i,
P073_data->showbuffer[(7 + alignRight) - i], P073_data->showperiods[(7 + alignRight) - i]);
const int bufIndex = (7 + alignRight) - i;
if (bufIndex < 8) {
max7219_SetDigit(event, din_pin, clk_pin, cs_pin, i,
P073_data->showbuffer[bufIndex],
P073_data->showperiods[bufIndex]);
}
}
}
+1 -1
View File
@@ -73,7 +73,7 @@ bool Blynk_get(const String& command, controllerIndex_t controllerIndex, float *
{
// Place ControllerSettings in its own scope, as it is quite big.
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addLog(LOG_LEVEL_ERROR, F("Blynk : Cannot run GET, out of RAM"));
return false;
+2 -2
View File
@@ -40,7 +40,7 @@ const __FlashStringHelper * Command_MQTT_Publish(struct EventStruct *event, cons
bool mqtt_retainFlag;
{
// Place the ControllerSettings in a scope to free the memory as soon as we got all relevant information.
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addLog(LOG_LEVEL_ERROR, F("MQTT : Cannot publish, out of RAM"));
return F("MQTT : Cannot publish, out of RAM");
@@ -93,7 +93,7 @@ const __FlashStringHelper * Command_MQTT_Subscribe(struct EventStruct *event, co
bool mqtt_retainFlag;
{
// Place the ControllerSettings in a scope to free the memory as soon as we got all relevant information.
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addLog(LOG_LEVEL_ERROR, F("MQTT : Cannot subscribe, out of RAM"));
return F("MQTT : Cannot subscribe, out of RAM");
@@ -26,6 +26,20 @@ C015_queue_element::C015_queue_element(const struct EventStruct *event, uint8_t
valuesSent(0),
valueCount(value_count) {}
C015_queue_element& C015_queue_element::operator=(C015_queue_element&& other) {
idx = other.idx;
_timestamp = other._timestamp;
TaskIndex = other.TaskIndex;
controller_idx = other.controller_idx;
valuesSent = other.valuesSent;
valueCount = other.valueCount;
for (uint8_t i = 0; i < VARS_PER_TASK; ++i) {
txt[i] = std::move(other.txt[i]);
vPin[i] = other.vPin[i];
}
return *this;
}
bool C015_queue_element::checkDone(bool succesfull) const {
if (succesfull) { ++valuesSent; }
return valuesSent >= valueCount || valuesSent >= VARS_PER_TASK;
@@ -31,6 +31,8 @@ public:
C015_queue_element(const struct EventStruct *event, uint8_t value_count);
C015_queue_element& operator=(C015_queue_element&& other);
bool checkDone(bool succesfull) const;
size_t getSize() const;
@@ -3,6 +3,7 @@
#include "../DataStructs/ESPEasy_EventStruct.h"
#include "../Globals/Plugins.h"
#include "../Globals/RuntimeData.h"
#include "../Helpers/ESPEasy_math.h"
#ifdef USES_C016
@@ -62,7 +63,7 @@ bool C016_queue_element::isDuplicate(const C016_queue_element& other) const {
}
for (uint8_t i = 0; i < VARS_PER_TASK; ++i) {
if (other.values[i] != values[i]) {
if (!essentiallyEqual(other.values[i] , values[i])) {
return false;
}
}
@@ -311,7 +311,7 @@ struct ControllerDelayHandlerStruct {
if (C##NNN####M##_DelayHandler == nullptr) return; \
C##NNN####M##_queue_element *element(C##NNN####M##_DelayHandler->getNext()); \
if (element == nullptr) return; \
MakeControllerSettings(ControllerSettings); \
MakeControllerSettings(ControllerSettings); \
bool ready = true; \
if (!AllocatedControllerSettings()) { \
ready = false; \
@@ -9,7 +9,7 @@
ControllerDelayHandlerStruct<MQTT_queue_element> *MQTTDelayHandler = nullptr;
bool init_mqtt_delay_queue(controllerIndex_t ControllerIndex, String& pubname, bool& retainFlag) {
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
return false;
}
+1 -1
View File
@@ -1,4 +1,4 @@
#include "C013_p2p_dataStructs.h"
#include "../DataStructs/C013_p2p_dataStructs.h"
#include "../Globals/Plugins.h"
#include "../../ESPEasy_common.h"
@@ -148,7 +148,7 @@ struct ControllerSettingsStruct
boolean UseDNS;
uint8_t IP[4];
uint8_t IP[4];
unsigned int Port;
char HostName[65];
char Publish[129];
@@ -199,6 +199,6 @@ ControllerSettingsStruct& T = *ControllerSettingsStruct_ptr;
#endif
// Check to see if MakeControllerSettings was successful
#define AllocatedControllerSettings() (ControllerSettingsStruct_ptr.get() != nullptr)
#define AllocatedControllerSettings() (ControllerSettingsStruct_ptr ? true : false)
#endif // DATASTRUCTS_CONTROLLERSETTINGSSTRUCT_H
+1 -1
View File
@@ -1,4 +1,4 @@
#include "DeviceStruct.h"
#include "../DataStructs/DeviceStruct.h"
DeviceStruct::DeviceStruct() :
Number(0), Type(0), VType(Sensor_VType::SENSOR_TYPE_NONE), Ports(0), ValueCount(0),
+1 -1
View File
@@ -9,7 +9,7 @@
//#include "../Globals/CPlugins.h"
#include "../Globals/NPlugins.h"
//#include "../Globals/Plugins.h"
#include "DeviceStruct.h"
#include "../DataStructs/DeviceStruct.h"
/*********************************************************************************************\
@@ -1,4 +1,4 @@
#include "ESPEasyControllerCache.h"
#include "../DataStructs/ESPEasyControllerCache.h"
ControllerCache_struct::ControllerCache_struct() {}
+1 -1
View File
@@ -1,4 +1,4 @@
#include "EventQueue.h"
#include "../DataStructs/EventQueue.h"
#include "../../ESPEasy_common.h"
@@ -1,6 +1,4 @@
#include "ExtendedControllerCredentialsStruct.h"
#include "../DataStructs/ExtendedControllerCredentialsStruct.h"
#include "../Helpers/ESPEasy_Storage.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "NodeStruct.h"
#include "../DataStructs/NodeStruct.h"
const __FlashStringHelper * getNodeTypeDisplayString(uint8_t nodeType) {
switch (nodeType)
@@ -20,8 +20,8 @@ struct NotificationSettingsStruct
char Receiver[65];
char Subject[129];
char Body[513];
uint8_t Pin1;
uint8_t Pin2;
uint8_t Pin1;
uint8_t Pin2;
char User[49];
char Pass[33];
//its safe to extend this struct, up to 4096 bytes, default values in config are 0
+1 -1
View File
@@ -1,4 +1,4 @@
#include "PortStatusStruct.h"
#include "../DataStructs/PortStatusStruct.h"
#include "../DataStructs/PinMode.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "ProtocolStruct.h"
#include "../DataStructs/ProtocolStruct.h"
ProtocolStruct::ProtocolStruct() :
defaultPort(0), Number(0), usesMQTT(false), usesAccount(false), usesPassword(false),
@@ -1,4 +1,4 @@
#include "RTC_cache_handler_struct.h"
#include "../DataStructs/RTC_cache_handler_struct.h"
#include "../../ESPEasy_common.h"
#include "../DataStructs/RTCStruct.h"
+4
View File
@@ -7,6 +7,9 @@
#include "../DataTypes/SPI_options.h"
#include "../../ESPEasy_common.h"
#ifndef DATASTRUCTS_SETTINGSSTRUCT_CPP
#define DATASTRUCTS_SETTINGSSTRUCT_CPP
template<unsigned int N_TASKS>
SettingsStruct_tmpl<N_TASKS>::SettingsStruct_tmpl() : ResetFactoryDefaultPreference(0) {
clearAll();
@@ -669,3 +672,4 @@ void SettingsStruct_tmpl<N_TASKS>::setWiFi_TX_power(float dBm) {
WiFi_TX_power = dBm * 4.0f;
}
#endif
+1 -1
View File
@@ -326,7 +326,7 @@ class SettingsStruct_tmpl
int8_t SPI_SCLK_pin = -1;
int8_t SPI_MISO_pin = -1;
int8_t SPI_MOSI_pin = -1;
int8_t alignmentFiller0; // Should be reused, just added to keep up with alignment
int8_t alignmentFiller0 = 0; // Should be reused, just added to keep up with alignment
};
/*
+1 -1
View File
@@ -1,4 +1,4 @@
#include "SystemTimerStruct.h"
#include "../DataStructs/SystemTimerStruct.h"
#include "../ESPEasyCore/ESPEasy_Log.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "TimeChangeRule.h"
#include "../DataStructs/TimeChangeRule.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "WiFiEventData.h"
#include "../DataStructs/WiFiEventData.h"
#include "../ESPEasyCore/ESPEasy_Log.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "timer_id_couple.h"
#include "../DataStructs/timer_id_couple.h"
#include "../Helpers/ESPEasy_time_calc.h"
+3 -3
View File
@@ -172,7 +172,7 @@ void MQTTDisconnect()
bool MQTTConnect(controllerIndex_t controller_idx)
{
++mqtt_reconnect_count;
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addLog(LOG_LEVEL_ERROR, F("MQTT : Cannot connect, out of RAM"));
@@ -319,7 +319,7 @@ bool MQTTCheck(controllerIndex_t controller_idx)
String LWTTopic, LWTMessageConnect;
bool willRetain = false;
{
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addLog(LOG_LEVEL_ERROR, F("MQTT : Cannot check, out of RAM"));
@@ -538,7 +538,7 @@ void MQTTStatus(struct EventStruct *event, const String& status)
bool mqtt_retainFlag;
{
// Place the ControllerSettings in a scope to free the memory as soon as we got all relevant information.
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addLog(LOG_LEVEL_ERROR, F("MQTT : Cannot send status, out of RAM"));
@@ -96,13 +96,11 @@ void handle_unprocessedNetworkEvents()
if (active_network_medium == NetworkMedium_t::WIFI) {
if ((!WiFiEventData.WiFiServicesInitialized()) || WiFiEventData.unprocessedWifiEvents()) {
if (WiFi.status() == WL_DISCONNECTED && WiFiEventData.wifiConnectInProgress) {
if (WiFiEventData.wifiConnectInProgress) {
if (WiFiEventData.last_wifi_connect_attempt_moment.isSet() && WiFiEventData.last_wifi_connect_attempt_moment.millisPassedSince() > 20000) {
WiFiEventData.last_wifi_connect_attempt_moment.clear();
}
if (!WiFiEventData.last_wifi_connect_attempt_moment.isSet()) {
WiFiEventData.wifiConnectInProgress = false;
}
if (WiFiEventData.last_wifi_connect_attempt_moment.isSet() && WiFiEventData.last_wifi_connect_attempt_moment.millisPassedSince() > 20000) {
WiFiEventData.last_wifi_connect_attempt_moment.clear();
}
if (!WiFiEventData.last_wifi_connect_attempt_moment.isSet()) {
WiFiEventData.wifiConnectInProgress = false;
}
delay(10);
}
@@ -246,6 +244,7 @@ void processDisconnect() {
}
// FIXME TD-er: Ignoring the actual setting for now as it seems to be more reliable to always restart WiFi.
bool mustRestartWiFi = true; //Settings.WiFiRestart_connection_lost();
if (WiFiEventData.lastConnectedDuration_us > 0 && (WiFiEventData.lastConnectedDuration_us / 1000) < 5000) {
mustRestartWiFi = true;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "C016_ControllerCache.h"
#include "../Globals/C016_ControllerCache.h"
#ifdef USES_C016
+1 -1
View File
@@ -1,3 +1,3 @@
#include "MainLoopCommand.h"
#include "../Globals/MainLoopCommand.h"
uint8_t cmd_within_mainloop = 0;
+2 -2
View File
@@ -1,7 +1,7 @@
#include "NPlugins.h"
#include "../Globals/NPlugins.h"
#include "../DataStructs/NotificationStruct.h"
#include "Settings.h"
#include "../Globals/Settings.h"
nprotocolIndex_t INVALID_NPROTOCOL_INDEX = NPLUGIN_MAX;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Plugins.h"
#include "../Globals/Plugins.h"
#include "../CustomBuild/ESPEasyLimits.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Plugins_other.h"
#include "../Globals/Plugins_other.h"
+1 -2
View File
@@ -1,5 +1,4 @@
#include "RamTracker.h"
#include "../Globals/RamTracker.h"
#include "../ESPEasyCore/ESPEasy_Log.h"
+1 -1
View File
@@ -1,3 +1,3 @@
#include "TimeZone.h"
#include "../Globals/TimeZone.h"
ESPEasy_time_zone time_zone;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Audio.h"
#include "../Helpers/Audio.h"
#include "../Globals/RamTracker.h"
#include "../Helpers/Hardware.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "CRC_functions.h"
#include "../Helpers/CRC_functions.h"
int calc_CRC16(const String& text) {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "CompiletimeDefines.h"
#include "../Helpers/CompiletimeDefines.h"
// This file will be "patched" at compiletime by
// tools/pio/generate-compiletime-defines.py
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Convert.h"
#include "../Helpers/Convert.h"
/*********************************************************************************************\
Convert bearing in degree to bearing string
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Dallas1WireHelper.h"
#include "../Helpers/Dallas1WireHelper.h"
#include "../../_Plugin_Helper.h"
#include "../ESPEasyCore/ESPEasy_Log.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "ESPEasyStatistics.h"
#include "../Helpers/ESPEasyStatistics.h"
#ifdef USES_TIMING_STATS
+1 -1
View File
@@ -234,7 +234,7 @@ void ResetFactory()
#if DEFAULT_CONTROLLER
{
// Place in a scope to have its memory freed ASAP
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (AllocatedControllerSettings()) {
safe_strncpy(ControllerSettings.Subscribe, F(DEFAULT_SUB), sizeof(ControllerSettings.Subscribe));
+2 -2
View File
@@ -27,6 +27,7 @@
#include "../Globals/Settings.h"
#include "../Helpers/ESPEasyRTC.h"
#include "../Helpers/ESPEasy_checks.h"
#include "../Helpers/ESPEasy_FactoryDefault.h"
#include "../Helpers/ESPEasy_time_calc.h"
#include "../Helpers/FS_Helper.h"
@@ -37,7 +38,6 @@
#include "../Helpers/PeriodicalActions.h"
#include "../Helpers/StringConverter.h"
#include "ESPEasy_checks.h"
#ifdef ESP32
#include <MD5Builder.h>
@@ -223,7 +223,7 @@ String BuildFixes()
#ifdef USES_MQTT
controllerIndex_t controller_idx = firstEnabledMQTT_ControllerIndex();
if (validControllerIndex(controller_idx)) {
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (AllocatedControllerSettings()) {
LoadControllerSettings(controller_idx, ControllerSettings);
+1 -1
View File
@@ -209,7 +209,7 @@ bool SettingsCheck(String& error) {
return error.isEmpty();
}
#include "Numerical.h"
#include "../Helpers/Numerical.h"
String checkTaskSettings(taskIndex_t taskIndex) {
String err = LoadTaskSettings(taskIndex);
+1 -1
View File
@@ -1,4 +1,4 @@
#include "ESPEasy_math.h"
#include "../Helpers/ESPEasy_math.h"
#include <cmath>
+2 -2
View File
@@ -1,4 +1,4 @@
#include "ESPEasy_time.h"
#include "../Helpers/ESPEasy_time.h"
#include "../DataTypes/TimeSource.h"
@@ -16,7 +16,7 @@
#include "../Helpers/Networking.h"
#include "../Helpers/Numerical.h"
#include "ESPEasy_time_calc.h"
#include "../Helpers/ESPEasy_time_calc.h"
#include <time.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "ESPEasy_time_calc.h"
#include "../Helpers/ESPEasy_time_calc.h"
#include <Arduino.h>
#include <limits.h>
+2 -2
View File
@@ -1,11 +1,11 @@
#include "ESPEasy_time_zone.h"
#include "../Helpers/ESPEasy_time_zone.h"
#include "../DataStructs/TimeChangeRule.h"
#include "../ESPEasyCore/ESPEasy_Log.h"
#include "../Globals/ESPEasy_time.h"
#include "../Globals/Settings.h"
#include "ESPEasy_time_calc.h"
#include "../Helpers/ESPEasy_time_calc.h"
#include <time.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Hardware.h"
#include "../Helpers/Hardware.h"
#include "../Commands/GPIO.h"
#include "../CustomBuild/ESPEasyLimits.h"
+3 -3
View File
@@ -1,9 +1,9 @@
#include "Modbus_RTU.h"
#include "../Helpers/Modbus_RTU.h"
#include "../ESPEasyCore/ESPEasy_Log.h"
#include "ESPEasy_time_calc.h"
#include "StringConverter.h"
#include "../Helpers/ESPEasy_time_calc.h"
#include "../Helpers/StringConverter.h"
ModbusRTU_struct::ModbusRTU_struct() : easySerial(nullptr) {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "PortStatus.h"
#include "../Helpers/PortStatus.h"
#include "../DataStructs/PinMode.h"
#include "../Globals/GlobalMapPortStatus.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Rules_calculate.h"
#include "../Helpers/Rules_calculate.h"
#include <Arduino.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "StringConverter.h"
#include "../Helpers/StringConverter.h"
#include "../../_Plugin_Helper.h"
+1 -1
View File
@@ -6,7 +6,7 @@
#include "../Globals/Plugins.h"
#include "../Globals/CPlugins.h"
#include "Convert.h"
#include "../Helpers/Convert.h"
class IPAddress;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "StringGenerator_GPIO.h"
#include "../Helpers/StringGenerator_GPIO.h"
#include "../Globals/Settings.h"
#include "../Helpers/Hardware.h"
+1 -3
View File
@@ -1,5 +1,4 @@
#include "StringParser.h"
#include "../Helpers/StringParser.h"
#include "../../_Plugin_Helper.h"
@@ -19,7 +18,6 @@
#include "../Helpers/Rules_calculate.h"
#include "../Helpers/StringConverter.h"
#include "../Helpers/StringGenerator_GPIO.h"
#include "../Helpers/StringParser.h"
#include <Arduino.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "StringProvider.h"
#include "../Helpers/StringProvider.h"
#ifdef HAS_ETHERNET
# include "ETH.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "SystemVariables.h"
#include "../Helpers/SystemVariables.h"
#include "../../ESPEasy_common.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "WebServer_commandHelper.h"
#include "../Helpers/WebServer_commandHelper.h"
#include "../../ESPEasy-Globals.h"
#include "../Commands/InternalCommands.h"
+3 -3
View File
@@ -1,4 +1,4 @@
#include "_CPlugin_DomoticzHelper.h"
#include "../Helpers/_CPlugin_DomoticzHelper.h"
#ifdef USES_DOMOTICZ
@@ -265,7 +265,7 @@ String serializeDomoticzJson(struct EventStruct *event)
json += ',';
json += to_json_object_value(F("command"), F("switchlight"));
if (UserVar[event->BaseVarIndex] == 0) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 0.0f)) {
json += ',';
json += to_json_object_value(F("switchcmd"), F("Off"));
}
@@ -278,7 +278,7 @@ String serializeDomoticzJson(struct EventStruct *event)
json += ',';
json += to_json_object_value(F("command"), F("switchlight"));
if (UserVar[event->BaseVarIndex] == 0) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 0.0f)) {
json += ',';
json += to_json_object_value(F("switchcmd"), F("Off"));
}
+1 -1
View File
@@ -1,4 +1,4 @@
#include "_CPlugin_Helper_webform.h"
#include "../Helpers/_CPlugin_Helper_webform.h"
#include "../DataStructs/ESPEasy_EventStruct.h"
#include "../DataTypes/ESPEasy_plugin_functions.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "_CPlugin_LoRa_TTN_helper.h"
#include "../Helpers/_CPlugin_LoRa_TTN_helper.h"
#include "../DataStructs/ESPEasy_EventStruct.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "_Plugin_Helper_serial.h"
#include "../Helpers/_Plugin_Helper_serial.h"
#include "../../_Plugin_Helper.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "_Plugin_SensorTypeHelper.h"
#include "../Helpers/_Plugin_SensorTypeHelper.h"
#include "../../_Plugin_Helper.h"
#include "../DataStructs/DeviceStruct.h"
+2 -2
View File
@@ -1,8 +1,8 @@
#include "msecTimerHandlerStruct.h"
#include "../Helpers/msecTimerHandlerStruct.h"
#include <Arduino.h>
#include "ESPEasy_time_calc.h"
#include "../Helpers/ESPEasy_time_calc.h"
#define MAX_SCHEDULER_WAIT_TIME 5 // Max delay used in the scheduler for passing idle time.
+5 -5
View File
@@ -90,11 +90,11 @@ private:
# ifdef P16_SETTINGS_V1
std::vector<tCommandLines>CommandLinesV1; // holds the CustomTaskSettings V1, allocated when needed for conversion
# endif // ifdef P16_SETTINGS_V1
uint64_t iLastCmd; // last command send
uint32_t iLastCmdTime; // time while last command was send
decode_type_t iLastDecodeType; // last decode_type sent
uint16_t iCmdInhibitTime; // inhibit time for sending the same command again
uint16_t iLastCodeFlags; // last flags sent
uint64_t iLastCmd = 0; // last command send
uint32_t iLastCmdTime = 0; // time while last command was send
decode_type_t iLastDecodeType = decode_type_t::UNKNOWN; // last decode_type sent
uint16_t iCmdInhibitTime = 0; // inhibit time for sending the same command again
uint16_t iLastCodeFlags = 0; // last flags sent
};
#endif // ifdef USES_P016
+1 -1
View File
@@ -333,7 +333,7 @@ void P023_data_struct::setXY(unsigned char row, unsigned char col)
sendCommand(0xb0 + row); // set page address
sendCommand(0x00 + ((8 * col + col_offset) & 0x0f)); // set low col address
sendCommand(0x10 + ((8 * col >> 4) & 0x0f)); // set high col address
sendCommand(0x10 + (((8 * col) >> 4) & 0x0f)); // set high col address
}
// Prints a string regardless the cursor position.
+1 -1
View File
@@ -355,7 +355,7 @@ float P028_data_struct::readPressure()
var2 = var2 + (((int64_t)calib.dig_P4) << 35);
var1 = ((var1 * var1 * (int64_t)calib.dig_P3) >> 8) +
((var1 * (int64_t)calib.dig_P2) << 12);
var1 = (((((int64_t)1) << 47) + var1)) * ((int64_t)calib.dig_P1) >> 33;
var1 = ((((((int64_t)1) << 47) + var1)) * ((int64_t)calib.dig_P1)) >> 33;
if (var1 == 0) {
return 0; // avoid exception caused by division by zero
+1 -1
View File
@@ -1035,7 +1035,7 @@ void P036_data_struct::P036_DisplayPage(struct EventStruct *event)
int NFrames; // the number of frames
if (UserVar[event->BaseVarIndex] == 1) {
if (essentiallyEqual(UserVar[event->BaseVarIndex], 1.0f)) {
// Display is on.
ScrollingPages.Scrolling = 1; // page scrolling running -> no
// line scrolling allowed
+1 -1
View File
@@ -237,7 +237,7 @@ bool P053_data_struct::processData(struct EventStruct *event) {
SerialRead16(framelength, &checksum);
if (framelength != (packetSize() - 4)) {
if ((framelength + 4) != packetSize()) {
if (loglevelActiveFor(LOG_LEVEL_ERROR)) {
String log;
log.reserve(34);
+2 -2
View File
@@ -122,8 +122,8 @@ private:
uint8_t capture_index[P87_MAX_CAPTURE_INDEX] = { 0 };
bool capture_index_used[P87_MAX_CAPTURE_INDEX];
bool capture_index_must_not_match[P87_MAX_CAPTURE_INDEX];
bool capture_index_used[P87_MAX_CAPTURE_INDEX] = { 0 };
bool capture_index_must_not_match[P87_MAX_CAPTURE_INDEX] = { 0 };
bool regex_empty = false;
};
+9 -9
View File
@@ -746,7 +746,7 @@ boolean P092_data_struct::P092_GetData(int OptionIdx, int CurIdx, sP092_ReadData
}
boolean P092_data_struct::P092_fetch_sensor(int number, sP092_ReadData *ReadData) {
float value;
float value = 0.0f;
ReadData->mode = -1;
number = ReadData->Idx + (number - 1) * 2;
@@ -766,7 +766,7 @@ boolean P092_data_struct::P092_fetch_sensor(int number, sP092_ReadData *ReadData
value = false;
break;
case DLbus_Sensor_TEMP:
value = sensorvalue * 0.1;
value = static_cast<float>(sensorvalue) * 0.1f;
break;
case DLbus_Sensor_RAYS:
value = sensorvalue;
@@ -776,7 +776,7 @@ boolean P092_data_struct::P092_fetch_sensor(int number, sP092_ReadData *ReadData
break;
case DLbus_Sensor_ROOM:
ReadData->mode = (sensorvalue & 0x600) >> 9;
value = (sensorvalue & 0x1ff) * 0.1;
value = static_cast<float>(sensorvalue & 0x1ff) * 0.1f;
break;
default:
return false;
@@ -791,7 +791,7 @@ boolean P092_data_struct::P092_fetch_sensor(int number, sP092_ReadData *ReadData
value = true;
break;
case DLbus_Sensor_TEMP:
value = (sensorvalue - 0x10000) * 0.1;
value = static_cast<float>(sensorvalue - 0x10000) * 0.1f;
break;
case DLbus_Sensor_RAYS:
value = sensorvalue - 0x10000;
@@ -801,7 +801,7 @@ boolean P092_data_struct::P092_fetch_sensor(int number, sP092_ReadData *ReadData
break;
case DLbus_Sensor_ROOM:
ReadData->mode = (sensorvalue & 0x600) >> 9;
value = ((sensorvalue & 0x1ff) - 0x10000) * 0.1;
value = static_cast<float>((sensorvalue & 0x1ff) - 0x10000) * 0.1f;
break;
default:
return false;
@@ -920,20 +920,20 @@ boolean P092_data_struct::P092_fetch_heatpower(int number, sP092_ReadData *ReadD
int low = (b1 * 10) / 0x100;
if (!(b4 & 0x80)) { // sign positive
ReadData->value = (10 * high + low) / 100;
ReadData->value = static_cast<float>(10 * high + low) / 100.0f;
}
else { // sign negative
ReadData->value = (10 * (high - 0x10000) - low) / 100;
ReadData->value = static_cast<float>(10 * (high - 0x10000) - low) / 100.0f;
}
}
else {
high = (b2 << 8) | b1;
if ((b2 & 0x80) == 0) { // sign positive
ReadData->value = high / 10;
ReadData->value = static_cast<float>(high) / 10.0f;
}
else { // sign negative
ReadData->value = (high - 0x10000) / 10;
ReadData->value = static_cast<float>(high - 0x10000) / 10.0f;
}
}
return true;
+46 -46
View File
@@ -68,7 +68,7 @@ public:
private:
volatile uint32_t ISR_TimeLastBitChange = 0; // remember time of last transition
uint8_t DLbus_ChangeBitStream[DLbus_MaxDataBits]; // received bit change stream (each bit change is extended to uint8_t, containing the
uint8_t DLbus_ChangeBitStream[DLbus_MaxDataBits] = { 0 }; // received bit change stream (each bit change is extended to uint8_t, containing the
// timing flags)
uint16_t BitNumber = 0; // bit number of the received DLbus_ChangeBitStream
static void ISR(void);
@@ -127,9 +127,9 @@ public:
bool init(int8_t pin1, int P092DeviceIndex, eP092pinmode P092pinmode);
typedef struct {
uint8_t Idx;
uint8_t mode;
float value;
uint8_t Idx = 0u;
uint8_t mode = 0u;
float value = 0.0f;
} sP092_ReadData;
void Plugin_092_SetIndices(int P092DeviceIndex);
@@ -155,57 +155,57 @@ public:
sP092_ReadData *ReadData); // heat meters(s)
uint8_t P092_Last_DLB_Pin;
// uint8_t P092_Last_DLB_Pin;
boolean P092_ReceivedOK = false;
uint32_t P092_LastReceived = 0;
struct _P092_DataStruct
{
uint8_t DataBytes;
uint8_t DeviceByte0;
uint8_t DeviceByte1;
uint8_t DeviceBytes;
uint8_t DontCareBytes;
uint8_t TimeStampBytes;
uint8_t MaxSensors;
uint8_t MaxExtSensors;
uint8_t OutputBytes;
uint8_t SpeedBytes;
uint8_t MaxAnalogOuts;
uint8_t AnalogBytes;
uint8_t VolumeBytes;
uint8_t MaxHeatMeters;
uint8_t CurrentHmBytes;
uint8_t MWhBytes;
uint8_t DataBytes = 0u;
uint8_t DeviceByte0 = 0u;
uint8_t DeviceByte1 = 0u;
uint8_t DeviceBytes = 0u;
uint8_t DontCareBytes = 0u;
uint8_t TimeStampBytes = 0u;
uint8_t MaxSensors = 0u;
uint8_t MaxExtSensors = 0u;
uint8_t OutputBytes = 0u;
uint8_t SpeedBytes = 0u;
uint8_t MaxAnalogOuts = 0u;
uint8_t AnalogBytes = 0u;
uint8_t VolumeBytes = 0u;
uint8_t MaxHeatMeters = 0u;
uint8_t CurrentHmBytes = 0u;
uint8_t MWhBytes = 0u;
uint16_t DLbus_MinPulseWidth;
uint16_t DLbus_MaxPulseWidth;
uint16_t DLbus_MinDoublePulseWidth;
uint16_t DLbus_MaxDoublePulseWidth;
uint8_t IdxSensor;
uint8_t IdxExtSensor;
uint8_t IdxOutput;
uint8_t IdxDrehzahl;
uint8_t IdxAnalog;
uint8_t IdxHmRegister;
uint8_t IdxVolume;
uint8_t IdxHeatMeter1;
uint8_t IdxkWh1;
uint8_t IdxMWh1;
uint8_t IdxHeatMeter2;
uint8_t IdxkWh2;
uint8_t IdxMWh2;
uint8_t IdxHeatMeter3;
uint8_t IdxkWh3;
uint8_t IdxMWh3;
uint8_t IdxCRC;
uint16_t DLbus_MinPulseWidth = 0u;
uint16_t DLbus_MaxPulseWidth = 0u;
uint16_t DLbus_MinDoublePulseWidth = 0u;
uint16_t DLbus_MaxDoublePulseWidth = 0u;
uint8_t IdxSensor = 0u;
uint8_t IdxExtSensor = 0u;
uint8_t IdxOutput = 0u;
uint8_t IdxDrehzahl = 0u;
uint8_t IdxAnalog = 0u;
uint8_t IdxHmRegister = 0u;
uint8_t IdxVolume = 0u;
uint8_t IdxHeatMeter1 = 0u;
uint8_t IdxkWh1 = 0u;
uint8_t IdxMWh1 = 0u;
uint8_t IdxHeatMeter2 = 0u;
uint8_t IdxkWh2 = 0u;
uint8_t IdxMWh2 = 0u;
uint8_t IdxHeatMeter3 = 0u;
uint8_t IdxkWh3 = 0u;
uint8_t IdxMWh3 = 0u;
uint8_t IdxCRC = 0u;
} P092_DataSettings;
// heat meter
typedef struct {
uint8_t IndexIsValid;
int32_t power_index;
int32_t kwh_index;
int32_t mwh_index;
uint8_t IndexIsValid = 0u;
int32_t power_index = 0;
int32_t kwh_index = 0;
int32_t mwh_index = 0;
} sDLbus_HMindex;
sDLbus_HMindex P092_CheckHmRegister(int number);
+1 -1
View File
@@ -134,7 +134,7 @@ private:
unsigned long disable_filter_window = 0;
uint32_t debug_counter = 0;
bool valueType_used[P094_FILTER_VALUE_Type_NR_ELEMENTS];
bool valueType_used[P094_FILTER_VALUE_Type_NR_ELEMENTS] = {0};
P094_Filter_Value_Type valueType_index[P094_NR_FILTERS];
P094_Filter_Comp filter_comp[P094_NR_FILTERS];
};
+2 -1
View File
@@ -505,7 +505,7 @@ void P104_data_struct::configureZones() {
void P104_data_struct::displayOneZoneText(uint8_t zone,
const P104_zone_struct& zstruct,
const String & text) {
if ((nullptr == P) || (zone < 0) || (zone > P104_MAX_ZONES)) { return; } // double check
if ((nullptr == P) || (zone >= P104_MAX_ZONES)) { return; } // double check
sZoneInitial[zone].reserve(text.length());
sZoneInitial[zone] = text; // Keep the original string for future use
sZoneBuffers[zone].reserve(text.length());
@@ -1182,6 +1182,7 @@ bool P104_data_struct::handlePluginWrite(taskIndex_t taskIndex,
}
# endif // ifdef P104_USE_BAR_GRAPH
// FIXME TD-er: success is always false here. Maybe this must be done outside the for-loop?
if (success) { // Reset the repeat timer
if (it->repeatDelay > -1) {
it->_repeatTimer = millis();
+23 -36
View File
@@ -304,43 +304,30 @@
struct P104_zone_struct {
P104_zone_struct() = delete; // Not used, so leave out explicitly
P104_zone_struct(uint8_t _zone) : zone(_zone) {
size = 0u;
text = F("\"\"");
alignment = 0u;
animationIn = 1u; // Doesn't allow 'None'
speed = 0u;
animationOut = 0u;
pause = 0u;
font = 0u;
content = 0u;
layout = 0u;
specialEffect = 0u;
offset = 0u;
brightness = -1;
repeatDelay = -1;
inverted = 0u;
}
P104_zone_struct(uint8_t _zone) : text(F("\"\"")), zone(_zone) {}
String text;
int32_t repeatDelay;
uint32_t _repeatTimer;
uint16_t speed, pause;
int32_t repeatDelay = -1;
uint32_t _repeatTimer = 0u;
uint16_t speed = 0u;
uint16_t pause = 0u;
uint8_t zone;
uint8_t size;
uint8_t alignment;
uint8_t animationIn, animationOut;
uint8_t font;
uint8_t content;
uint8_t layout;
uint8_t specialEffect;
uint8_t offset;
int8_t brightness;
int8_t inverted;
int8_t _lastChecked = -1;
uint8_t size = 0u;
uint8_t alignment = 0u;
uint8_t animationIn = 1u; // Doesn't allow 'None'
uint8_t animationOut = 0u;
uint8_t font = 0u;
uint8_t content = 0u;
uint8_t layout = 0u;
uint8_t specialEffect = 0u;
uint8_t offset = 0u;
int8_t brightness = -1;
int8_t inverted = 0;
int8_t _lastChecked = -1;
# ifdef P104_USE_BAR_GRAPH
uint16_t _lower, _upper; // lower and upper pixel numbers
uint8_t _startModule; // starting module, end module is _startModule + size - 1
uint16_t _lower = 0u;
uint16_t _upper = 0u; // lower and upper pixel numbers
uint8_t _startModule = 0u; // starting module, end module is _startModule + size - 1
# endif // ifdef P104_USE_BAR_GRAPH
};
@@ -434,11 +421,11 @@ private:
int8_t expectedZones = -1;
int8_t previousZones = -1;
bool initialized = false;
bool flasher = false; // seconds passing flasher
bool flasher = false; // seconds passing flasher
// time/date stuff
char szTimeL[P104_MAX_MESG]; // dd-mm-yyyy hh:mm:ss\0
char szTimeH[P104_MAX_MESG];
char szTimeL[P104_MAX_MESG] = { 0 }; // dd-mm-yyyy hh:mm:ss\0
char szTimeH[P104_MAX_MESG] = { 0 };
};
#endif // ifdef USES_P104
+1 -1
View File
@@ -41,7 +41,7 @@ private:
bool range;
bool success = false;
bool readActive = false;
uint16_t distance;
uint16_t distance = 0u;
};
#endif // ifdef USES_P113
#endif // ifndef PLUGINSTRUCTS_P113_DATA_STRUCT_H
+3 -3
View File
@@ -56,10 +56,10 @@ private:
bool HD;
uint16_t UVData[5] = { 0, 0, 0, 0, 0 }; // UVA, Dummy, UVB, UVComp1, UVComp2
float UVAComp;
float UVBComp;
float UVAComp = 0.0f;
float UVBComp = 0.0f;
bool initialised;
bool initialised = false;
};
#endif // ifdef USES_P114
#endif // ifndef PLUGINSTRUCTS_P114_DATA_STRUCT_H
+3 -3
View File
@@ -50,7 +50,7 @@ void handle_controllers() {
bool mustCallCpluginSave = false;
{
// Place in a scope to free ControllerSettings memory ASAP
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addHtmlError(F("Not enough free memory to save settings"));
} else {
@@ -198,7 +198,7 @@ void handle_controllers_ShowAllControllersTable()
html_table_header(F("Host"));
html_table_header(F("Port"));
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (AllocatedControllerSettings()) {
for (controllerIndex_t x = 0; x < CONTROLLER_MAX; x++)
{
@@ -296,7 +296,7 @@ void handle_controllers_ControllerSettingsPage(controllerIndex_t controllerindex
if (Settings.Protocol[controllerindex])
{
{
MakeControllerSettings(ControllerSettings);
MakeControllerSettings(ControllerSettings); //-V522
if (!AllocatedControllerSettings()) {
addHtmlError(F("Out of memory, cannot load page"));
} else {
+2
View File
@@ -52,5 +52,7 @@ def concat_cpp_files(path_to_concat):
concat_cpp_files('./src/src/Commands')
concat_cpp_files('./src/src/ControllerQueue')
concat_cpp_files('./src/src/Globals')
concat_cpp_files('./src/src/Helpers')
concat_cpp_files('./src/src/PluginStructs')
concat_cpp_files('./src/src/WebServer')

Some files were not shown because too many files have changed in this diff Show More