Hi
M2_STRLIST: Yes, M2_STRLIST is more like a toplevel element and is difficult to use in between other elements.
I will add a more flexible M2_COMBO with dynamic number of elements.
In COMBO would be interesting to know if the value of combo has changed by a msg in cb function.
There is no value change callback. Instead you can observe the value, which is modified by M2_COMBO
uint8_t var_for_m2_combo; // adr of this var is given to M2_COMBO
uint8_t prev_value; // this is a backup value to detect changes by M2_COMBO
...
void loop(void)
{
...
if ( prev_value != var_for_m2_combo )
{
// value has changed, do some action
...
prev_value = var_for_m2_combo;
}
}
From a menu item. I want to execute a function
With M2_2LMENU you can only call other menus. Use M2_STRLIST, which allows you to call other menues or execute procedures.
BTW: You should free the allocated memory in your callback proc.
Oliver