From 91340c358b694be92c78a0f7883cec54e64b3ef6 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Wed, 17 Dec 2014 15:21:42 +0000 Subject: [PATCH] cleanup --- ps2drv.cpp | 21 --------------------- ps2drv.h | 9 +-------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/ps2drv.cpp b/ps2drv.cpp index dbfb77b..8056077 100644 --- a/ps2drv.cpp +++ b/ps2drv.cpp @@ -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; diff --git a/ps2drv.h b/ps2drv.h index bc23760..beb303b 100644 --- a/ps2drv.h +++ b/ps2drv.h @@ -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();