EDIT Question clarified in separate post /EDIT
I'm still working with Dean's project Micromenu
https://www.avrfreaks.net/index.p...
I have the bones of the system working but I need to add an item to the menu struct like
// this change adds mode to the menus to relate to the eep parameters. typedef struct PROGMEM { const uint8_t mode; void *Next; void *Previous; void *Parent; void *Sibling; FuncPtr_t SelectFunc; FuncPtr_t EnterFunc; const char Text[]; } Menu_Item_t ;
I modified the MAKE_MENU macro to add the mode
#define MAKE_MENU(Name, mode, Next, Previous, Parent, Sibling, SelectFunc, EnterFunc, Text) \ extern Menu_Item_t Next; \ extern Menu_Item_t Previous; \ extern Menu_Item_t Parent; \ extern Menu_Item_t Sibling; \ Menu_Item_t Name = { (uint8_t)mode, (void*)&Next, (void*)&Previous, (void*)&Parent, (void*)&Sibling, (FuncPtr_t)SelectFunc, (FuncPtr_t)EnterFunc, { Text }}
Some of my menus
// Name ,mode ,Next ,Previous , Parent, Sibling, SelectFunc , EnterFunc, Text MAKE_MENU(M_ROOT ,0 ,M_1_1 ,NULL_ENTRY , NULL_ENTRY , NULL_ENTRY , click , click , "?f?y3?tWelcome"); MAKE_MENU(M_1_1 ,1 ,M_1_2 ,NULL_ENTRY , NULL_ENTRY ,NULL_ENTRY , click , click , "?y2?l?n?lITEM 1_1"); MAKE_MENU(M_1_2 ,2 ,M_1_3 ,NULL_ENTRY , NULL_ENTRY ,NULL_ENTRY , click , eep_show , "?y3?lITEM 1_2");
I dug through the hex file and confirmed that the correct uint8_t values are after the previous text.
How do I get them out to use them!
I have tried numerous things based on Dean's text extraction.
It seems to me that I need something like -
value_of the mode member of the struct.
but since it is progmem and everything is by address I am getting messed up.
Kirk