Hi Rande
I don't know the PE generated code but I expect that you can simply add a check of the validity of the timer and abort any initialistion (which should only be done when it is has not yet been configured)
if ((RTC_SR & RTC_SR_TIF) != 0) {
return; // RTC is alread operating so ignore
}
Note however that you will still need to ensure that the clock gate is enabled to the RTC after each reset (and to be able to check its validity) so the code will in fact look more like (similar to the uTasker time management solution):
POWER_UP(6, SIM_SCGC6_RTC);
if ((RTC_SR & RTC_SR_TIF) != 0) {
return; // RTC is alread operating so ignore
}
// Continue with the configuration...
Regards
Mark
Kinetis: µTasker Kinetis support
K22: µTasker Kinetis FRDM-K22F support / µTasker Kinetis TWR-K22F120M support
Time Management: http://www.utasker.com/docs/uTasker/uTasker_Time.pdf
For the complete "out-of-the-box" Kinetis experience and faster time to market