CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Incorrect Rom matrix readings

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
CMatic



Joined: 11 Jan 2012
Posts: 69

View user's profile Send private message

Incorrect Rom matrix readings
PostPosted: Sat Nov 29, 2014 10:27 pm     Reply with quote

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;
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group