k_printf causes a page fault
Posted: Sun Nov 20, 2005 9:18 pm
I have a bug free k_printf working and it works everywhere except for when i decide to put it in my getkey code
I have debugged my keyboard isr but i just can't seem to get the getkey to stay in a loop until you input a key
here is my problem code
I have debugged my keyboard isr but i just can't seem to get the getkey to stay in a loop until you input a key
here is my problem code
Code: Select all
sasc getkey(void){
sasc ret_key;
for(;;){ //loop until..
if ((volatile)keycount!=0){k_printf("break");break;} //there is a key in the buffer, printf causes page fault
key_back(); //this is to do stuff in background when waiting for key
}
keycount--;
ret_key.scan=keys[keycount];
keycount--;
ret_key.asc=keys[keycount];
return ret_key;
}