Derek Fritz

Using __DATE__ and __TIME__ macros with XS12

Discussion created by Derek Fritz on Jun 23, 2010
Latest reply on Jun 24, 2010 by pgo

I'm trying to read the current date and time of my MC9S12XS128 code compilation into an array to send out over Modbus, and the data I'm getting back appears to be garbage.

 

Here is the code that I'm using:

 

  const char date_check[14] = {__DATE__ "\0 "};

  const char time_check[10] = {__TIME__ "\0" };

 

And this is the data that I get back:

 

date_check array:

0    0   

1    0

2    15

3    -31

4    0

5    0

6    0

7    0

8    -113

9    16

10    0

11    0

12    -48

13    0

 

time_check array:

0    0   

1    0

2    15

3    -31

4    0

5    0

6    0

7    0

8    -113

9    16

 

Any idea on what the problem may be?  Thanks in advance.

Outcomes