|
From: | Dave Hansen |
Subject: | Re: [avr-gcc-list] Trick for creating WYSIWYG bitmaps in C [was: howto specifiy a binary constant] |
Date: | Fri, 23 Sep 2005 10:42:42 -0400 |
From: "Bob Paddock" <address@hidden>
I thought I'd try this bitmap 'trick' via copy&paste of the #defines and code into the file I was working on, this is what I get: Name/name.c:692: error: `sXXXXXX__' undeclared here (not in a function) Name/name.c:692: error: initializer element is not constant Name/name.c:692: error: (near initialization for `lcd_char_P[0]') Name/name.c:693: error: `sX_____X_' undeclared here (not in a function) Name/name.c:693: error: initializer element is not constant [snip rest of the bitmap erros] Is this 'trick' compiler or compiler option dependent?
[...]
#define X )*2+1 #define _ )*2 #define s ((((((((0 /* 8 parens for 8 bit, 16 for 16, etc) */ Then you just "draw" your bitmap as such: uint8_t lcd_char_P[] = { sXXXXXX__, sX_____X_, sX______X, sX_____X_, sXXXXXX__, sX_______, sX_______, sX_______ }
I think it will work if you change the above to uint8_t lcd_char_P[] = { s XXXXXX__, s X_____X_, s X______X, s X_____X_, s XXXXXX__, s X_______, s X_______, s X_______ } But I haven't tried it myself. Regards, -=Dave
[Prev in Thread] | Current Thread | [Next in Thread] |