mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-12 01:24:04 +00:00
[ESP-IDF 5.1] Fix some warnings on compiling with IDF 5.1
This commit is contained in:
@@ -35,6 +35,18 @@
|
||||
|
||||
#include "Adafruit_SPITFT.h"
|
||||
|
||||
#if defined(ESP32)
|
||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||
#include <atomic>
|
||||
#define NOT_FAST_PINIO_WAIT for (std::atomic<uint8_t> i = 0; i < 1; i++) ;
|
||||
#else
|
||||
#define NOT_FAST_PINIO_WAIT for (volatile uint8_t i = 0; i < 1; i++) ;
|
||||
#endif
|
||||
#else
|
||||
#define NOT_FAST_PINIO_WAIT
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__AVR__)
|
||||
#if defined(__AVR_XMEGA__) // only tested with __AVR_ATmega4809__
|
||||
#define AVR_WRITESPI(x) \
|
||||
@@ -2305,10 +2317,7 @@ inline void Adafruit_SPITFT::SPI_MOSI_HIGH(void) {
|
||||
#endif // end !HAS_PORT_SET_CLR
|
||||
#else // !USE_FAST_PINIO
|
||||
digitalWrite(swspi._mosi, HIGH);
|
||||
#if defined(ESP32)
|
||||
for (volatile uint8_t i = 0; i < 1; i++)
|
||||
;
|
||||
#endif // end ESP32
|
||||
NOT_FAST_PINIO_WAIT
|
||||
#endif // end !USE_FAST_PINIO
|
||||
}
|
||||
|
||||
@@ -2328,10 +2337,7 @@ inline void Adafruit_SPITFT::SPI_MOSI_LOW(void) {
|
||||
#endif // end !HAS_PORT_SET_CLR
|
||||
#else // !USE_FAST_PINIO
|
||||
digitalWrite(swspi._mosi, LOW);
|
||||
#if defined(ESP32)
|
||||
for (volatile uint8_t i = 0; i < 1; i++)
|
||||
;
|
||||
#endif // end ESP32
|
||||
NOT_FAST_PINIO_WAIT
|
||||
#endif // end !USE_FAST_PINIO
|
||||
}
|
||||
|
||||
@@ -2355,10 +2361,7 @@ inline void Adafruit_SPITFT::SPI_SCK_HIGH(void) {
|
||||
#endif // end !HAS_PORT_SET_CLR
|
||||
#else // !USE_FAST_PINIO
|
||||
digitalWrite(swspi._sck, HIGH);
|
||||
#if defined(ESP32)
|
||||
for (volatile uint8_t i = 0; i < 1; i++)
|
||||
;
|
||||
#endif // end ESP32
|
||||
NOT_FAST_PINIO_WAIT
|
||||
#endif // end !USE_FAST_PINIO
|
||||
}
|
||||
|
||||
@@ -2382,10 +2385,7 @@ inline void Adafruit_SPITFT::SPI_SCK_LOW(void) {
|
||||
#endif // end !HAS_PORT_SET_CLR
|
||||
#else // !USE_FAST_PINIO
|
||||
digitalWrite(swspi._sck, LOW);
|
||||
#if defined(ESP32)
|
||||
for (volatile uint8_t i = 0; i < 1; i++)
|
||||
;
|
||||
#endif // end ESP32
|
||||
NOT_FAST_PINIO_WAIT
|
||||
#endif // end !USE_FAST_PINIO
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,8 @@ void Adafruit_TSL2591::setGain(tsl2591Gain_t gain)
|
||||
|
||||
enable();
|
||||
_gain = gain;
|
||||
write8(TSL2591_COMMAND_BIT | TSL2591_REGISTER_CONTROL, _integration | _gain);
|
||||
const uint8_t value = static_cast<uint8_t>(_integration) | static_cast<uint8_t>(_gain);
|
||||
write8(TSL2591_COMMAND_BIT | TSL2591_REGISTER_CONTROL, value);
|
||||
disable();
|
||||
}
|
||||
|
||||
@@ -162,7 +163,8 @@ void Adafruit_TSL2591::setTiming(tsl2591IntegrationTime_t integration)
|
||||
|
||||
enable();
|
||||
_integration = integration;
|
||||
write8(TSL2591_COMMAND_BIT | TSL2591_REGISTER_CONTROL, _integration | _gain);
|
||||
const uint8_t value = static_cast<uint8_t>(_integration) | static_cast<uint8_t>(_gain);
|
||||
write8(TSL2591_COMMAND_BIT | TSL2591_REGISTER_CONTROL, value);
|
||||
disable();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,14 @@ float p076_hpowfact{};
|
||||
# define P076_Gosund 9
|
||||
# define P076_Shelly_PLUG_S 10
|
||||
|
||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||
// FIXME TD-er: Must check if older (and ESP8266) envs need IRAM_ATTR in the function declaration.
|
||||
void p076_hlw8012_cf1_interrupt();
|
||||
void p076_hlw8012_cf_interrupt();
|
||||
#else
|
||||
void IRAM_ATTR p076_hlw8012_cf1_interrupt();
|
||||
void IRAM_ATTR p076_hlw8012_cf_interrupt();
|
||||
#endif
|
||||
|
||||
|
||||
bool p076_getDeviceParameters(int device,
|
||||
|
||||
@@ -3211,6 +3211,13 @@ To create/register a plugin, you have to :
|
||||
#undef USES_P002
|
||||
#endif
|
||||
|
||||
|
||||
// Internal temp sensor causes crashes on ESP32-C3
|
||||
#ifdef FEATURE_INTERNAL_TEMPERATURE
|
||||
# undef FEATURE_INTERNAL_TEMPERATURE
|
||||
# define FEATURE_INTERNAL_TEMPERATURE 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ CCS811Core::status CCS811Core::beginCore(void)
|
||||
# endif
|
||||
|
||||
// Spin for a few ms
|
||||
volatile uint8_t temp = 0;
|
||||
|
||||
ESPEASY_VOLATILE(uint8_t) temp = 0;
|
||||
// FIXME TD-er: This is a rather odd way to avoid calling "delay"
|
||||
for (uint16_t i = 0; i < 10000; i++)
|
||||
{
|
||||
temp++;
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
volatile uint8_t ISR_DLB_Pin = 0xFF;
|
||||
volatile boolean ISR_Receiving = false; // receiving flag
|
||||
volatile boolean ISR_AllBitsReceived = false;
|
||||
volatile uint16_t ISR_PulseCount = 0; // number of received pulses
|
||||
ESPEASY_VOLATILE(uint16_t) ISR_PulseCount = 0; // number of received pulses
|
||||
volatile uint16_t ISR_PulseNumber = 0; // max naumber of the received pulses
|
||||
volatile uint16_t ISR_MinPulseWidth = 0;
|
||||
volatile uint16_t ISR_MaxPulseWidth = 0;
|
||||
|
||||
Reference in New Issue
Block a user