From 55c08a7d351bf94d922984ba8679e37b2aa7eae2 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 --- .../AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino | 2 +- examples/IRrecvDemo/IRrecvDemo.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 | 1 + 26 files changed, 61 insertions(+), 60 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..b53ba67 100644 --- a/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino +++ b/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino @@ -6,7 +6,7 @@ * http://arcfn.com */ -#include "IRremote.h" +#include "InfraredRemote.h" #define POWER 0x7F80 #define AIWA_RC_T501 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/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..e7fa215 --- /dev/null +++ b/test.sh @@ -0,0 +1 @@ +PLATFORMIO_CI_SRC=examples/IRrecvDemo python2 -m platformio ci --lib="." --board=uno