Dear Renesas,
When using the g_sf_console0() Console Framework, the user enters the label of the initial menu for the comsole to use. When Synergy generates the include file for the thread that uses the console, SSP assumes that the menu is in "const" memory, which puts the menu data in FLASH.
This is NOT always desirable.
I have implemented some C code that utilizes the preprocessor to make the generation, modification and deletion of menu entries and command list exceedingly straight forward and simple for me. Here is a console_test demo menu implemented in my pseudo language:
DMENU(MENU_LBL(root), "MYRoot", SETUP_CMDS(
CMD("Ran", "Ran Number", CB_FCN(Random)),
MNU("RTC", "RTClock", MENU_LBL(rtc)),
CMD("xyz", "Another CMD", CB_FCN(another_fcn))
)
)
DMENU(MENU_LBL(rtc), "RTC Clock", SETUP_CMDS(
CMD("Set", "Put the time", CB_FCN(SetTime)),
CMD("Get", "Get the time", CB_FCN(ReadTime))
)
)
CMD("Ran", "Ran Number", CB_FCN(Random)),
MNU("RTC", "RTClock", MENU_LBL(rtc)),
CMD("xyz", "Another CMD", CB_FCN(another_fcn))
)
)
DMENU(MENU_LBL(rtc), "RTC Clock", SETUP_CMDS(
CMD("Set", "Put the time", CB_FCN(SetTime)),
CMD("Get", "Get the time", CB_FCN(ReadTime))
)
)
So, simply by adding, removing and linking the DMENU statements, any number of menus can be maintained easily & visually. Additionally, simply by adding, removing or rearranging the SETUP_CMDS parameters, the command lists are quite easily maintained. There may be any number of parameters in the SETUP_CMDS() macro.
The command lists are generated in "const" memory, but the menu structs need to be initialized at run time. That means the menu must be in RAM. And *that* means the SSP generated "extern const" statement hoses me.
I really don't want to write a separate parser and have an extra build step. Over time, it's much more maintainable to have everything in the C code right in front of you rather than having to worry about keeping track of another separate process. And since it's only a onetime initialization, there is no real performance hit. And each DMENU statement only needs 16 bytes of RAM, so that cost is minimal, also.
What I am doing now is simply commenting out the "const". If I forget to do that after a "Generate Project Content", I'm informed pretty quickly that it's needed.
But the cleanest thing would be for the presence or absence of the "const" to be specified on the same property line as "Name of Initial Menu". The user must enter a label, anyway, so putting or not-putting "const" in front would really be a trivial matter.
Any chance of that happening?
Regards,
Gary L. Coakley
Gary L. Coakley