• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

initilaise structures in C18

Status
Not open for further replies.

picstudent

New Member
This is how I initialise my structures in C18

#pragma idata Menuidata

menu_t sub1_ChaSetup={0,0,3,0,{{0,ChannelStrtFn,"ChannelStart",0},
{0,ChannelStopFn,"ChaStop",0},
{0,SpareFn13,"Spare13",0}}};

menu_t sub2_GenConfig={0,0,3,0,{{0,myTestFn21,"SpareMenu21",0},
{0,myTestFn22,"SpareMenu22",0},
{0,myTestFn23,"SpareMenu23",0}}};

menu_t main_menu={0,0,3,0,{{1,ChannelSetupFn," Channel Setup",&sub1_ChaSetup},
{1,ChannelConfigFn,"ConfigSub",&sub2_GenConfig},
{0,Spare3Fn,"Spare3",0}}};

menu_context_t menu_context={0,0,4,16,0};

The code is getting compiled. But after running in SIM, If I see watch window, these values are not there. What is wrong here?
Thanks
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top