1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-07-17 23:29:05 +00:00
This commit is contained in:
Stephen Crane 2014-12-17 15:21:42 +00:00
parent ea3d18c7fe
commit 91340c358b
2 changed files with 1 additions and 29 deletions

View File

@ -4,7 +4,6 @@
#define BUFFER_SIZE 16
static volatile uint8_t buffer[BUFFER_SIZE];
static volatile uint8_t head, tail;
static bool isbrk;
static uint8_t DataPin;
// The ISR for the external interrupt
@ -51,26 +50,6 @@ bool PS2Driver::available() {
return true;
}
bool PS2Driver::isbreak() {
bool b = isbrk;
isbrk = false;
return b;
}
int PS2Driver::read() {
if (head == tail)
return -1;
uint8_t i = tail+1;
if (i == BUFFER_SIZE) i = 0;
tail = i;
if (buffer[i] == 0xf0) {
isbrk = true;
return read();
}
return buffer[i];
}
unsigned PS2Driver::read2() {
if (head == tail)
return 0;

View File

@ -18,17 +18,10 @@ public:
*/
bool available();
/**
* returns true if the key has been released
*/
bool isbreak();
/**
* Returns the scancode last received from the keyboard.
* If there is no char available, -1 is returned.
* If there is no char available, 0 is returned.
*/
int read();
unsigned peek();
unsigned read2();