CrashOverride85 / collar

Arduino library to control dog shock collars
BSD 2-Clause "Simplified" License
16 stars 7 forks source link

[BUGFIX] move ISR to IRAM #8

Closed foertel closed 1 year ago

foertel commented 2 years ago

Fixes #7

CrashOverride85 commented 2 years ago

Thanks for this 🙂 I've tested it and it works well on an ESP32 (and I assume ESP8266), but it's no longer building for Arduino Uno / AVR as IRAM_ATTR is unknown ("error: ‘IRAM_ATTR’ does not name a type").

I think it could be fixed by adding something like this to collar.h, just after the #include "Arduino.h" line:

#ifndef ARDUINO_ARCH_ESP8266
  #define IRAM_ATTR
#endif

#ifndef ARDUINO_ARCH_ESP32
  #define IRAM_ATTR
#endif