sui77 / rc-switch

Arduino lib to operate 433/315Mhz devices like power outlet sockets.
1.9k stars 658 forks source link

Regular crashes on ESP32 #395

Open DriekdeGadgetfreak opened 3 years ago

DriekdeGadgetfreak commented 3 years ago

Cannot call a std library function in an ISR.

/ helper function for the receiveProtocol method / static inline unsigned int diff(int A, int B) { return abs(A - B); }

should be changed to:

/ helper function for the receiveProtocol method / static inline unsigned int diff(int A, int B) { return (A > B) ? (A - B) : (B - A); }

Now it runs flawless on the ESP32.

1technophile commented 3 years ago

Could you submit a PR please from the last commit ?

DriekdeGadgetfreak commented 3 years ago

I will look into it. It is the first time for me, so please be patient.