luni64 / TeensyTimerTool

Generic Interface to Teensy Timers
MIT License
82 stars 18 forks source link

Including both TeensyTimerTool and TimeLib.h #8

Closed puregame closed 3 years ago

puregame commented 3 years ago

I'm playing around with a T4.1 and I want to use the TeensyTimerTool in a project that also will be using the RTC functionality.

I've narrowed down an issue to when both and "TeensyTimerTool.h" are both #included in the project. I tested this with an empty project and get compile issues. Any help on how to get past these compile issues would be great. I can't find anything similar on google.

image

luni64 commented 3 years ago

Looks like TimeLib.h messes up std::chrono, the standard time facility of c++ 11. If you replace #include "TeensyTimerTool.h" by #include <chrono>, you'll get the same issue. This of course is a pity, but I can't do much about it.

Two workarounds:

puregame commented 3 years ago

That worked, I had tried removing Time.h from the folder but that alone did not work. I also renamed Time.cpp to TimeLib.cpp. All code still compiles and works as intended.

Thank you!

MaffooClock commented 3 years ago

Confirmed: in the Time library, delete Time.h and rename Time.cpp to TimeLib.cpp