Jantje, if those undocumented automatically generated prefs aren't already frustrating enough.... I'm going to add one more in my next update. I know this stuff creates even more work for you on your plugin. Hopefully a little advance notice from me at least helps a little?
In Arduino 1.0.6, I had this in my boards.txt:
Code:
teensy31.build.time_t=true
This triggers some code I added in the IDE which defines a TIME_T variable with the time the compiler was actually run. My startup code uses it to automatically initialize the RTC. Here's the actual code:
https://github.com/PaulStoffregen/cores/blob/master/teensy3/mk20dx128.c#L698
The idea is to make the RTC "just work". When someone adds the 32 kHz crystal to a Teensy 3.1, it gets automatically set to the time when they last uploaded code. The idea is for the RTC to automatically come up with the correct time.
Even this isn't quite right, because it doesn't detect the difference between a cold boot and reboot due to reprogramming. The time tends to be off by minutes or even hours, since it gets set to the time they last compiled code, which as before they turned off the power to solder on the crystal. That's on my long-term, low-priority list of stuff to improve someday, to detect prior unconfigured RTC after a warm reboot.
Arduino 1.6.0 has more compile speedup, to avoid rebuilding core.a. That's a really nice feature. So for 1.6.0, I'm going to change how I do this stuff. Instead of passing it as a -DTIME_T=#### when compiling code, and a hack to always recompile mk20dx128.c, for 1.6.0 I'm going to pass it as an extra parameter to the linker. That will allow core.a to remain untouched, so the recompile is faster.
But it does mean my next change to platform.txt is going to add something like --defsym=RTC_TIME_T={$build.time_t} into the linker flags. Of course this is totally non-standard, and adding on top of a big pile of already-undocumented features. I can totally understand if you don't want to support this with your plugin. Hopefully at least this explanation helps?