Selaa lähdekoodia

Track GPIO initialization and ISR registration state

SybexXx 3 päivää sitten
vanhempi
sitoutus
203d329ce7
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      code/components/jomjol_controlGPIO/server_GPIO.h

+ 2 - 1
code/components/jomjol_controlGPIO/server_GPIO.h

@@ -40,7 +40,7 @@ public:
     GpioPin(gpio_num_t gpio, const char* name, gpio_pin_mode_t mode, gpio_int_type_t interruptType, uint8_t dutyResolution, std::string mqttTopic, bool httpEnable);
     GpioPin(gpio_num_t gpio, const char* name, gpio_pin_mode_t mode, gpio_int_type_t interruptType, uint8_t dutyResolution, std::string mqttTopic, bool httpEnable);
     ~GpioPin();
     ~GpioPin();
 
 
-    void init();
+    bool init();
     bool getValue(std::string* errorText);
     bool getValue(std::string* errorText);
     void setValue(bool value, gpio_set_source setSource, std::string* errorText);
     void setValue(bool value, gpio_set_source setSource, std::string* errorText);
 #ifdef ENABLE_MQTT
 #ifdef ENABLE_MQTT
@@ -60,6 +60,7 @@ private:
     gpio_int_type_t _interruptType;
     gpio_int_type_t _interruptType;
     std::string _mqttTopic;
     std::string _mqttTopic;
     bool _httpEnable = false;
     bool _httpEnable = false;
+    bool _isrRegistered = false;
     int currentState = -1;
     int currentState = -1;
 };
 };