Hello,

I want to create a table like this:

unsigned char lcd_display_function[] PROGMEM = {
        CLCD_FIFO_CMD_FILLRECT, LOK_FCT0_POSX, LOK_FCT0_POSY, LOK_FCT0_ENDX, 
LOK_FCT0_POSY, SOFTKEY_BORDER0_COLOR,
        CLCD_FIFO_CMD_SUBEND};

Each value is a constant in a range of 0<=x<=255 defined with #define.

This works fine so far, but I am in the need to add also an address of
another table in PROGMEM, like this:

unsigned char foo[] PROGMEM = {0, 1, 2};

I tried several ways to add this to the list above, like this:

#define lo8(x) (((int)(x)&0xff))
#define hi8(x) (((int)(x)>>8))

unsigned char lcd_display_function[] PROGMEM = {
        CLCD_FIFO_CMD_FILLRECT, LOK_FCT0_POSX, LOK_FCT0_POSY, LOK_FCT0_ENDX, 
LOK_FCT0_POSY, SOFTKEY_BORDER0_COLOR,
        lo8(foo), hi8(foo),
        CLCD_FIFO_CMD_SUBEND};

but it results always in an error:
error: initializer element is not constant

Do you have any idea how this could be solved?

Thanks
Volkmar



_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to