Skip to content

Commit 7d30c2f

Browse files
committed
Merge pull request Arduino-IRremote#3 from z3t0/master
syncing with latest master
2 parents 711ebd7 + ebbefa8 commit 7d30c2f

File tree

13 files changed

+392
-28
lines changed

13 files changed

+392
-28
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.un~
2+
*.sublime-project
3+
*.sublime-workspace

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
- PLATFORMIO_CI_SRC=examples/IRtest PLATFORMIO_BUILD_FLAGS="-DSEND_NEC -DSEND_SONY -DSEND_RC5 -DSEND_RC6"
1414
- PLATFORMIO_CI_SRC=examples/IRtest2 PLATFORMIO_BUILD_FLAGS="-DSEND_NEC -DSEND_SONY -DSEND_RC5 -DSEND_RC6"
1515
- PLATFORMIO_CI_SRC=examples/JVCPanasonicSendDemo PLATFORMIO_BUILD_FLAGS="-DSEND_JVC -DSEND_PANASONIC"
16+
- PLATFORMIO_CI_SRC=examples/IRremoteInfo
1617

1718
install:
1819
- python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"

Contributing.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contribution Guidlines
2+
3+
This library is the culmination of the expertise of many members of the open source community who have dedicated their time and hard work. The best way to ask for help or propose a new idea is to [create a new issue](https://github.com/z3t0/Arduino-IRremote/issues/new) while creating a Pull Request with your code changes allows you to share your own innovations with the rest of the community.
4+
5+
The following are some guidelines to observe when creating issues or PRs:
6+
- Be friendly; it is important that we can all enjoy a safe space as we are all working on the same project and it is okay for people to have different ideas
7+
- [Use code blocks](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code); it helps us help you when we can read your code! On that note also refrain from pasting more than 30 lines of code in a post, instead [create a gist](https://gist.github.com/) if you need to share large snippets
8+
- Use reasonable titles; refrain from using overly long or capitalized titles as they are usually annoying and do little to encourage others to help :smile:
9+
- Be detailed; refrain from mentioning code problems without sharing your source code and always give information regarding your board and version of the library
10+
11+
If there is any need to contact me then you can find my email on the README, I do not mind responding to emails but it would be in your own interests to create issues if you need help with the library as responses would be from a larger community with greater knowledge!

Contributors.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ These are the active contributors of this project that you may contact if there
1212
- [Neco777](https://github.com/neco777) : Active contributor
1313
- [Lauszus](https://github.com/lauszus) : Active contributor
1414
- [csBlueChip](https://github.com/csbluechip) : Active contributor, who contributed major and vital changes to the code base.
15+
- [Sebazzz](https://github.com/sebazz): Contributor
16+
- [lumbric](https://github.com/lumbric): Contributor
17+
- [ElectricRCAircraftGuy](https://github.com/electricrcaircraftguy): Active Contributor
1518

1619
Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed.
1720

IRremote.cpp

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,54 +41,71 @@
4141
//
4242
int MATCH (int measured, int desired)
4343
{
44-
DBG_PRINT("Testing: ");
44+
DBG_PRINT(F("Testing: "));
4545
DBG_PRINT(TICKS_LOW(desired), DEC);
46-
DBG_PRINT(" <= ");
46+
DBG_PRINT(F(" <= "));
4747
DBG_PRINT(measured, DEC);
48-
DBG_PRINT(" <= ");
49-
DBG_PRINTLN(TICKS_HIGH(desired), DEC);
48+
DBG_PRINT(F(" <= "));
49+
DBG_PRINT(TICKS_HIGH(desired), DEC);
5050

51-
return ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired)));
51+
bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired)));
52+
if (passed)
53+
DBG_PRINTLN(F("?; passed"));
54+
else
55+
DBG_PRINTLN(F("?; FAILED"));
56+
return passed;
5257
}
5358

5459
//+========================================================
5560
// Due to sensor lag, when received, Marks tend to be 100us too long
5661
//
5762
int MATCH_MARK (int measured_ticks, int desired_us)
5863
{
59-
DBG_PRINT("Testing mark ");
64+
DBG_PRINT(F("Testing mark (actual vs desired): "));
6065
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
61-
DBG_PRINT(" vs ");
66+
DBG_PRINT(F("us vs "));
6267
DBG_PRINT(desired_us, DEC);
68+
DBG_PRINT("us");
6369
DBG_PRINT(": ");
64-
DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS), DEC);
65-
DBG_PRINT(" <= ");
66-
DBG_PRINT(measured_ticks, DEC);
67-
DBG_PRINT(" <= ");
68-
DBG_PRINTLN(TICKS_HIGH(desired_us + MARK_EXCESS), DEC);
70+
DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC);
71+
DBG_PRINT(F(" <= "));
72+
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
73+
DBG_PRINT(F(" <= "));
74+
DBG_PRINT(TICKS_HIGH(desired_us + MARK_EXCESS) * USECPERTICK, DEC);
6975

70-
return ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS))
71-
&& (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS)));
76+
bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS))
77+
&& (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS)));
78+
if (passed)
79+
DBG_PRINTLN(F("?; passed"));
80+
else
81+
DBG_PRINTLN(F("?; FAILED"));
82+
return passed;
7283
}
7384

