Fix wrong type of tEnableLEDFeedback in IRSend.hpp (#1177)

tEnableLEDFeedback should not be a bool, because it's used as a bitmask
with different states (Send/Receive/...). Even though a bool should be
a byte anyways, this is apprently optimized with the current platformio
toolchain for ESP8266 and causes the feedback LED to not work correctly.
This commit is contained in:
Florian Meier 2023-10-16 23:05:09 +02:00 committed by GitHub
parent b1941ff470
commit c6aa13e443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ void IRsend::begin(){
*/
void IRsend::begin(bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin) {
#if !defined(NO_LED_FEEDBACK_CODE)
bool tEnableLEDFeedback = DO_NOT_ENABLE_LED_FEEDBACK;
uint_fast8_t tEnableLEDFeedback = DO_NOT_ENABLE_LED_FEEDBACK;
if(aEnableLEDFeedback) {
tEnableLEDFeedback = LED_FEEDBACK_ENABLED_FOR_SEND;
}
@ -143,7 +143,7 @@ void IRsend::begin(uint_fast8_t aSendPin, bool aEnableLEDFeedback, uint_fast8_t
#endif
#if !defined(NO_LED_FEEDBACK_CODE)
bool tEnableLEDFeedback = DO_NOT_ENABLE_LED_FEEDBACK;
uint_fast8_t tEnableLEDFeedback = DO_NOT_ENABLE_LED_FEEDBACK;
if (aEnableLEDFeedback) {
tEnableLEDFeedback = LED_FEEDBACK_ENABLED_FOR_SEND;
}