Skip to content

Commit d06e806

Browse files
committed
Rename ledOff to IRLedOff. Support / Messages for F_CPU > 16 MHz.
1 parent 248012e commit d06e806

File tree

6 files changed

+91
-59
lines changed

6 files changed

+91
-59
lines changed

src/IRSend.cpp.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void IRsend::sendRaw(const uint8_t aBufferWithTicks[], uint_fast8_t aLengthOfBuf
217217
mark(aBufferWithTicks[i] * MICROS_PER_TICK);
218218
}
219219
}
220-
ledOff(); // Always end with the LED off
220+
IRLedOff(); // Always end with the LED off
221221
}
222222

223223
/**
@@ -266,7 +266,7 @@ void IRsend::sendRaw_P(const uint8_t aBufferWithTicks[], uint_fast8_t aLengthOfB
266266
mark(duration);
267267
}
268268
}
269-
ledOff(); // Always end with the LED off
269+
IRLedOff(); // Always end with the LED off
270270
#endif
271271
}
272272

@@ -305,7 +305,6 @@ void IRsend::sendPulseDistanceWidthData(unsigned int aOneMarkMicros, unsigned in
305305
if (aSendStopBit) {
306306
TRACE_PRINT('S');
307307
mark(aZeroMarkMicros); // seems like this is used for stop bits
308-
ledOff(); // Always end with the LED off
309308
}
310309
TRACE_PRINTLN("");
311310
}
@@ -350,7 +349,6 @@ void IRsend::sendBiphaseData(unsigned int aBiphaseTimeUnit, uint32_t aData, uint
350349
tLastBitValue = 0;
351350
}
352351
}
353-
// ledOff(); // Always end with the LED off
354352
TRACE_PRINTLN("");
355353
}
356354

@@ -364,14 +362,14 @@ void IRsend::mark(unsigned int aMarkMicros) {
364362
setFeedbackLED(true);
365363

366364
#if defined(SEND_PWM_BY_TIMER) || defined(ESP32)
367-
TIMER_ENABLE_SEND_PWM; // Enable timer or ledcWrite() generated PWM output
365+
ENABLE_SEND_PWM_BY_TIMER; // Enable timer or ledcWrite() generated PWM output
368366
customDelayMicroseconds(aMarkMicros);
369-
ledOff();
367+
IRLedOff();
370368

371369
#elif defined(USE_NO_SEND_PWM)
372370
digitalWrite(sendPin, LOW); // Set output to active low.
373371
customDelayMicroseconds(aMarkMicros);
374-
ledOff();
372+
IRLedOff();
375373

376374
#else
377375
unsigned long start = micros();
@@ -402,9 +400,9 @@ void IRsend::mark(unsigned int aMarkMicros) {
402400
* A space is "no output", so the PWM output is disabled.
403401
* This function may affect the state of feedback LED.
404402
*/
405-
void IRsend::ledOff() {
403+
void IRsend::IRLedOff() {
406404
#if defined(SEND_PWM_BY_TIMER) || defined(ESP32)
407-
TIMER_DISABLE_SEND_PWM; // Disable PWM output
405+
DISABLE_SEND_PWM_BY_TIMER; // Disable PWM output
408406
#elif defined(USE_NO_SEND_PWM)
409407
digitalWrite(sendPin, HIGH); // Set output to inactive high.
410408
#else
@@ -461,7 +459,7 @@ void IRsend::enableIROut(uint8_t aFrequencyKHz) {
461459
#endif
462460

463461
pinMode(sendPin, OUTPUT);
464-
ledOff(); // When not sending, we want it low/inactive
462+
IRLedOff(); // When not sending, we want it low/inactive
465463
}
466464

467465
/** @}*/

src/IRremoteInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class IRsend {
397397

398398
void mark(unsigned int aMarkMicros);
399399
void space(unsigned int aSpaceMicros);
400-
void ledOff();
400+
void IRLedOff();
401401

402402
// 8 Bit array
403403
void sendRaw(const uint8_t aBufferWithTicks[], uint_fast8_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);

src/ir_Dish.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,5 @@ void IRsend::sendDISH(unsigned long data, int nbits) {
3838

3939
sendPulseDistanceWidthData(DISH_BIT_MARK, DISH_ONE_SPACE, DISH_BIT_MARK, DISH_ZERO_SPACE, data, nbits, PROTOCOL_IS_MSB_FIRST);
4040
mark(DISH_HEADER_MARK); //added 26th March 2016, by AnalysIR ( https://www.AnalysIR.com )
41-
ledOff(); // Always end with the LED off
4241
}
4342

src/ir_LG.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ void IRsend::sendLGRepeat() {
8181
mark(LG_HEADER_MARK);
8282
space(LG_REPEAT_HEADER_SPACE);
8383
mark(LG_BIT_MARK);
84-
ledOff(); // Always end with the LED off
8584
}
8685

8786
/*

src/private/IRFeedbackLEDDefs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@
7272
#define FEEDBACK_LED_ON() digitalWrite(LED_BUILTIN, LOW)
7373
#define FEEDBACK_LED_OFF() digitalWrite(LED_BUILTIN, HIGH)
7474

75-
#elif defined(ESP32)
7675
#else
7776
/*
78-
* Default case
77+
* Default case suitable for most boards
7978
*/
8079
#define FEEDBACK_LED_ON() digitalWrite(LED_BUILTIN, HIGH)
8180
#define FEEDBACK_LED_OFF() digitalWrite(LED_BUILTIN, LOW)

0 commit comments

Comments
 (0)