From 85ed1bebca99e50887095334f08d155019a2d25a Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 20 Dec 2020 17:22:48 +0100 Subject: [PATCH] Fix compile error when ``#ifdef USE_IR_RECEIVE`` is disabled regression from 9.1.0.2 Fix compile error when ``#ifdef USE_IR_RECEIVE`` is disabled regression from 9.1.0.2 --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/xdrv_05_irremote.ino | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 049f29d73..d96ae0fb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - Shelly Dimmer power on state (#10154, #10182) - Wemo emulation for single devices (#10165, #10194) - ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506) +- Compile error when ``#ifdef USE_IR_RECEIVE`` is disabled regression from 9.1.0.2 ## [Released] diff --git a/RELEASENOTES.md b/RELEASENOTES.md index efd15218d..51ec025df 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -68,3 +68,4 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Shelly Dimmer power on state (#10154, #10182) - Wemo emulation for single devices (#10165, #10194) - ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506) +- Compile error when ``#ifdef USE_IR_RECEIVE`` is disabled regression from 9.1.0.2 diff --git a/tasmota/xdrv_05_irremote.ino b/tasmota/xdrv_05_irremote.ino index cd401d7c0..6e3bad365 100644 --- a/tasmota/xdrv_05_irremote.ino +++ b/tasmota/xdrv_05_irremote.ino @@ -290,7 +290,10 @@ uint32_t IrRemoteCmndIrSendJson(void) AddLog_P(LOG_LEVEL_DEBUG, PSTR("IRS: protocol_text %s, protocol %s, bits %d, data %s (0x%s), repeat %d, protocol_code %d"), protocol_text, protocol, bits, ulltoa(data, dvalue, 10), Uint64toHex(data, hvalue, bits), repeat, protocol_code); +#ifdef USE_IR_RECEIVE if (irrecv != nullptr) { irrecv->disableIRIn(); } +#endif // USE_IR_RECEIVE + switch (protocol_code) { // Equals IRremoteESP8266.h enum decode_type_t #ifdef USE_IR_SEND_RC5 case RC5: @@ -305,10 +308,14 @@ uint32_t IrRemoteCmndIrSendJson(void) irsend->sendNEC(data, (bits > NEC_BITS) ? NEC_BITS : bits, repeat); break; #endif default: +#ifdef USE_IR_RECEIVE if (irrecv != nullptr) { irrecv->enableIRIn(); } +#endif // USE_IR_RECEIVE return IE_PROTO_UNSUPPORTED; } +#ifdef USE_IR_RECEIVE if (irrecv != nullptr) { irrecv->enableIRIn(); } +#endif // USE_IR_RECEIVE return IE_NO_ERROR; }