wizard97 / ArduinoProcessScheduler

An Arduino object oriented process scheduler designed to replace them all
46 stars 16 forks source link

Support for ARM boards? #3

Closed jrowe88 closed 7 years ago

jrowe88 commented 7 years ago

Hi- nice library; what would it take to support a ARM chip such as the Teensy 3.2/3.6?

wizard97 commented 7 years ago

There are really only two things that don't make it compatible with ARM out of the box:

The first issue can be basically ignored if you are not going to modify processes from within ISR's. Just redefine the macros as nothing. Another solution is to use the built in Arduino.h noInterrupts() interrupts() . The problem with this solution is it ends up enabling interrupts if interrupts were disabled to begin with. To really do it properly you will need to find a replacement to save the interrupt status register and restore it afterwards.You can see how I do it for the AtMega and esp8266. It would be awesome if you could make these changes and submit a pull request, really should not be complicated.

The second issue is finding a replacement for the process timeout timer. Currently it uses the same timer as millis() for the ATMega. If you don't care about this feature, then there should be nothing to change.

Let me know, Aaron