set_time(1); What an idiot am I ?!

01 Apr 2011

I have just spent an hour debugging code around my RTC.

It was beautiful, it read from a file, set the clock, deleted the file, and then created timestamps at will from the clock.

The only problem.. my small "test" program worked, but the code didn't work when I grafted the pertinent bits into my real project.

an hour later and I find..

set_time(1);

buried in my real project, in a method where I certainly wouldn't have expected it. What does it do? Initialise the clock to 1970.

Anyway.. I only posted this so everyone could have a good smile. We've all been there and done it, but an HOUR.. man alive.. that hurts... time for me to get a cup of tea I think !

02 Apr 2011

Congratulations on the find... May feel stupid but honestly it's something we all do at some time or another... At least while doing back-up operations you did not overwrite your current files with work that was 7 days old like I did once... I cannot begin to tell you the sinking feeling in my stomach the second I pressed "Yes" to overwrite the files... I dragged them from the old window to the new one... (BTW: This was nt related to the mbed, it was another project)