Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DS1302 compile_time_to_system_time mbed
Fork of DS1302_HelloWorld by
You are viewing an older revision! See the latest version
Homepage
Initialize Clock To Compile Time¶
Initialize clock chip to compile time the first time the program runs after that it will read the time from the clock chip.
I find this an easy way to initialize my clock chip and then it stays set for as long as the battery lasts. I use a quick recompile then copy this utility to the mbed board where it sets the time and date. After than reload the mbed board with normal firmware and the clock remains set.
I use it for low volume testing.
Underlying library for parsing DATE and TIME is as follows:
call with the command printf("compile time=%s date=%s\r\n",TIME,DATE); time_t build_time = cvt_date(DATE,TIME); printf("compile time reformate=%s r\n", ctime(&build_time));