#define GCODE const
#define FCODE /* nothing */
#define SGUCHAR uint8_t
typedef struct _GPALETTE_RGB
{
SGUCHAR r;
SGUCHAR g;
SGUCHAR b;
} GPALETTE_RGB;
#ifdef LCD_CONTROLLER_ST7789
static GCODE GPALETTE_RGB FCODE ghw_palette[GHW_PALETTE_SIZE] =
#include <gcolor_4_ST7789.pal>
;
#endif
and the .pal file contains this
/*V P C 0 16 8 8 8 8 16 24 0 gcolor_4.pal LCDIcon FileDescriptor: Do not edit or move */
{
{0x00U, 0x00U, 0x00U},
{0xFFU, 0x00U, 0x00U},
{0xC0U, 0x80U, 0x00U},
{0xFFU, 0x80U, 0x00U},
{0xFFU, 0xFFU, 0x00U},
{0x00U, 0xFFU, 0x00U},
{0x00U, 0xC0U, 0x00U},
{0x00U, 0xFFU, 0xFFU},
{0x00U, 0x80U, 0xFFU},
{0x00U, 0x00U, 0xFFU},
{0x80U, 0x00U, 0xFFU},
{0xA0U, 0xA0U, 0xFFU},
{0xFFU, 0x00U, 0xFFU},
{0x80U, 0x80U, 0x80U},
{0xC0U, 0xC0U, 0xC0U},
{0xFFU, 0xFFU, 0xFFU}
}
In Cube IDE I get an undefined "syntax error" in the editor, but it compiles without apparent errors. Can't tell if it runs because I am days away from getting to a buildable state (it is a commercial graphics library; a huge mess of very similar files for different LCD controllers).
I thought the "#define FCODE /* nothing */" is a problem but removing the FCODE makes no difference.
The syntax error is showing on the three lines starting with static GCODE GPALETTE_...