From e6e126391dfd91d0d6cdfb8a8261e505ac052377 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Thu, 3 May 2018 15:21:45 +0200 Subject: [PATCH] Fix compile error when ADC enabled and No rules 5.13.1a * Fix compile error when ADC is enabled and Rules are disabled (#2608) --- sonoff/_releasenotes.ino | 1 + sonoff/support.ino | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 8236aae15..0ab8d3efc 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,5 +1,6 @@ /* 5.13.1a * Change user_config.h otaurl to http://sonoff.maddox.co.uk/tasmota/sonoff.bin (#2588, #2602) + * Fix compile error when ADC is enabled and Rules are disabled (#2608) * * 5.13.1 20180501 * Fix JSON buffers size too small for execution in some situations (#2580) diff --git a/sonoff/support.ino b/sonoff/support.ino index a33c81a1a..d86f9ccce 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -1400,6 +1400,7 @@ uint16_t AdcRead() return analog; } +#ifdef USE_RULES void AdcEvery50ms() { adc_counter++; @@ -1413,6 +1414,7 @@ void AdcEvery50ms() } } } +#endif // USE_RULES void AdcShow(boolean json) { @@ -1439,9 +1441,11 @@ boolean Xsns02(byte function) if (pin[GPIO_ADC0] < 99) { switch (function) { +#ifdef USE_RULES case FUNC_EVERY_50_MSECOND: AdcEvery50ms(); break; +#endif // USE_RULES case FUNC_JSON_APPEND: AdcShow(1); break;