avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Re: Strings: escape sequence to insert arbitrary hex


From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Re: Strings: escape sequence to insert arbitrary hex value ?
Date: Thu, 5 Feb 2009 15:53:49 +0100

On Thu, 05 Feb 2009 07:58:26 +0100
David Brown <address@hidden> wrote:


Thanks to all the people who replied while I was away !

> An alternative idea is to find an ASCII character that you don't need 
> otherwise (say, "~"), and use it in your strings.  Then do on-the-fly 
> conversion when outputing the strings:
> 
> char example[] = "foo~bar";
> 
> void lcdWriteString(const char* p) {
>       while (char c = *p++) {
>               if (c == '~') {
>                       lcdWriteChar(LCD_CUSTOM_CHAR_FOO);
>               } else {
>                       lcdWriteChar(c);

Ah yes, as it happens I already do exactly just that, for two caracters:
the lower case 'g' and 'y' letters. The default ones defined in the LCD
module don't look good, so I redefined them (same bitmap but lowered
down one line/pixel, so it lines up better with the surrounding text).


--
Vince




reply via email to

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