On Sun, Oct 26, 2003 at 02:50:07AM -0400, Garst R. Reese wrote: > Hi folks, > I have a battery backed DS1305E RTC on a board. What I would like to do > is store my linux date in ROM when I flash the msp430F149 or similar, > and then immediately read the date value from ROM and initialize the > RTC. This is an interim solution until i get an IrDA port working. A few > seconds off would not be a problem. > > Any ideas? > > Thanks, > Garst
Hi Garst, You can put a rule in Makefile that creates a .h file with only one line and use the defines. You will have to compile the program everytime, but as a workaround it may work well. In the makefile, the code will be something like this: echo -n '#define NOW_YEAR ' > now.h date '+%Y' >> now.h echo -n '#define NOW_MONTH ' >> now.h date '+%m' >> now.h ... Then in the C program you can include "now.h" and use the defines. Good Luck, Pedro