[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?

From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?
Date: Mon, 19 Sep 2005 00:33:29 +0200

Thanks chaps, printf_P and printf("%S", ) do the trick.

If I may ask one more question before, I happen to have a problem define
one of the units : " °C".

This '°' degree sign is not ASCII but extended ASCII, and my LCD module
has a japanese (!) page code for extended characters.
So I need to squeeze a numerical value within my string definition, but
I really can't manage to do it, and the string part of struct which
itself is part of an array, can't help :-/

So, I tried : 

const struct param __ATTR_PROGMEM__ param_list[] = {
        { ... , {0xDF, "C "}, ... },

but the compiler promptly insulted me !! ;o)

Any idea how to do that ? When you define a constant string, and in the
middle of it you have a character for which you have to specify the hex
code manually to suit the LCD module code page ?

On Sun, 2005-09-18 at 16:54 -0500, David Kelly wrote:
> ...I don't use printf() so I haven't used printf_P()

But how do you do then ?
If you wrote better functions, please share ! :-)
Printf takes huge space, so if you have a light weight alternative...

> > Doesn't the compiler take care of this automatically ?
> Nope. Been talked about. GCC 3.x lacks the hooks to deal with  
> multiple address spaces. Something that 4.x might. This is the one  
> minor detail where at least some commercial AVR C compilers do better.
> There are at least 3 address spaces in the AVR: SRAM, FLASH, and  
> EEPROM. Maybe SFR is 4th but think that is in SRAM space.

Ahhh, some great improvement to be looking forward to then, let's
encourage the gcc-avr devs !! :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]