Tool/software: TI C/C++ Compiler
I have the following code...
static void (* FunctionCallTable[])(void) = { /* a */ MenuDoNothing, /* B */ MenuRebootDevice, /* C */ MenuShowDspParam, /* D */ MenuGetDeviceData, ...
/* Z */ MenuUseDevice };
void CheckForUsbWork(void) { uint16_t usb_byte1; if (UsbScanChar(&usb_byte1)) { if ((usb_byte1 condGE 'A') condAND (usb_byte1 condLE 'Z')) { usb_byte1 -= 'A'; FunctionCallTable[usb_byte1](); UsbPutByte(AsciiEOT); } } }
I have tried placing the word const in front of the table,
I have tried some pragmas, both of which failed compilation...
#pragma CODE_SECTION(FunctionCallTable, "FLASHA");
#pragma DATA_SECTION(FunctionCallTable, "FLASHB"):
Where FLASHA is on page zero, and FLASHB is on page 1.
I cannot seem to get the linker to put that table in ROM
Here is the resulting memory map
.ebss 1 00000700 00000092 UNINITIALIZED
... 00000740 00000034 MainSub.obj (.ebss)
and
.cinit 0 00000050 00000051 COPY SECTION 00000050 00000037 MainSub.obj (.cinit)
The actual name "FunctionCallTable" does not show up in the memory map.
When examining the assembly code (single stepping) the jump table in RAM at 0x740 in the .ebss section.
How can I get the linker to put the jump table in ROM (FLASH)?
Thanks for your help,
Mark.