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
This commit is contained in:
Theo Arends 2020-12-20 17:22:48 +01:00
parent 25a660bdec
commit 85ed1bebca
3 changed files with 9 additions and 0 deletions

View File

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

View File

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

View File

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