fix
This commit is contained in:
parent
86056fcd41
commit
a610335482
|
@ -90,9 +90,7 @@ namespace ratgdo {
|
||||||
}
|
}
|
||||||
|
|
||||||
this->output_gdo_pin_->setup();
|
this->output_gdo_pin_->setup();
|
||||||
this->store_.output_gdo = this->output_gdo_pin_->to_isr();
|
|
||||||
this->input_gdo_pin_->setup();
|
this->input_gdo_pin_->setup();
|
||||||
this->store_.input_gdo = this->input_gdo_pin_->to_isr();
|
|
||||||
this->input_obst_pin_->setup();
|
this->input_obst_pin_->setup();
|
||||||
this->store_.input_obst = this->input_obst_pin_->to_isr();
|
this->store_.input_obst = this->input_obst_pin_->to_isr();
|
||||||
|
|
||||||
|
|
|
@ -29,25 +29,19 @@ namespace ratgdo {
|
||||||
class RATGDOComponent;
|
class RATGDOComponent;
|
||||||
|
|
||||||
struct RATGDOStore {
|
struct RATGDOStore {
|
||||||
ISRInternalGPIOPin output_gdo;
|
|
||||||
|
|
||||||
ISRInternalGPIOPin input_gdo;
|
|
||||||
ISRInternalGPIOPin input_obst;
|
ISRInternalGPIOPin input_obst;
|
||||||
|
|
||||||
ISRInternalGPIOPin trigger_open;
|
ISRInternalGPIOPin trigger_open;
|
||||||
ISRInternalGPIOPin trigger_close;
|
ISRInternalGPIOPin trigger_close;
|
||||||
ISRInternalGPIOPin trigger_light;
|
ISRInternalGPIOPin trigger_light;
|
||||||
|
|
||||||
ISRInternalGPIOPin status_door;
|
|
||||||
ISRInternalGPIOPin status_obst;
|
|
||||||
|
|
||||||
unsigned long lastOpenDoorTime { 0 };
|
unsigned long lastOpenDoorTime { 0 };
|
||||||
unsigned long lastCloseDoorTime { 0 };
|
unsigned long lastCloseDoorTime { 0 };
|
||||||
unsigned long lastToggleLightTime { 0 };
|
unsigned long lastToggleLightTime { 0 };
|
||||||
unsigned long lastPulse { 0 };
|
|
||||||
volatile int doorPositionCounter { 0 }; // calculate the door's movement and position
|
bool dryContactDoorOpen { false };
|
||||||
bool rpm1Pulsed { false }; // did rpm1 get a pulse or not - eliminates an issue when the
|
bool dryContactDoorClose { false };
|
||||||
// sensor is parked on a high pulse which fires rpm2 isr
|
bool dryContactToggleLight { false };
|
||||||
|
|
||||||
int obstructionLowCount = 0; // count obstruction low pulses
|
int obstructionLowCount = 0; // count obstruction low pulses
|
||||||
long lastObstructionHigh = 0; // count time between high pulses from the obst ISR
|
long lastObstructionHigh = 0; // count time between high pulses from the obst ISR
|
||||||
|
@ -58,10 +52,6 @@ namespace ratgdo {
|
||||||
uint8_t lightState = 2;
|
uint8_t lightState = 2;
|
||||||
uint8_t doorState = 0;
|
uint8_t doorState = 0;
|
||||||
|
|
||||||
bool dryContactDoorOpen { false };
|
|
||||||
bool dryContactDoorClose { false };
|
|
||||||
bool dryContactToggleLight { false };
|
|
||||||
|
|
||||||
static void IRAM_ATTR isrDoorOpen(RATGDOStore* arg);
|
static void IRAM_ATTR isrDoorOpen(RATGDOStore* arg);
|
||||||
static void IRAM_ATTR isrDoorClose(RATGDOStore* arg);
|
static void IRAM_ATTR isrDoorClose(RATGDOStore* arg);
|
||||||
static void IRAM_ATTR isrLight(RATGDOStore* arg);
|
static void IRAM_ATTR isrLight(RATGDOStore* arg);
|
||||||
|
|
Loading…
Reference in New Issue