crankyoldgit / IRremoteESP8266

Infrared remote library for ESP8266/ESP32: send and receive infrared signals with multiple protocols. Based on: https://github.com/shirriff/Arduino-IRremote/
GNU Lesser General Public License v2.1
2.95k stars 831 forks source link

When SEND_LG is true and SEND_SAMSUNG is false compilation fails #2010

Closed dilyanpalauzov closed 1 year ago

dilyanpalauzov commented 1 year ago

… because ir_LG.cpp/IRSend::sendLG contains:

    // LG 32bit protocol is near identical to Samsung except for repeats.
    sendSAMSUNG(data, nbits, 0);  // Send it as a single Samsung message.
    repeatHeaderMark = kLg32RptHdrMark;
    duty = 33;
    repeat++;
crankyoldgit commented 1 year ago

Thanks for the report. Can you please test out PR #2011 to see if that fixes the issue?

dilyanpalauzov commented 1 year ago

This is also necessary

diff --git a/IRremoteESP8266/src/IRsend.h b/IRremoteESP8266/src/IRsend.h
index f8a447197..a778df309 100644
--- a/IRremoteESP8266/src/IRsend.h
+++ b/IRremoteESP8266/src/IRsend.h
@@ -310,7 +310,7 @@ class IRsend {
   void sendSherwood(uint64_t data, uint16_t nbits = kSherwoodBits,
                     uint16_t repeat = kSherwoodMinRepeat);
 #endif
-#if SEND_SAMSUNG
+#if SEND_SAMSUNG || SEND_LG
   void sendSAMSUNG(const uint64_t data, const uint16_t nbits = kSamsungBits,
                    const uint16_t repeat = kNoRepeat);
   uint32_t encodeSAMSUNG(const uint8_t customer, const uint8_t command);
crankyoldgit commented 1 year ago

@dilyanpalauzov Thanks for that. I totally forgot that bit. I've updated PR #2011. Can you please confirm if the update now covers everything?

dilyanpalauzov commented 1 year ago

This looks good. I cannot test the patch 1:1, since I use IRremoteESP8266 within Tasmota, where IRremoteESP8266 is part of the version-controlled code of Tasmota. In any case with the change I provided above, and you have integrated, the code compiles.

Besides, the parentheses after #if are not necessary.