Fix compilation when USE_ADC is not defined (#20498)

This commit is contained in:
Theo Arends 2024-01-15 10:34:14 +01:00
parent 8d83472c01
commit ee4bf86e6a

View File

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