Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into feature/MQTT-discovery

This commit is contained in:
Ton Huisman
2025-06-27 21:13:01 +02:00
2 changed files with 7 additions and 8 deletions
+1 -3
View File
@@ -4,8 +4,6 @@
# include "../ESPEasyCore/ESPEasyGPIO.h"
# include <GPIO_Direct_Access.h>
# include "../Commands/GPIO.h" // FIXME TD-er: Only needed till we can call GPIO commands from the ESPEasy core.
@@ -443,7 +441,7 @@ void ICACHE_RAM_ATTR P098_data_struct::process_limit_switch(
{
// Don't call gpio_config.readState() here
const bool pinState =
(DIRECT_pinRead_ISR(gpio_config.gpio) == 0) ^ gpio_config.inverted;
(DIRECT_pinRead_ISR(gpio_config.gpio) != 0) ^ gpio_config.inverted;
const uint64_t currentTime = getMicros64();
+6 -5
View File
@@ -4,22 +4,23 @@
#include "../../_Plugin_Helper.h"
#ifdef USES_P098
# include <GPIO_Direct_Access.h>
# define P098_LIMIT_SWITCH_TRIGGERPOS_MARGIN 10
struct P098_GPIO_config {
byte high() const {
uint8_t high() const {
return inverted ? 0 : 1;
}
byte low() const {
uint8_t low() const {
return inverted ? 1 : 0;
}
// Don't call this from ISR functions.
bool readState() const {
const bool state = digitalRead(gpio) != 0;
return inverted ? !state : state;
return (DIRECT_pinRead_ISR(gpio) != 0) ^ inverted;
}
uint64_t timer_us = 100000;