problem with getch loop
Posted: Sun Sep 23, 2007 1:49 pm
Here's my code:
Now, it works fine when the memset line is UNCOMMENTED.. but when I do comment it out.. it doesn't work? Does anyone who is good with C have an idea?
PS. asckey is in my kb isr, which seems to be fine.. if you want me to post that too.. i will. result and asckey are both global vars.
Thanks for any replies.
Code: Select all
int getch()
{
char timewaster[5];
result=0;
do{
result=asckey;
if(result!=0)
{
asckey=0;
return result;
}
//memset(timewaster,0,5);
}while(1);
}
PS. asckey is in my kb isr, which seems to be fine.. if you want me to post that too.. i will. result and asckey are both global vars.
Thanks for any replies.