From e308165190b6911a2db3c24a114137d3e1349e9e Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sat, 22 Apr 2017 23:25:11 -0600 Subject: [PATCH] working on renaming files added test.sh --- .../AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino | 2 +- examples/IRrecord/IRrecord.ino | 2 +- examples/IRrecvDemo/IRrecvDemo.ino | 2 +- examples/IRrecvDump/IRrecvDump.ino | 2 +- examples/IRrecvDumpV2/IRrecvDumpV2.ino | 2 +- examples/IRrelay/IRrelay.ino | 2 +- examples/IRremoteInfo/IRremoteInfo.ino | 2 +- examples/IRsendDemo/IRsendDemo.ino | 2 +- examples/IRsendRawDemo/IRsendRawDemo.ino | 2 +- examples/IRtest/IRtest.ino | 2 +- examples/IRtest2/IRtest2.ino | 2 +- .../JVCPanasonicSendDemo.ino | 2 +- examples/LGACSendDemo/LGACSendDemo.ino | 2 +- .../LegoPowerFunctionsSendDemo.ino | 2 +- src/IRremote.cpp | 4 +- src/{IRremote.h => InfraredRemote.h} | 2 +- src/irPronto.cpp | 4 +- src/irRecv.cpp | 38 +++++++++---------- src/irSend.cpp | 4 +- src/ir_Aiwa.cpp | 4 +- src/ir_Denon.cpp | 4 +- src/ir_Dish.cpp | 4 +- src/ir_JVC.cpp | 4 +- src/ir_LG.cpp | 4 +- src/ir_Lego_PF.cpp | 4 +- src/ir_Mitsubishi.cpp | 4 +- src/ir_NEC.cpp | 4 +- src/ir_Panasonic.cpp | 4 +- src/ir_RC5_RC6.cpp | 4 +- src/ir_Samsung.cpp | 4 +- src/ir_Sanyo.cpp | 4 +- src/ir_Sharp.cpp | 4 +- src/ir_Sony.cpp | 4 +- src/ir_Template.cpp | 4 +- src/ir_Whynter.cpp | 4 +- .../InfraredRemoteInt.h} | 0 src/{ => lib}/boarddefs.h | 0 test.sh | 8 ++++ 38 files changed, 80 insertions(+), 72 deletions(-) rename src/{IRremote.h => InfraredRemote.h} (99%) rename src/{IRremoteInt.h => lib/InfraredRemoteInt.h} (100%) rename src/{ => lib}/boarddefs.h (100%) create mode 100644 test.sh diff --git a/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino b/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino index 5a9862b..34997d1 100644 --- a/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino +++ b/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino @@ -6,7 +6,7 @@ * http://arcfn.com */ -#include "IRremote.h" +#include #define POWER 0x7F80 #define AIWA_RC_T501 diff --git a/examples/IRrecord/IRrecord.ino b/examples/IRrecord/IRrecord.ino index 7fc5cfd..42e58e5 100644 --- a/examples/IRrecord/IRrecord.ino +++ b/examples/IRrecord/IRrecord.ino @@ -15,7 +15,7 @@ * http://arcfn.com */ -#include +#include int RECV_PIN = 11; int BUTTON_PIN = 12; diff --git a/examples/IRrecvDemo/IRrecvDemo.ino b/examples/IRrecvDemo/IRrecvDemo.ino index 3e2d280..941dc7b 100644 --- a/examples/IRrecvDemo/IRrecvDemo.ino +++ b/examples/IRrecvDemo/IRrecvDemo.ino @@ -6,7 +6,7 @@ * http://arcfn.com */ -#include +#include int RECV_PIN = 11; diff --git a/examples/IRrecvDump/IRrecvDump.ino b/examples/IRrecvDump/IRrecvDump.ino index fa25cd8..ffa7b25 100644 --- a/examples/IRrecvDump/IRrecvDump.ino +++ b/examples/IRrecvDump/IRrecvDump.ino @@ -8,7 +8,7 @@ * LG added by Darryl Smith (based on the JVC protocol) */ -#include +#include /* * Default is Arduino pin D11. diff --git a/examples/IRrecvDumpV2/IRrecvDumpV2.ino b/examples/IRrecvDumpV2/IRrecvDumpV2.ino index 7256127..1f64118 100644 --- a/examples/IRrecvDumpV2/IRrecvDumpV2.ino +++ b/examples/IRrecvDumpV2/IRrecvDumpV2.ino @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // Include the IRremote library header // -#include +#include //------------------------------------------------------------------------------ // Tell IRremote which Arduino pin is connected to the IR Receiver (TSOP4838) diff --git a/examples/IRrelay/IRrelay.ino b/examples/IRrelay/IRrelay.ino index 046fb5f..e42352b 100644 --- a/examples/IRrelay/IRrelay.ino +++ b/examples/IRrelay/IRrelay.ino @@ -6,7 +6,7 @@ * http://arcfn.com */ -#include +#include int RECV_PIN = 11; int RELAY_PIN = 4; diff --git a/examples/IRremoteInfo/IRremoteInfo.ino b/examples/IRremoteInfo/IRremoteInfo.ino index 2a269d9..7b340dd 100644 --- a/examples/IRremoteInfo/IRremoteInfo.ino +++ b/examples/IRremoteInfo/IRremoteInfo.ino @@ -11,7 +11,7 @@ */ -#include +#include void setup() { diff --git a/examples/IRsendDemo/IRsendDemo.ino b/examples/IRsendDemo/IRsendDemo.ino index 4f23af6..bc6fd98 100644 --- a/examples/IRsendDemo/IRsendDemo.ino +++ b/examples/IRsendDemo/IRsendDemo.ino @@ -7,7 +7,7 @@ */ -#include +#include IRsend irsend; diff --git a/examples/IRsendRawDemo/IRsendRawDemo.ino b/examples/IRsendRawDemo/IRsendRawDemo.ino index e83d6e6..75df27a 100644 --- a/examples/IRsendRawDemo/IRsendRawDemo.ino +++ b/examples/IRsendRawDemo/IRsendRawDemo.ino @@ -18,7 +18,7 @@ */ -#include +#include IRsend irsend; diff --git a/examples/IRtest/IRtest.ino b/examples/IRtest/IRtest.ino index 4845a4a..40d950b 100644 --- a/examples/IRtest/IRtest.ino +++ b/examples/IRtest/IRtest.ino @@ -9,7 +9,7 @@ * the arduino IDE. */ -#include +#include #include // Dumps out the decode_results structure. diff --git a/examples/IRtest2/IRtest2.ino b/examples/IRtest2/IRtest2.ino index 56b8a4d..2895d76 100644 --- a/examples/IRtest2/IRtest2.ino +++ b/examples/IRtest2/IRtest2.ino @@ -25,7 +25,7 @@ * http://arcfn.com */ -#include +#include int RECV_PIN = 11; int LED_PIN = 3; diff --git a/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino b/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino index 33c167c..e46cf10 100644 --- a/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino +++ b/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino @@ -6,7 +6,7 @@ * http://arcfn.com * JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post) */ -#include +#include #define PanasonicAddress 0x4004 // Panasonic address (Pre data) #define PanasonicPower 0x100BCBD // Panasonic Power button diff --git a/examples/LGACSendDemo/LGACSendDemo.ino b/examples/LGACSendDemo/LGACSendDemo.ino index da5db37..0c60785 100644 --- a/examples/LGACSendDemo/LGACSendDemo.ino +++ b/examples/LGACSendDemo/LGACSendDemo.ino @@ -1,4 +1,4 @@ -#include +#include #include diff --git a/examples/LegoPowerFunctionsSendDemo/LegoPowerFunctionsSendDemo.ino b/examples/LegoPowerFunctionsSendDemo/LegoPowerFunctionsSendDemo.ino index e43d06c..8db812d 100644 --- a/examples/LegoPowerFunctionsSendDemo/LegoPowerFunctionsSendDemo.ino +++ b/examples/LegoPowerFunctionsSendDemo/LegoPowerFunctionsSendDemo.ino @@ -3,7 +3,7 @@ * Copyright (c) 2016 Philipp Henkel */ -#include +#include #include IRsend irsend; diff --git a/src/IRremote.cpp b/src/IRremote.cpp index e811cfc..66bfcaa 100644 --- a/src/IRremote.cpp +++ b/src/IRremote.cpp @@ -20,8 +20,8 @@ // Defining IR_GLOBAL here allows us to declare the instantiation of global variables #define IR_GLOBAL -# include "IRremote.h" -# include "IRremoteInt.h" +# include "InfraredRemote.h" +# include "lib/InfraredRemoteInt.h" #undef IR_GLOBAL #ifndef IR_TIMER_USE_ESP32 diff --git a/src/IRremote.h b/src/InfraredRemote.h similarity index 99% rename from src/IRremote.h rename to src/InfraredRemote.h index fe1a870..825f0f5 100644 --- a/src/IRremote.h +++ b/src/InfraredRemote.h @@ -21,7 +21,7 @@ //------------------------------------------------------------------------------ // The ISR header contains several useful macros the user may wish to use // -#include "IRremoteInt.h" +#include "lib/InfraredRemoteInt.h" //------------------------------------------------------------------------------ // Supported IR protocols diff --git a/src/irPronto.cpp b/src/irPronto.cpp index 0f530a9..c4a18e2 100644 --- a/src/irPronto.cpp +++ b/src/irPronto.cpp @@ -17,7 +17,7 @@ void mark (int t) { printf("+%d," , t); } void space (int t) { printf("-%d, ", t); } #else -# include "IRremote.h" +# include "InfraredRemote.h" #endif // TEST //+============================================================================= @@ -238,7 +238,7 @@ int main ( ) #include #define IRPRONTO -#include "IRremoteInt.h" // The Arduino IRremote library defines USECPERTICK +#include "lib/InfraredRemoteInt.h" // The Arduino IRremote library defines USECPERTICK //------------------------------------------------------------------------------ // Source: https://www.google.co.uk/search?q=DENON+MASTER+IR+Hex+Command+Sheet diff --git a/src/irRecv.cpp b/src/irRecv.cpp index 12b0806..99043e4 100644 --- a/src/irRecv.cpp +++ b/src/irRecv.cpp @@ -1,10 +1,10 @@ -#include "IRremote.h" -#include "IRremoteInt.h" - -#ifdef IR_TIMER_USE_ESP32 -hw_timer_t *timer; -void IRTimer(); // defined in IRremote.cpp -#endif +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" + +#ifdef IR_TIMER_USE_ESP32 +hw_timer_t *timer; +void IRTimer(); // defined in IRremote.cpp +#endif //+============================================================================= // Decodes the received IR message @@ -122,17 +122,17 @@ IRrecv::IRrecv (int recvpin, int blinkpin) // void IRrecv::enableIRIn ( ) { -// Interrupt Service Routine - Fires every 50uS -#ifdef ESP32 - // ESP32 has a proper API to setup timers, no weird chip macros needed - // simply call the readable API versions :) - // 3 timers, choose #1, 80 divider nanosecond precision, 1 to count up - timer = timerBegin(1, 80, 1); - timerAttachInterrupt(timer, &IRTimer, 1); - // every 50ns, autoreload = true - timerAlarmWrite(timer, 50, true); - timerAlarmEnable(timer); -#else +// Interrupt Service Routine - Fires every 50uS +#ifdef ESP32 + // ESP32 has a proper API to setup timers, no weird chip macros needed + // simply call the readable API versions :) + // 3 timers, choose #1, 80 divider nanosecond precision, 1 to count up + timer = timerBegin(1, 80, 1); + timerAttachInterrupt(timer, &IRTimer, 1); + // every 50ns, autoreload = true + timerAlarmWrite(timer, 50, true); + timerAlarmEnable(timer); +#else cli(); // Setup pulse clock timer interrupt // Prescale /8 (16M/8 = 0.5 microseconds per tick) @@ -146,7 +146,7 @@ void IRrecv::enableIRIn ( ) TIMER_RESET; sei(); // enable interrupts -#endif +#endif // Initialize state machine variables irparams.rcvstate = STATE_IDLE; diff --git a/src/irSend.cpp b/src/irSend.cpp index c3ef3ff..77a0476 100644 --- a/src/irSend.cpp +++ b/src/irSend.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //+============================================================================= void IRsend::sendRaw (const unsigned int buf[], unsigned int len, unsigned int hz) diff --git a/src/ir_Aiwa.cpp b/src/ir_Aiwa.cpp index 50ec58d..129bd6d 100644 --- a/src/ir_Aiwa.cpp +++ b/src/ir_Aiwa.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // AAA IIIII W W AAA diff --git a/src/ir_Denon.cpp b/src/ir_Denon.cpp index c54e286..76c66fa 100644 --- a/src/ir_Denon.cpp +++ b/src/ir_Denon.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" // Reverse Engineered by looking at RAW dumps generated by IRremote diff --git a/src/ir_Dish.cpp b/src/ir_Dish.cpp index fa8e065..64069b2 100644 --- a/src/ir_Dish.cpp +++ b/src/ir_Dish.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // DDDD IIIII SSSS H H diff --git a/src/ir_JVC.cpp b/src/ir_JVC.cpp index eeec20f..a34f266 100644 --- a/src/ir_JVC.cpp +++ b/src/ir_JVC.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // JJJJJ V V CCCC diff --git a/src/ir_LG.cpp b/src/ir_LG.cpp index ba532cb..05baba3 100644 --- a/src/ir_LG.cpp +++ b/src/ir_LG.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // L GGGG diff --git a/src/ir_Lego_PF.cpp b/src/ir_Lego_PF.cpp index 37d507c..2cbf92e 100644 --- a/src/ir_Lego_PF.cpp +++ b/src/ir_Lego_PF.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" #include "ir_Lego_PF_BitStreamEncoder.h" //============================================================================== diff --git a/src/ir_Mitsubishi.cpp b/src/ir_Mitsubishi.cpp index 7f83e53..58932fb 100644 --- a/src/ir_Mitsubishi.cpp +++ b/src/ir_Mitsubishi.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // MMMMM IIIII TTTTT SSSS U U BBBB IIIII SSSS H H IIIII diff --git a/src/ir_NEC.cpp b/src/ir_NEC.cpp index 3b49321..ec3152c 100644 --- a/src/ir_NEC.cpp +++ b/src/ir_NEC.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // N N EEEEE CCCC diff --git a/src/ir_Panasonic.cpp b/src/ir_Panasonic.cpp index dc0dd73..161f075 100644 --- a/src/ir_Panasonic.cpp +++ b/src/ir_Panasonic.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // PPPP AAA N N AAA SSSS OOO N N IIIII CCCC diff --git a/src/ir_RC5_RC6.cpp b/src/ir_RC5_RC6.cpp index 10e7927..8530f85 100644 --- a/src/ir_RC5_RC6.cpp +++ b/src/ir_RC5_RC6.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //+============================================================================= // Gets one undecoded level at a time from the raw buffer. diff --git a/src/ir_Samsung.cpp b/src/ir_Samsung.cpp index 224487d..408c7c7 100644 --- a/src/ir_Samsung.cpp +++ b/src/ir_Samsung.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // SSSS AAA MMM SSSS U U N N GGGG diff --git a/src/ir_Sanyo.cpp b/src/ir_Sanyo.cpp index c775d61..0ffaf29 100644 --- a/src/ir_Sanyo.cpp +++ b/src/ir_Sanyo.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // SSSS AAA N N Y Y OOO diff --git a/src/ir_Sharp.cpp b/src/ir_Sharp.cpp index 73462c5..878a11f 100644 --- a/src/ir_Sharp.cpp +++ b/src/ir_Sharp.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // SSSS H H AAA RRRR PPPP diff --git a/src/ir_Sony.cpp b/src/ir_Sony.cpp index 31e67cf..9facb3d 100644 --- a/src/ir_Sony.cpp +++ b/src/ir_Sony.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // SSSS OOO N N Y Y diff --git a/src/ir_Template.cpp b/src/ir_Template.cpp index eee2b0b..b6cbe68 100644 --- a/src/ir_Template.cpp +++ b/src/ir_Template.cpp @@ -91,8 +91,8 @@ Regards, BlueChip */ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // diff --git a/src/ir_Whynter.cpp b/src/ir_Whynter.cpp index a830562..71efa6e 100644 --- a/src/ir_Whynter.cpp +++ b/src/ir_Whynter.cpp @@ -1,5 +1,5 @@ -#include "IRremote.h" -#include "IRremoteInt.h" +#include "InfraredRemote.h" +#include "lib/InfraredRemoteInt.h" //============================================================================== // W W H H Y Y N N TTTTT EEEEE RRRRR diff --git a/src/IRremoteInt.h b/src/lib/InfraredRemoteInt.h similarity index 100% rename from src/IRremoteInt.h rename to src/lib/InfraredRemoteInt.h diff --git a/src/boarddefs.h b/src/lib/boarddefs.h similarity index 100% rename from src/boarddefs.h rename to src/lib/boarddefs.h diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..8628097 --- /dev/null +++ b/test.sh @@ -0,0 +1,8 @@ +PLATFORMIO_CI_SRC=examples/AiwaRCT501SendDemo python2 -m platformio ci --lib="." --board=uno +PLATFORMIO_CI_SRC=examples/IRrecord python2 -m platformio ci --lib="." --board=uno +PLATFORMIO_CI_SRC=examples/IRrecvDemo python2 -m platformio ci --lib="." --board=uno +PLATFORMIO_CI_SRC=examples/IRrecvDumpV2 python2 -m platformio ci --lib="." --board=uno +PLATFORMIO_CI_SRC=examples/IRrelay python2 -m platformio ci --lib="." --board=uno +PLATFORMIO_CI_SRC=examples/IRremoteInfo python2 -m platformio ci --lib="." --board=uno +PLATFORMIO_CI_SRC=examples/IRsendDemo python2 -m platformio ci --lib="." --board=uno +PLATFORMIO_CI_SRC=examples/IRsendRawDemo python2 -m platformio ci --lib="." --board=uno