problem with keyboard code

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
LarsH

problem with keyboard code

Post by LarsH »

Hi,
can anybody here help me with this code, and say me what is wrong. My Programm
does not go in the loop.

unsigned char keyb(void)
{  
unsigned char taste,taste2;
writeln ("Keyboard test");
while (taste==taste2)
  {
   taste2=inportb(0x60);
   writeln("Wir sind in der Schleife");
  }
writeln("Taste gedrückt");              
}

Lars
J.

RE:problem with keyboard code

Post by J. »

Uhm... nowhere in your code do you initialize 'taste'
No good can come of that :)

Jeff
Stefan

RE:problem with keyboard code

Post by Stefan »

taste and taste2 must be initializaed with the same value to enter your loop!
LarsH

RE:problem with keyboard code

Post by LarsH »

Now I initializaed it, but now the computer reboot after a few seconds, or if there no textoutput in the loop, the loop were exist after a half seconds.
Tim Robinson

RE:problem with keyboard code

Post by Tim Robinson »

You're better off installing a handler for IRQ 1 and using inportb(0x60) in there.
Post Reply