Skip to content

Commit 1d8112e

Browse files
committed
Renamed USE_SOFT_CARRIER and USE_NO_CARRIER macros to USE_SOFT_SEND_PWM and USE_NO_SEND_PWM.
1 parent e535db8 commit 1d8112e

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The timer and the pin usage can be adjusted in [IRremoteBoardDefs.h](src/private
5757
| Board/CPU | IR-Receive Pin | Timers |
5858
|--------------------------------------------------------------------------|---------------------|-------------------|
5959
| [ATtiny84](https://github.com/SpenceKonde/ATTinyCore) | **6** | **1** |
60-
| [ATtiny85](https://github.com/SpenceKonde/ATTinyCore) | **1** | **TINY0** |
60+
| [ATtiny85](https://github.com/SpenceKonde/ATTinyCore) | **1** | **0** |
6161
| [ATmega8](https://github.com/MCUdude/MiniCore) | **9** | **1** |
6262
| [ATmega48, ATmega88, ATmega168, ATmega328](https://github.com/MCUdude/MiniCore) | **3**, 9 | 1, **2** |
6363
| [ATmega1284](https://github.com/MCUdude/MightyCore) | 13, 14, 6 | 1, **2**, 3 |
@@ -68,6 +68,7 @@ The timer and the pin usage can be adjusted in [IRremoteBoardDefs.h](src/private
6868
| ATmega1280, ATmega2560 | 5, 6, **9**, 11, 46 | 1, **2**, 3, 4, 5 |
6969
| ATmega4809 | 5, 6, **9**, 11, 46 | **TCB0** |
7070
| Leonardo (Atmega32u4) | 5, **9**, 13 | 1, 3, **4_HS** |
71+
| Zero (SAMD) | \*, **9** | **TC3** |
7172
| [ESP32](http://esp32.net/) | **4**, all pins | **1** |
7273
| [Sparkfun Pro Micro](https://www.sparkfun.com/products/12640) | **5**, 9, 13 | 1, **3**, 4_HS |
7374
| [Teensy 1.0](https://www.pjrc.com/teensy/) | **17** | **1** |

src/IRremote.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class IRrecv {
339339
*/
340340
class IRsend {
341341
public:
342-
#if defined(USE_SOFT_CARRIER) || defined(USE_NO_CARRIER)
342+
#if defined(USE_SOFT_SEND_PWM) || defined(USE_NO_SEND_PWM)
343343
IRsend(int pin = IR_SEND_PIN) {
344344
sendPin = pin;
345345
}
@@ -470,11 +470,11 @@ class IRsend {
470470
void sendPronto(const __FlashStringHelper *str, unsigned int times = 1U);
471471
#endif
472472

473-
#if defined(USE_SOFT_CARRIER) || defined(USE_NO_CARRIER)
473+
#if defined(USE_SOFT_SEND_PWM) || defined(USE_NO_SEND_PWM)
474474
private:
475475
int sendPin;
476476

477-
# if defined(USE_SOFT_CARRIER)
477+
# if defined(USE_SOFT_SEND_PWM)
478478
unsigned int periodTime;
479479
unsigned int periodOnTime;
480480

src/irSend.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void IRsend::sendRaw_P(const unsigned int buf[], unsigned int len, unsigned int
3737

3838
}
3939

40-
#ifdef USE_SOFT_CARRIER
40+
#ifdef USE_SOFT_SEND_PWM
4141
void inline IRsend::sleepMicros(unsigned long us) {
4242
#ifdef USE_SPIN_WAIT
4343
sleepUntilMicros(micros() + us);
@@ -59,15 +59,15 @@ void inline IRsend::sleepUntilMicros(unsigned long targetTime) {
5959
}
6060
#endif
6161
}
62-
#endif // USE_SOFT_CARRIER
62+
#endif // USE_SOFT_SEND_PWM
6363

6464
//+=============================================================================
6565
// Sends an IR mark for the specified number of microseconds.
6666
// The mark output is modulated at the PWM frequency.
6767
//
6868

6969
void IRsend::mark(unsigned int time) {
70-
#ifdef USE_SOFT_CARRIER
70+
#ifdef USE_SOFT_SEND_PWM
7171
unsigned long start = micros();
7272
unsigned long stop = start + time;
7373
if (stop + periodTime < start) {
@@ -85,7 +85,7 @@ void IRsend::mark(unsigned int time) {
8585
sleepUntilMicros(nextPeriodEnding);
8686
now = micros();
8787
}
88-
#elif defined(USE_NO_CARRIER)
88+
#elif defined(USE_NO_SEND_PWM)
8989
digitalWrite(sendPin, LOW); // Set output to active low.
9090
#else
9191
TIMER_ENABLE_SEND_PWM; // Enable pin 3 PWM output
@@ -101,7 +101,7 @@ void IRsend::mark(unsigned int time) {
101101
// A space is no output, so the PWM output is disabled.
102102
//
103103
void IRsend::space(unsigned int time) {
104-
#if defined(USE_NO_CARRIER)
104+
#if defined(USE_NO_SEND_PWM)
105105
digitalWrite(sendPin, HIGH); // Set output to inactive high.
106106
#else
107107
TIMER_DISABLE_SEND_PWM; // Disable pin 3 PWM output
@@ -125,12 +125,12 @@ void IRsend::space(unsigned int time) {
125125
// See my Secrets of Arduino PWM at http://arcfn.com/2009/07/secrets-of-arduino-pwm.html for details.
126126
//
127127
void IRsend::enableIROut(int khz) {
128-
#ifdef USE_SOFT_CARRIER
128+
#ifdef USE_SOFT_SEND_PWM
129129
periodTime = (1000U + khz / 2) / khz; // = 1000/khz + 1/2 = round(1000.0/khz)
130130
periodOnTime = periodTime * DUTY_CYCLE / 100U - PULSE_CORRECTION;
131131
#endif
132132

133-
#if defined(USE_NO_CARRIER)
133+
#if defined(USE_NO_SEND_PWM)
134134
pinMode(sendPin, OUTPUT);
135135
digitalWrite(sendPin, HIGH); // Set output to inactive high.
136136
#else

src/private/IRremoteBoardDefs.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#endif
5353

5454
/**
55-
* If USE_SOFT_CARRIER or USE_NO_CARRIER, this amount (in micro seconds) is subtracted from the
55+
* If USE_SOFT_SEND_PWM or USE_NO_SEND_PWM, this amount (in micro seconds) is subtracted from the
5656
* on-time of the pulses.
5757
*/
5858
#define PULSE_CORRECTION 3
@@ -82,15 +82,15 @@
8282
/**
8383
* Define to use no carrier PWM, just simulate a receiver signal.
8484
*/
85-
#define USE_NO_CARRIER
85+
#define USE_NO_SEND_PWM
8686

8787
/**
88-
* Define to use carrier generation in software, instead of hardware PWM.
88+
* Define to use carrier PWM generation in software, instead of hardware PWM.
8989
*/
90-
#define USE_SOFT_CARRIER
90+
#define USE_SOFT_SEND_PWM
9191

9292
/**
93-
* Define to use spin wait instead of delayMicros() for USE_SOFT_CARRIER.
93+
* Define to use spin wait instead of delayMicros() for USE_SOFT_SEND_PWM.
9494
*/
9595
#define USE_SPIN_WAIT
9696

@@ -131,7 +131,7 @@
131131
#define BLINKLED_ON() (digitalWrite(LED_BUILTIN, HIGH))
132132
#define BLINKLED_OFF() (digitalWrite(LED_BUILTIN, LOW))
133133

134-
#define USE_SOFT_CARRIER
134+
#define USE_SOFT_SEND_PWM
135135
// Define to use spin wait instead of delayMicros()
136136
//#define USE_SPIN_WAIT
137137
// Supply own enableIRIn()

0 commit comments

Comments
 (0)