Skip to content

Commit

Permalink
Split the library into smaller separate files similar to upstream. (#196
Browse files Browse the repository at this point in the history
)

- Enable #define flags to enable/disable protocols as needed.
- No material changes to program flow etc were made.
- Tonnes & tonnes of modifications to support the new structure.
- Loads of comments added/changed.
- Changes to #include order, and correct mistaken usage of #include <> vs.
  #include "" per c++ library writting guides.
- Move directories and location to make it work with both Platformio and
  the Arduino IDE.
- Update platform.ini files for new dir structure.
- Update Travis for new path.
  • Loading branch information
crankyoldgit committed May 7, 2017
1 parent 178b09d commit 2b96fc7
Show file tree
Hide file tree
Showing 64 changed files with 5,049 additions and 4,546 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -12,7 +12,7 @@ before_install:
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
- wget https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py
install:
- ln -s $PWD/lib/IRremoteESP8266 /usr/local/share/arduino/libraries/
- ln -s $PWD /usr/local/share/arduino/libraries/
- arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs
- arduino --install-boards esp8266:esp8266
- arduino --board $BD --save-prefs
Expand Down
2 changes: 1 addition & 1 deletion CPPLINT.cfg
@@ -1,3 +1,3 @@
set noparent
root=lib/IRremoteESP8266
root=src
linelength=80
2 changes: 1 addition & 1 deletion examples/IRGCSendDemo/IRGCSendDemo.ino
Expand Up @@ -10,7 +10,7 @@
* http://arcfn.com
*/

#include <IRremoteESP8266.h>
#include <IRsend.h>

// Codes are in Global Cache format less the emitter ID and request ID.
// These codes can be found in GC's Control Tower database.
Expand Down
3 changes: 1 addition & 2 deletions examples/IRGCSendDemo/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
4 changes: 1 addition & 3 deletions examples/IRGCTCPServer/IRGCTCPServer.ino
Expand Up @@ -7,10 +7,8 @@
* Example command - Samsung TV power toggle: 38000,1,1,170,170,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,63,20,63,20,63,20,63,20,63,20,63,20,1798\r\n
*/

#include <IRremoteESP8266.h>
#include <IRremoteInt.h>

#include <ESP8266WiFi.h>
#include <IRsend.h>
#include <WiFiClient.h>
#include <WiFiServer.h>

Expand Down
3 changes: 1 addition & 2 deletions examples/IRGCTCPServer/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
4 changes: 2 additions & 2 deletions examples/IRServer/IRServer.ino
Expand Up @@ -6,10 +6,10 @@
*/

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>
#include <WiFiClient.h>

const char* ssid = ".....";
const char* password = ".....";
Expand Down
3 changes: 1 addition & 2 deletions examples/IRServer/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
2 changes: 1 addition & 1 deletion examples/IRrecvDemo/IRrecvDemo.ino
Expand Up @@ -7,7 +7,7 @@
* Copyright 2009 Ken Shirriff, http://arcfn.com
*/

#include <IRremoteESP8266.h>
#include <IRrecv.h>

// an IR detector/demodulator is connected to GPIO pin 2
uint16_t RECV_PIN = 2;
Expand Down
3 changes: 1 addition & 2 deletions examples/IRrecvDemo/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
2 changes: 1 addition & 1 deletion examples/IRrecvDump/IRrecvDump.ino
Expand Up @@ -9,7 +9,7 @@
* LG added by Darryl Smith (based on the JVC protocol)
*/

#include <IRremoteESP8266.h>
#include <IRrecv.h>

// an IR detector/demodulator is connected to GPIO pin 2
uint16_t RECV_PIN = 2;
Expand Down
3 changes: 1 addition & 2 deletions examples/IRrecvDump/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
2 changes: 1 addition & 1 deletion examples/IRrecvDumpV2/IRrecvDumpV2.ino
Expand Up @@ -10,7 +10,7 @@
* Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, Copyright 2009 Ken Shirriff, http://arcfn.com
*/

#include <IRremoteESP8266.h>
#include <IRrecv.h>

