-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hi Luni, IntervalTimerEx in the EncSim library needs changes for compatibility with your latest update to IntervalTimer in Teensy cores. I don't know if you want to keep support for USE_CPP11_CALLBACKS, but I assumed you did, and I modified my own copy of EncSim to support TEENSYDUINO >= 159, your existing USE_CPP11_CALLBACKS, and and the original callback_t = void ()(void);
The changes are pretty simple. In IntervalTimerEx.h, I added a definition of your latest callback_t for TEENSYDUINO >= 159, and then elsewhere in the H and CPP files, conditionals based on USE_CPP11_CALLBACKS were changed to ((TEENSYDUINO >= 159) || defined(USE_CPP11_CALLBACKS)). There was one place where you used an explicit callback type, and I changed that to callback_t.
Here is the modified conditional logic from the top of the H file, with the #include and callback_t copied from cores\Teensy4\IntervalTimer.h in TD 1.59b6.:
#if (TEENSYDUINO >= 159)
#include "inplace_function.h"
using callback_t = teensy::inplace_function<void(void), 16>;
using relay_t = void (*)();
#elif defined(USE_CPP11_CALLBACKS)
#include
using callback_t = std::function<void()>;
using relay_t = void (*)();
#else
using callback_t = void ()(void);
using relay_t = void (*)();
#endif