Cleaned up ESP32 integration, reverted ESP32 ifdefs on irreceive examples.

- fixed indenting on existing code in a few places for consistency
- introduced IR_TIMER_USE_ESP32 for ifdefs within the code as per
  request
- added comments explaining what's missing for irsend support on ESP32
- IRrecvDemo.ino gets a warning before and after interrupt is enabled in
  case it causes a crash

TESTED=IoTuz ESP32 board and original 328p arduino to make sure current
code did not break.
This commit is contained in:
Marc MERLIN
2017-03-31 21:52:52 -07:00
parent 1b56da6cc7
commit eae9de4307
7 changed files with 42 additions and 29 deletions

View File

@@ -124,6 +124,8 @@ 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);