I am writing a function which polls the keyboard and the RTC constantly and executes a certain task. During keyboard polling,
I am checking the Bit 0 at port 0x64 to check whether the keyboard output buffer is full. I have a document which says that
the bit clears when port 0x60 is read to get the scancode, but it is not clearing and causing my loop to stop accepting any
other keystrokes. The timer part is fine and works as expected. Here is the code:
Code: Select all
OutPortB(0x70, 0x00);
unsigned char initial = InPortB(0x71);
unsigned char current;
while(1)
{
if((InPortB(0x64)&0x01) == 0x01)
{
unsigned char scan = KeyboardInt();
}
//
OutPortB(0x70, 0x00);
current = InPortB(0x71);
if(initial != current)
{
initial = current;
// timer function
}
}
I have also tried hooking to int 0x09 but no good.