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
1 changed files with 6 additions and 0 deletions

View File

@ -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;