Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into feature/P095-add-extra-display-types

This commit is contained in:
Ton Huisman
2022-05-18 20:29:55 +02:00
16 changed files with 155 additions and 146 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ class SH1106Wire : public OLEDDisplay {
// If the minBoundY wasn't updated
// we can savely assume that buffer_back[pos] == buffer[pos]
// holdes true for all values of pos
if (minBoundY == ~0) return;
if (minBoundY == static_cast<uint8_t>(~0)) return;
// Calculate the colum offset
uint8_t minBoundXp2H = (minBoundX + 2) & 0x0F;
+1 -1
View File
@@ -8,7 +8,7 @@ build_type = debug
;check_tool = clangtidy
check_tool = pvs-studio
check_flags =
pvs-studio: --analysis-mode=4 --errors-off=V532,V586,V795 --lic-file=../pvs_studio.lic
pvs-studio: --analysis-mode=4 --errors-off=V532,V586,V795,V1042 --lic-file=../pvs_studio.lic
build_flags = ${compiler_warnings.build_flags}
+1 -1
View File
@@ -253,7 +253,7 @@ float P026_get_value(int type)
}
case 9:
{
value = timePassedSince(lastWeb) / 1000; // respond in seconds
value = timePassedSince(lastWeb) / 1000.0f; // respond in seconds
break;
}
case 10:
+6
View File
@@ -590,6 +590,12 @@ bool getPluginIDAndPrefix(char selection, pluginID_t& pluginID, String& logPrefi
}
struct range_pattern_helper_data {
range_pattern_helper_data() {
// Make sure the pointer is always set.
logPrefix = F("GPIO");
}
const __FlashStringHelper * logPrefix;
uint32_t write = 0;
uint32_t mask = 0;
+22 -22
View File
@@ -47,7 +47,7 @@ void exit_mqtt_delay_queue() {
\*********************************************************************************************/
#ifdef USES_C001
# define C001_queue_element simple_queue_element_string_only
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 1)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 1) // -V522
#endif // ifdef USES_C001
/*********************************************************************************************\
@@ -55,16 +55,16 @@ DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 1)
\*********************************************************************************************/
#ifdef USES_C003
# define C003_queue_element simple_queue_element_string_only
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 3)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 3) // -V522
#endif // ifdef USES_C003
#ifdef USES_C004
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 4)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 4) // -V522
#endif // ifdef USES_C004
#ifdef USES_C007
# define C007_queue_element queue_element_formatted_uservar
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 7)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 7) // -V522
#endif // ifdef USES_C007
@@ -75,12 +75,12 @@ DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 7)
\*********************************************************************************************/
#ifdef USES_C008
# define C008_queue_element queue_element_single_value_base
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 8)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 8) // -V522
#endif // ifdef USES_C008
#ifdef USES_C009
# define C009_queue_element queue_element_formatted_uservar
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 9)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 9) // -V522
#endif // ifdef USES_C009
@@ -90,7 +90,7 @@ DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(00, 9)
\*********************************************************************************************/
#ifdef USES_C010
# define C010_queue_element queue_element_single_value_base
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP( 0, 10)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP( 0, 10) // -V522
#endif // ifdef USES_C010
@@ -99,7 +99,7 @@ DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP( 0, 10)
* C011_queue_element for queueing requests for 011: Generic HTTP Advanced
\*********************************************************************************************/
#ifdef USES_C011
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP( 0, 11)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP( 0, 11) // -V522
#endif // ifdef USES_C011
@@ -109,81 +109,81 @@ DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP( 0, 11)
\*********************************************************************************************/
#ifdef USES_C012
# define C012_queue_element queue_element_single_value_base
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP( 0, 12)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP( 0, 12) // -V522
#endif // ifdef USES_C012
/*
#ifdef USES_C013
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 13)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 13) // -V522
#endif
*/
/*
#ifdef USES_C014
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 14)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 14) // -V522
#endif
*/
#ifdef USES_C015
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 15)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 15) // -V522
#endif // ifdef USES_C015
#ifdef USES_C016
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 16)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 16) // -V522
#endif // ifdef USES_C016
#ifdef USES_C017
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 17)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 17) // -V522
#endif // ifdef USES_C017
#ifdef USES_C018
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 18)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 18) // -V522
#endif // ifdef USES_C018
/*
#ifdef USES_C019
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 19)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 19) // -V522
#endif
*/
/*
#ifdef USES_C020
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 20)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 20) // -V522
#endif
*/
/*
#ifdef USES_C021
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 21)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 21) // -V522
#endif
*/
/*
#ifdef USES_C022
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 22)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 22) // -V522
#endif
*/
/*
#ifdef USES_C023
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 23)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 23) // -V522
#endif
*/
/*
#ifdef USES_C024
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 24)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 24) // -V522
#endif
*/
/*
#ifdef USES_C025
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 25)
DEFINE_Cxxx_DELAY_QUEUE_MACRO_CPP(0, 25) // -V522
#endif
*/
@@ -8,13 +8,13 @@
#include <memory> // For std::shared_ptr
#include <new> // for std::nothrow
#include <IPAddress.h>
#include <WiFiClient.h>
#include <WiFiUdp.h>
#include "../../ESPEasy_common.h"
#include "../Globals/Plugins.h"
class IPAddress;
class WiFiClient;
class WiFiUDP;
// Minimum delay between messages for a controller to send in msec.
#ifndef CONTROLLER_DELAY_QUEUE_DELAY_MAX
# define CONTROLLER_DELAY_QUEUE_DELAY_MAX 3600000
+4 -4
View File
@@ -77,11 +77,11 @@ struct DeviceStruct
bool isCustom() const;
uint8_t Number; // Plugin ID number. (PLUGIN_ID_xxx)
uint8_t Type; // How the device is connected. e.g. DEVICE_TYPE_SINGLE => connected through 1 datapin
uint8_t Number; // Plugin ID number. (PLUGIN_ID_xxx)
uint8_t Type; // How the device is connected. e.g. DEVICE_TYPE_SINGLE => connected through 1 datapin
Sensor_VType VType; // Type of value the plugin will return. e.g. SENSOR_TYPE_STRING
uint8_t Ports; // Port to use when device has multiple I/O pins (N.B. not used much)
uint8_t ValueCount; // The number of output values of a plugin. The value should match the number of keys PLUGIN_VALUENAME1_xxx
uint8_t Ports; // Port to use when device has multiple I/O pins (N.B. not used much)
uint8_t ValueCount; // The number of output values of a plugin. The value should match the number of keys PLUGIN_VALUENAME1_xxx
Output_Data_type_t OutputDataType; // Subset of selectable output data types (Default = no selection)
bool PullUpOption : 1; // Allow to set internal pull-up resistors.
+1
View File
@@ -142,6 +142,7 @@ bool Modbus::handle() {
errcnt++;
TXRXstate = MODBUS_IDLE;
}
// FIXME TD-er: Missing break?
case MODBUS_RECEIVE_PAYLOAD:
+11 -11
View File
@@ -56,26 +56,26 @@ public:
private:
WiFiClient *ModbusClient; // pointer to tcp client
unsigned int errcnt;
WiFiClient *ModbusClient = nullptr; // pointer to tcp client
unsigned int errcnt = 0;
char sendBuffer[12] = { 0, 1, 0, 0, 0, 6, 0x7e, 4, 0x9d, 7, 0, 1 };
#ifndef BUILD_NO_DEBUG
String LogString; // for debug logging
#endif
unsigned long timeout; // send and read timeout
MODBUS_states_t TXRXstate; // state for handle() state machine
unsigned int RXavailable;
unsigned int payLoad; // number of bytes to receive as payload. Payload may come as seperate frame.
unsigned long timeout = 0; // send and read timeout
MODBUS_states_t TXRXstate = MODBUS_IDLE; // state for handle() state machine
unsigned int RXavailable = 0;
unsigned int payLoad = 0; // number of bytes to receive as payload. Payload may come as seperate frame.
bool hasTimeout();
MODBUS_registerTypes_t incomingValue; // how to interpret the incoming value
double result; // incoming value, converted to double
bool resultReceived; // incoming value is valid ?
MODBUS_registerTypes_t incomingValue = signed16; // how to interpret the incoming value
double result = 0.0; // incoming value, converted to double
bool resultReceived = false; // incoming value is valid ?
bool isBusy(void) {
return TXRXstate != MODBUS_IDLE;
}
uint16_t currentRegister;
uint8_t currentFunction;
uint16_t currentRegister = 0;
uint8_t currentFunction = 0;
};
+89 -88
View File
@@ -3,6 +3,7 @@
#define DATASTRUCTS_SETTINGSSTRUCT_H
#include "../CustomBuild/ESPEasyLimits.h"
#include "../DataStructs/DeviceStruct.h"
#include "../DataTypes/EthernetParameters.h"
#include "../DataTypes/NetworkMedium.h"
#include "../DataTypes/TimeSource.h"
@@ -52,7 +53,7 @@ class SettingsStruct_tmpl
{
public:
SettingsStruct_tmpl();
SettingsStruct_tmpl(); //-V730
// VariousBits1 defaults to 0, keep in mind when adding bit lookups.
bool appendUnitToHostname() const;
@@ -219,52 +220,52 @@ class SettingsStruct_tmpl
void setWiFi_TX_power(float dBm);
unsigned long PID;
int Version;
int16_t Build;
uint8_t IP[4];
uint8_t Gateway[4];
uint8_t Subnet[4];
uint8_t DNS[4];
uint8_t IP_Octet;
uint8_t Unit;
char Name[26];
char NTPHost[64];
unsigned long PID = 0;
int Version = 0;
int16_t Build = 0;
uint8_t IP[4] = {0};
uint8_t Gateway[4] = {0};
uint8_t Subnet[4] = {0};
uint8_t DNS[4] = {0};
uint8_t IP_Octet = 0;
uint8_t Unit = 0;
char Name[26] = {0};
char NTPHost[64] = {0};
// FIXME TD-er: Issue #2690
unsigned long Delay; // Sleep time in seconds
int8_t Pin_i2c_sda;
int8_t Pin_i2c_scl;
int8_t Pin_status_led;
int8_t Pin_sd_cs;
int8_t PinBootStates[17]; // Only use getPinBootState and setPinBootState as multiple pins are packed for ESP32
uint8_t Syslog_IP[4];
unsigned int UDPPort;
uint8_t SyslogLevel;
uint8_t SerialLogLevel;
uint8_t WebLogLevel;
uint8_t SDLogLevel;
unsigned long BaudRate;
unsigned long MessageDelay_unused; // MQTT settings now moved to the controller settings.
uint8_t deepSleep_wakeTime; // 0 = Sleep Disabled, else time awake from sleep in seconds
boolean CustomCSS;
boolean DST;
uint8_t WDI2CAddress;
boolean UseRules;
boolean UseSerial;
boolean UseSSDP;
uint8_t ExternalTimeSource;
unsigned long WireClockStretchLimit;
boolean GlobalSync;
unsigned long ConnectionFailuresThreshold;
int16_t TimeZone;
boolean MQTTRetainFlag_unused;
uint8_t InitSPI; //0 = disabled, 1= enabled but for ESP32 there is option 2= SPI2 9 = User defined, see src/src/WebServer/HardwarePage.h enum SPI_Options_e
unsigned long Delay = 0; // Sleep time in seconds
int8_t Pin_i2c_sda = -1;
int8_t Pin_i2c_scl = -1;
int8_t Pin_status_led = -1;
int8_t Pin_sd_cs = -1;
int8_t PinBootStates[17] = {0}; // Only use getPinBootState and setPinBootState as multiple pins are packed for ESP32
uint8_t Syslog_IP[4] = {0};
unsigned int UDPPort = 8266;
uint8_t SyslogLevel = 0;
uint8_t SerialLogLevel = 0;
uint8_t WebLogLevel = 0;
uint8_t SDLogLevel = 0;
unsigned long BaudRate = 115200;
unsigned long MessageDelay_unused = 0; // MQTT settings now moved to the controller settings.
uint8_t deepSleep_wakeTime = 0; // 0 = Sleep Disabled, else time awake from sleep in seconds
boolean CustomCSS = false;
boolean DST = false;
uint8_t WDI2CAddress = 0;
boolean UseRules = false;
boolean UseSerial = false;
boolean UseSSDP = false;
uint8_t ExternalTimeSource = 0;
unsigned long WireClockStretchLimit = 0;
boolean GlobalSync = false;
unsigned long ConnectionFailuresThreshold = 0;
int16_t TimeZone = 0;
boolean MQTTRetainFlag_unused = false;
uint8_t InitSPI = 0; //0 = disabled, 1= enabled but for ESP32 there is option 2= SPI2 9 = User defined, see src/src/WebServer/HardwarePage.h enum SPI_Options_e
// FIXME TD-er: Must change to cpluginID_t, but then also another check must be added since changing the pluginID_t will also render settings incompatible
uint8_t Protocol[CONTROLLER_MAX];
uint8_t Notification[NOTIFICATION_MAX]; //notifications, point to a NPLUGIN id
uint8_t Protocol[CONTROLLER_MAX] = {0};
uint8_t Notification[NOTIFICATION_MAX] = {0}; //notifications, point to a NPLUGIN id
// FIXME TD-er: Must change to pluginID_t, but then also another check must be added since changing the pluginID_t will also render settings incompatible
uint8_t TaskDeviceNumber[N_TASKS]; // The "plugin number" set at as task (e.g. 4 for P004_dallas)
unsigned int OLD_TaskDeviceID[N_TASKS]; //UNUSED: this can be removed
uint8_t TaskDeviceNumber[N_TASKS] = {0}; // The "plugin number" set at as task (e.g. 4 for P004_dallas)
unsigned int OLD_TaskDeviceID[N_TASKS] = {0}; //UNUSED: this can be removed
union {
struct {
int8_t TaskDevicePin1[N_TASKS];
@@ -274,68 +275,68 @@ class SettingsStruct_tmpl
};
int8_t TaskDevicePin[4][N_TASKS];
};
boolean TaskDevicePin1PullUp[N_TASKS];
boolean TaskDevicePin1PullUp[N_TASKS] = {0};
int16_t TaskDevicePluginConfig[N_TASKS][PLUGIN_CONFIGVAR_MAX];
boolean TaskDevicePin1Inversed[N_TASKS];
boolean TaskDevicePin1Inversed[N_TASKS] = {0};
float TaskDevicePluginConfigFloat[N_TASKS][PLUGIN_CONFIGFLOATVAR_MAX];
long TaskDevicePluginConfigLong[N_TASKS][PLUGIN_CONFIGLONGVAR_MAX];
uint8_t TaskDeviceSendDataFlags[N_TASKS];
uint8_t OLD_TaskDeviceGlobalSync[N_TASKS];
uint8_t TaskDeviceDataFeed[N_TASKS]; // When set to 0, only read local connected sensorsfeeds
unsigned long TaskDeviceTimer[N_TASKS];
boolean TaskDeviceEnabled[N_TASKS];
boolean ControllerEnabled[CONTROLLER_MAX];
boolean NotificationEnabled[NOTIFICATION_MAX];
uint8_t TaskDeviceSendDataFlags[N_TASKS] = {0};
uint8_t OLD_TaskDeviceGlobalSync[N_TASKS] = {0};
uint8_t TaskDeviceDataFeed[N_TASKS] = {0}; // When set to 0, only read local connected sensorsfeeds
unsigned long TaskDeviceTimer[N_TASKS] = {0};
boolean TaskDeviceEnabled[N_TASKS] = {0};
boolean ControllerEnabled[CONTROLLER_MAX] = {0};
boolean NotificationEnabled[NOTIFICATION_MAX] = {0};
unsigned int TaskDeviceID[CONTROLLER_MAX][N_TASKS]; // IDX number (mainly used by Domoticz)
boolean TaskDeviceSendData[CONTROLLER_MAX][N_TASKS];
boolean Pin_status_led_Inversed;
boolean deepSleepOnFail;
boolean UseValueLogger;
boolean ArduinoOTAEnable;
uint16_t DST_Start;
uint16_t DST_End;
boolean UseRTOSMultitasking;
int8_t Pin_Reset;
uint8_t SyslogFacility;
uint32_t StructSize; // Forced to be 32 bit, to make sure alignment is clear.
boolean MQTTUseUnitNameAsClientId_unused;
boolean Pin_status_led_Inversed = false;
boolean deepSleepOnFail = false;
boolean UseValueLogger = false;
boolean ArduinoOTAEnable = false;
uint16_t DST_Start = 0;
uint16_t DST_End = 0;
boolean UseRTOSMultitasking = false;
int8_t Pin_Reset = -1;
uint8_t SyslogFacility = 0;
uint32_t StructSize = 0; // Forced to be 32 bit, to make sure alignment is clear.
boolean MQTTUseUnitNameAsClientId_unused = false;
//its safe to extend this struct, up to several bytes, default values in config are 0
//look in misc.ino how config.dat is used because also other stuff is stored in it at different offsets.
//TODO: document config.dat somewhere here
float Latitude;
float Longitude;
uint32_t VariousBits1;
uint32_t ResetFactoryDefaultPreference; // Do not clear this one in the clearAll()
uint32_t I2C_clockSpeed;
uint16_t WebserverPort;
uint16_t SyslogPort;
float Latitude = 0.0f;
float Longitude = 0.0f;
uint32_t VariousBits1 = 0;
uint32_t ResetFactoryDefaultPreference = 0; // Do not clear this one in the clearAll()
uint32_t I2C_clockSpeed = 400000;
uint16_t WebserverPort = 80;
uint16_t SyslogPort = 0;
// FIXME @TD-er: As discussed in #1292, the CRC for the settings is now disabled.
// make sure crc is the last value in the struct
// Try to extend settings to make the checksum 4-uint8_t aligned.
// uint8_t ProgmemMd5[16]; // crc of the binary that last saved the struct to file.
// uint8_t md5[16];
int8_t ETH_Phy_Addr;
int8_t ETH_Pin_mdc;
int8_t ETH_Pin_mdio;
int8_t ETH_Pin_power;
EthPhyType_t ETH_Phy_Type;
EthClockMode_t ETH_Clock_Mode;
uint8_t ETH_IP[4];
uint8_t ETH_Gateway[4];
uint8_t ETH_Subnet[4];
uint8_t ETH_DNS[4];
NetworkMedium_t NetworkMedium;
int8_t I2C_Multiplexer_Type;
int8_t I2C_Multiplexer_Addr;
int8_t ETH_Phy_Addr = -1;
int8_t ETH_Pin_mdc = -1;
int8_t ETH_Pin_mdio = -1;
int8_t ETH_Pin_power = -1;
EthPhyType_t ETH_Phy_Type = EthPhyType_t::LAN8710;
EthClockMode_t ETH_Clock_Mode = EthClockMode_t::Ext_crystal_osc;
uint8_t ETH_IP[4] = {0};
uint8_t ETH_Gateway[4] = {0};
uint8_t ETH_Subnet[4] = {0};
uint8_t ETH_DNS[4] = {0};
NetworkMedium_t NetworkMedium = NetworkMedium_t::WIFI;
int8_t I2C_Multiplexer_Type = I2C_MULTIPLEXER_NONE;
int8_t I2C_Multiplexer_Addr = -1;
int8_t I2C_Multiplexer_Channel[N_TASKS];
uint8_t I2C_Flags[N_TASKS];
uint32_t I2C_clockSpeed_Slow;
uint8_t I2C_Multiplexer_ResetPin;
uint8_t I2C_Flags[N_TASKS] = {0};
uint32_t I2C_clockSpeed_Slow = 100000;
int8_t I2C_Multiplexer_ResetPin = -1;
#ifdef ESP32
int8_t PinBootStates_ESP32[24]; // pins 17 ... 39
int8_t PinBootStates_ESP32[24] = {0}; // pins 17 ... 39
#endif
uint8_t WiFi_TX_power = 70; // 70 = 17.5dBm. unit: 0.25 dBm
int8_t WiFi_sensitivity_margin = 3; // Margin in dBm on top of sensitivity.
+1 -1
View File
@@ -12,7 +12,7 @@ nprotocolIndex_t INVALID_NPROTOCOL_INDEX = NPLUGIN_MAX;
bool (*NPlugin_ptr[NPLUGIN_MAX])(NPlugin::Function,
struct EventStruct *,
String&);
npluginID_t NPlugin_id[NPLUGIN_MAX] = { INVALID_N_PLUGIN_ID };
npluginID_t NPlugin_id[NPLUGIN_MAX];
NotificationStruct Notification[NPLUGIN_MAX];
+1 -1
View File
@@ -43,7 +43,7 @@ inline int64_t usecPassedSince(const uint64_t& timestamp) {
return timeDiff64(timestamp, getMicros64());
}
inline int64_t usecPassedSince(uint64_t& timestamp) {
inline int64_t usecPassedSince(uint64_t& timestamp) { //-V669
return timeDiff64(timestamp, getMicros64());
}
+2 -2
View File
@@ -900,10 +900,10 @@ uint32_t HwRandom() {
uint32_t result = 0;
do {
ccount = ESP.getCycleCount();
result ^= *(volatile uint32_t *)_RAND_ADDR;
result ^= *(volatile uint32_t *)_RAND_ADDR; // -V566
} while (ccount - last_ccount < 64);
last_ccount = ccount;
return result ^ *(volatile uint32_t *)_RAND_ADDR;
return result ^ *(volatile uint32_t *)_RAND_ADDR; // -V566
#undef _RAND_ADDR
}
+3 -3
View File
@@ -2,12 +2,15 @@
#define CPLUGIN_HELPER_H
#include <Arduino.h>
#include <WiFiClient.h>
#include <WiFiUdp.h>
#include "../../ESPEasy_common.h"
#include "../../_Plugin_Helper.h"
#include "../ControllerQueue/DelayQueueElements.h" // Also forward declaring the do_process_cNNN_delay_queue
#include "../DataStructs/ControllerSettingsStruct.h"
#include "../ESPEasyCore/Controller.h"
#include "../ESPEasyCore/ESPEasyNetwork.h"
#include "../Globals/CPlugins.h"
@@ -21,9 +24,6 @@
#include "../Helpers/_CPlugin_Helper_webform.h"
struct ControllerSettingsStruct;
class WiFiUDP;
class WiFiClient;
/*********************************************************************************************\
* Helper functions used in a number of controllers
+2 -1
View File
@@ -33,7 +33,8 @@ void NPluginInit()
// Clear pointer table for all plugins
for (x = 0; x < NPLUGIN_MAX; x++)
{
NPlugin_ptr[x] = nullptr;
NPlugin_ptr[x] = nullptr;
NPlugin_id[x] = INVALID_N_PLUGIN_ID;
// ProtocolIndex_to_NPlugin_id[x] = INVALID_N_PLUGIN_ID;
// Do not initialize NPlugin_id_to_ProtocolIndex[x] to an invalid value. (it is map)
}
+6 -6
View File
@@ -77,6 +77,12 @@ void serve_JS(JSfiles_e JSfile) {
{
#ifndef WEBSERVER_INCLUDE_JS
url = generate_external_URL(url);
addHtml(F("<script"));
addHtml(F(" defer"));
addHtmlAttribute(F("src"), url);
addHtml('>');
html_add_script_end();
return;
#else
html_add_script(true);
switch (JSfile) {
@@ -114,12 +120,6 @@ void serve_JS(JSfiles_e JSfile) {
html_add_script_end();
return;
#endif
addHtml(F("<script"));
addHtml(F(" defer"));
addHtmlAttribute(F("src"), url);
addHtml('>');
html_add_script_end();
return;
}
// Now stream the file directly from the file system.
html_add_script(false);