// An IR detector/demodulator is connected to GPIO pin 14(D5 on a NodeMCU
// board).
Expand Down
3 changes: 1 addition & 2 deletions examples/IRrecvDumpV2/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
2 changes: 1 addition & 1 deletion examples/IRsendDemo/IRsendDemo.ino
Expand Up @@ -27,7 +27,7 @@
* for your first time. e.g. ESP-12 etc.
*/

#include <IRremoteESP8266.h>
#include <IRsend.h>

IRsend irsend(4); // an IR led is connected to GPIO pin 4 (D2)

Expand Down
3 changes: 1 addition & 2 deletions examples/IRsendDemo/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
2 changes: 1 addition & 1 deletion examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino
Expand Up @@ -5,7 +5,7 @@
* Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, Copyright 2009 Ken Shirriff, http://arcfn.com
* JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
*/
#include <IRremoteESP8266.h>
#include <IRsend.h>

#define PanasonicAddress 0x4004 // Panasonic address (Pre data)
#define PanasonicPower 0x100BCBD // Panasonic Power button
Expand Down
3 changes: 1 addition & 2 deletions examples/JVCPanasonicSendDemo/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
5 changes: 3 additions & 2 deletions examples/TurnOnDaikinAC/TurnOnDaikinAC.ino
@@ -1,5 +1,6 @@
/* Copyright 2016 sillyfrog */
#include <IRDaikinESP.h>
#include <IRsend.h>
#include <ir_Daikin.h>

IRDaikinESP dakinir(D1);

Expand All @@ -12,7 +13,7 @@ void setup() {
void loop() {
Serial.println("Sending...");

// Set up what we want to send. See IRDaikinESP.cpp for all the options.
// Set up what we want to send. See ir_Daikin.cpp for all the options.
dakinir.on();
dakinir.setFan(1);
dakinir.setMode(DAIKIN_COOL);
Expand Down
3 changes: 1 addition & 2 deletions examples/TurnOnDaikinAC/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
5 changes: 3 additions & 2 deletions examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino
@@ -1,5 +1,6 @@
/* Copyright 2016 David Conran */
#include <IRKelvinator.h>
#include <IRsend.h>
#include <ir_Kelvinator.h>

IRKelvinatorAC kelvir(D1); // IR led controlled by Pin D1.

Expand Down Expand Up @@ -27,7 +28,7 @@ void setup() {
Serial.begin(115200);
delay(200);

// Set up what we want to send. See IRKelvinator.cpp for all the options.
// Set up what we want to send. See ir_Kelvinator.cpp for all the options.
// Most things default to off.
Serial.println("Default state of the remote.");
printState();
Expand Down
2 changes: 1 addition & 1 deletion examples/TurnOnKelvinatorAC/platformio.ini
@@ -1,5 +1,5 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.

[common]
Expand Down
6 changes: 3 additions & 3 deletions examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino
@@ -1,6 +1,6 @@
/* Copyright 2017 David Conran */

#include <IRMitsubishiAC.h>
#include <IRsend.h>
#include <ir_Mitsubishi.h>

IRMitsubishiAC mitsubir(D1); // IR led controlled by Pin D1.

Expand All @@ -24,7 +24,7 @@ void setup() {
Serial.begin(115200);
delay(200);

// Set up what we want to send. See IRMitsubishiAC.cpp for all the options.
// Set up what we want to send. See ir_Mitsubishi.cpp for all the options.
Serial.println("Default state of the remote.");
printState();
Serial.println("Setting desired state for A/C.");
Expand Down
3 changes: 1 addition & 2 deletions examples/TurnOnMitsubishiAC/platformio.ini
@@ -1,7 +1,6 @@
[platformio]
lib_extra_dirs = ../../lib/
lib_extra_dirs = ../../
src_dir=.
;lib_dir=~/Arduino/libraries

[common]
build_flags =
Expand Down
136 changes: 0 additions & 136 deletions lib/IRremoteESP8266/IRDaikinESP.cpp

This file was deleted.

0 comments on commit 2b96fc7

Please sign in to comment.