Closed kevinpt closed 6 years ago
Thanks. Will look into this after the holidays.
Hi, I am a little concerned about this part:
# if !(defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32))
# error Missing ARDUINO_ARCH_* definition.
# endif
Will it nor break other platforms, like teensy or other non-AVR ones which supply their own Arduino.h? I have never implemented this for bare-bones, so help is appreciated.
I am thinking further: wouldn't a simpler and safer (from the compatibility perspective) way be to include a small local Arduino.h include with your changes for the bare-metal implementations? This way there is no need to change the library at all. (I am just trying to avoid platform-specific limitations as much as I can). What do you think?
Upon further thinking I went with a explicit brute force approach:
#ifdef _TASK_BARE_METAL
extern unsigned long micros(void);
extern unsigned long millis(void);
extern void yield(void);
extern void delay(unsigned long);
#endif
All sketches seem to compile fine. Will push this into the testing branch. Could you please test once it is there?
Thanks
Updated in the testing branch. Please test.
As a matter of fact I don't think TaskScheduler uses yield()
or delay()
. I can just go with those:
#ifdef _TASK_BARE_METAL
extern unsigned long micros(void);
extern unsigned long millis(void);
#endif
Will give you a little more time to test if you wish, otherwise will close this request.
I believe the plain ARDUINO define is also used if you want a platform independent check for the Arduino environment.
Pushed v2.6.0 into the "testing" branch with bare metal fwd definitions. Could you please test? https://github.com/arkhipenko/TaskScheduler/tree/testing
I've added some changes to support using TaskScheduler on bare-metal AVR without the Arduino support libraries. Additional minor work is needed to do the same for ESP8266 and ESP32.