cnandha19
Member level 3

Here i attached the model of menu flow i had the menu flow with 1 press means it goes to 1 st Menu 1.Company name and again '1' pressed means it goes to company address but i wanna to change it 1 pressed means it goes to company address after the enter pressed means it has to goto company address and if i am in company address if Esca pressed means it goes back to companyname i want logic please help me
Code:
while(1)
{
key =READ_SWITCHES();
case '1' :
///SET KEY
{
switch(mode)
{
case mCompanyname:
{
key = companyname_function();
if(key)
{
lcdClear();
lcdMoveCursor(0,0);
lcdPrintStr("1.Company details");
lcdMoveCursor(1,0);
lcdPrintStr("2.Calibration off");
lcdMoveCursor(2,0);
lcdPrintStr("3.Set date time");
lcdMoveCursor(3,0);
lcdPrintStr("4.Manage userpass");
menu = mpassword;
mode = mCompanyAddress; //mcalibration
}
else
{
menu = mpassword;
}
}
break;
case mCompanyAddress:
{
key = company_address();
if(key)
{
lcdClear();
lcdMoveCursor(0,0);
lcdPrintStr("1.Company details");
lcdMoveCursor(1,0);
lcdPrintStr("2.Calibration off");
lcdMoveCursor(2,0);
lcdPrintStr("3.Set date time");
lcdMoveCursor(3,0);
lcdPrintStr("4.Manage userpass");
menu = mpassword;
mode = mcalibration; //mcalibration
}
else
{
menu =mpassword;
}
}
break;