Hello,
I am looking for a way to include a timestamp in the code that I compile. I want to assign an address in flash of say 4 bytes and put the date and time of compile into it automatically.(perhaps UTC time or some other format). This way when I am looking at the firmware on a chip later I can determine when the code was compiled that is currently loaded.
Thank you for your help.
PS, I am programming a 9s08SH32 part if that makes any difference.
There are predefined standard C string constants __DATE__ and __TIME__. Usage is like
const char date[] = __DATE__;
Unfortunately you can't change format of these or encode them to long int or other more compact form.