Looking at the C code generated - (from constant table[256])
Code: Select all
#define FCLsz_TABLE 2017
const MX_UINT16 FCL_TABLE[FCLsz_TABLE] = {0x0000, 0x8005,
Changing the table size to 2 gives a generated table size of 14.
It works correctly using variable instead of creating a constant.
As an aside - I initially missed a 0 from a hex number in the lookup (so x0110 instead of 0x0110) this simulated fine but (using 0 for the duff value) but fails to compile.
Similarly I can add a string as a value (say {0x1110, "abc"} - which compiles okay (it's #define data) but is a little odd?
Martin