7485
//+========================================================
7586
// Due to sensor lag, when received, Spaces tend to be 100us too short
7687
//
7788
int MATCH_SPACE (int measured_ticks, int desired_us)
7889
{
79-
DBG_PRINT("Testing space ");
90+
DBG_PRINT(F("Testing space (actual vs desired): "));
8091
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
81-
DBG_PRINT(" vs ");
92+
DBG_PRINT(F("us vs "));
8293
DBG_PRINT(desired_us, DEC);
94+
DBG_PRINT("us");
8395
DBG_PRINT(": ");
84-
DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS), DEC);
85-
DBG_PRINT(" <= ");
86-
DBG_PRINT(measured_ticks, DEC);
87-
DBG_PRINT(" <= ");
88-
DBG_PRINTLN(TICKS_HIGH(desired_us - MARK_EXCESS), DEC);
96+
DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC);
97+
DBG_PRINT(F(" <= "));
98+
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
99+
DBG_PRINT(F(" <= "));
100+
DBG_PRINT(TICKS_HIGH(desired_us - MARK_EXCESS) * USECPERTICK, DEC);
89101

90-
return ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS))
91-
&& (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS)));
102+
bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS))
103+
&& (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS)));
104+
if (passed)
105+
DBG_PRINTLN(F("?; passed"));
106+
else
107+
DBG_PRINTLN(F("?; FAILED"));
108+
return passed;
92109
}
93110

94111
//+=============================================================================

IRremote.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class IRsend
257257
void enableIROut (int khz) ;
258258
void mark (unsigned int usec) ;
259259
void space (unsigned int usec) ;
260-
void sendRaw (unsigned int buf[], unsigned int len, unsigned int hz) ;
260+
void sendRaw (const unsigned int buf[], unsigned int len, unsigned int hz) ;
261261

262262
//......................................................................
263263
# if SEND_RC5

ISSUE_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
**Board:** ARDUINO UNO
2+
**Library Version:** 2.1.0
3+
**Protocol:** Sony (if any)
4+
5+
**Code Block:**
6+
```c
7+
8+
#include <IRremote.h>
9+
10+
.....
11+
12+
```
13+
14+
Use [a gist](gist.github.com) if the code exceeds 30 lines
15+
16+
**checklist:**
17+
- [] The latest [release](https://github.com/z3t0/Arduino-IRremote/releases/latest) is used
18+
- [] Any code referenced is provided
19+
- [] The title of the issue is helpful and relevant
20+
21+
The above is a short template allowing you to make detailed issues!

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This library enables you to send and receive using infra-red signals on an Ardui
88

99
Check [here](http://z3t0.github.io/Arduino-IRremote/) for tutorials and more information.
1010

11-
## Version - 2.01
11+
## Version - 2.1.0
1212

1313
## Installation
1414
1. Navigate to the [Releases](https://github.com/z3t0/Arduino-IRremote/releases) page.
@@ -17,6 +17,33 @@ Check [here](http://z3t0.github.io/Arduino-IRremote/) for tutorials and more inf
1717
4. Move the "IRremote" folder that has been extracted to your libraries directory.
1818
5. Make sure to delete Arduino_Root/libraries/RobotIRremote. Where Arduino_Root refers to the install directory of Arduino. The library RobotIRremote has similar definitions to IRremote and causes errors.
1919

20+
## Supported Boards
21+
- Arduino Uno / Mega / Leonardo / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano etc.
22+
- Teensy 1.0 / 1.0++ / 2.0 / 2++ / 3.0 / 3.1 / Teensy-LC; Credits: @PaulStoffregen (Teensy Team)
23+
- Sanguino
24+
- Atmega8
25+
- ATtiny 84 / 85
26+
27+
We are open to suggestions for adding support to new boards, however we highly recommend you contact your supplier first and ask them to provide support from their side.
28+
29+
### Hardware specifications
30+
31+
| Board/CPU | Send Pin | Timers |
32+
|------------------------------------------|---------------------|-------------------|
33+
| Arduino Mega / ATmega 1280 / ATmega 2560 | 5, 6, **9**, 11, 46 | 1, **2**, 3, 4, 5 |
34+
| Teensy 1.0 | **17** | **1** |
35+
| Teensy 2.0 | 9, **10**, 14 | 1, 3, **4_HS** |
36+
| Teensy++ 1.0 / 2.0 | **1**, 16, 25 | 1, **2**, 3 |
37+
| Teensy 3.0 / 3.1 | **5** | **CMT** |
38+
| Teensy-LC | **16** | **TPM1** |
39+
| Sanguino | 13, **14** | 1, **2** |
40+
| Atmega8 | **9** | **1** |
41+
| ATtiny84 | **6** | **1** |
42+
| ATtiny85 | **1** | **TINY0** |
43+
| Arduino Duemilanove, UNO etc. | **3**, 9 | 1, **2** |
44+
45+
The table above lists the currently supported timers and corresponding send pins, many of these can have additional pins opened up and we are open to requests if a need arises for other pins.
46+
2047
## Usage
2148
- TODO (Check examples for now)
2249

@@ -27,7 +54,8 @@ If you want to contribute to this project:
2754
- Create issues and pull requests
2855
- Tell other people about this library
2956
- Contribute new protocols
30-
-
57+
58+
Check [here](Contributing.md) for some guidelines.
3159

3260
## Contact
3361
The only way to contact me at the moment is by email: [email protected]

0 commit comments

Comments
 (0)