Last active
August 25, 2019 13:38
-
-
Save kuninet/d13d843f630e98c3c5c1b85ea52e330d to your computer and use it in GitHub Desktop.
PS/2 keyboard for MSX PC timing Trouble FIX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void blink() | |
{ | |
if (PIND==8) { // If your machine has more one line change this to 9 | |
noInterrupts(); | |
delayMicroseconds(1); | |
if (PIND==8) { | |
PORTC = keyboard.MSX_KB_Matrix(0); | |
}else{ | |
PORTC = keyboard.MSX_KB_Matrix(PIND+1); // 8 bits of the Matrix on PORT C (PIN | |
} | |
interrupts(); | |
} else { | |
noInterrupts(); // Deactivate interruptions to avoid keyboard matrix corruption | |
PORTC = keyboard.MSX_KB_Matrix(PIND+1); // 8 bits of the Matrix on PORT C (PIN | |
interrupts(); // Activate interruptions | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PIND==8の処理で、割込み禁止後 もう一度PIND==8かとif文できくと違う場合があるという....
タイミングトラブルです