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 !
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 !