The following code generates a this error when compiled: C51 COMPILER V6.02 - SN: XXXXX-XXXXX COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 1999 *** ERROR C221 IN LINE 7 OF QUEUE_I.H: non-constant case/dim expression
const unsigned char code BUF_SIZE = 40; BYTE Qbuf[BUF_SIZE];
#define BUF_SIZE 40
hi, your problem is that you try to use the value of program variable as a number for the compiler process. See, what does next line do:
const unsigned char code BUF_SIZE = 40;
BYTE Qbuf[BUF_SIZE];
#define BUF_SIZE 40 const unsigned char code buf_size = BUF_SIZE; BYTE Qbuf[BUF_SIZE];