diff --git a/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino b/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino index 5050d5cb6..25108f7a6 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino @@ -220,6 +220,7 @@ void GVMonitorTask(void) { } #endif // ESP8266 +#ifdef USE_ADC else if (AdcPin(pin)) { // Read Analog (ADC) GPIO pintype = GV_AnalogPin; @@ -235,6 +236,8 @@ void GVMonitorTask(void) { originalValue = AdcRead1(pin); currentState = changeUIntScale(originalValue, 0, AdcRange(), 0, 255); // Bring back to 0..255 } +#endif // USE_ADC + else { // Read digital GPIO pintype = GV_DigitalPin; @@ -403,6 +406,9 @@ bool Xdrv121(uint32_t function) { GVMonitorTask(); } break; + case FUNC_SAVE_BEFORE_RESTART: + GVCloseEvent(); // Stop current updates + break; case FUNC_ACTIVE: result = true; break;