[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Re: __DATE__ constant, any way to format it differently ?
From: |
Heike C. Zimmerer |
Subject: |
[avr-gcc-list] Re: __DATE__ constant, any way to format it differently ? |
Date: |
Thu, 29 Jan 2009 10:56:47 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
"Anton James Erasmus" <address@hidden> writes:
> You can use the following MACROS and functions to get the
> values in integer format. You can then display the date and
> time in whatever format you desire.
>
> #define COMPILE_HOUR (((__TIME__[0]-'0')*10) +
> (__TIME__[1]-'0'))
> #define COMPILE_MINUTE (((__TIME__[3]-'0')*10) +
> (__TIME__[4]-'0'))
> #define COMPILE_SECOND (((__TIME__[6]-'0')*10) +
> (__TIME__[7]-'0'))
is __TIME__ guaranteed not to change between invocations? Else you may
end up at 1:00:00 where 1:59:59 would have been appropriate.
> unsigned char GetCompileHour(void)
> {
> unsigned char hour=COMPILE_HOUR;
> return(hour);
> }
> [...]
This all happens in the AVR where space is tight. I prefer a small
shell script which prepares a .h file containing all constants (date,
build #, hardware revision, etc) in their final representation.
- Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?, (continued)
- Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?, Vincent Trouilliez, 2009/01/28
- Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?, Steven Michalske, 2009/01/28
- Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?, Vincent Trouilliez, 2009/01/28
- Message not available
- Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?, Vincent Trouilliez, 2009/01/28
- Message not available
- Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?, Vincent Trouilliez, 2009/01/28
Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?, Dave Hylands, 2009/01/28
Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?, Anton James Erasmus, 2009/01/29
- [avr-gcc-list] Re: __DATE__ constant, any way to format it differently ?,
Heike C. Zimmerer <=