CMatic
Joined: 11 Jan 2012 Posts: 69
|
Incorrect Rom matrix readings |
Posted: Sat Nov 29, 2014 10:27 pm |
|
|
Implementing a menu using structures in PIC16F1825. The values when read from the array elements the values are incorrect. Example, when menu[0].text is read it does show the text string. However when I test for num_menu or any other values, it shows nothing, frustrated me for last two nights....thanks
Compiler Version 5.026
Code: | static int num_menu, UP, DOWN, ENTER, default_value;
static typedef struct MenuEntry {
char text[14];
char num_menu;
char UP;
char DOWN;
char ENTER;
int16 *funct_ptr;
int default_value;
};
void show_menu(void);
void browse_menu(void);
void testfun(void);
unsigned char selected = 1;
//unsigned int16 *pMenu;
rom int *pMenu;
rom struct MenuEntry menu[] = {
{"[Main]" ,5,0,0,0,0,0},
{"Option1",5,1,2,0,&testfun,1},
{"Option2",5,0,0,0,6,2},
{"Option3",5,0,0,0,0,3},
{"Option4",5,0,0,0,0,4},
{"[Sub]" ,5,0,0,0,0,5},
{"Option1",5,0,0,0,0,6},
{"Option2",5,0,0,0,0,7},
{"Option3",5,0,0,0,0,8},
{"Option4",5,0,0,0,0,9}
};
pMenu = &menu; |
|
|