Skip to content

Commit

Permalink
I wanted to quote some A$AP Rocky lyrics in this commit
Browse files Browse the repository at this point in the history
Who knows if this works as expected though.
  • Loading branch information
kism committed Apr 12, 2016
1 parent 6fadb81 commit 37d4d75
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions PS2Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ bool PS2Keyboard::available() {
return false;
}

uint8_t PS2Keyboard::readScanCode(void)
{
return get_scan_code();
}

int PS2Keyboard::read() {
uint8_t result;

Expand Down
11 changes: 8 additions & 3 deletions PS2Keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,24 @@ class PS2Keyboard {
* method before using any other method of this class.
*/
PS2Keyboard();

/**
* Starts the keyboard "service" by registering the external interrupt.
* setting the pin modes correctly and driving those needed to high.
* The propably best place to call this method is in the setup routine.
*/
static void begin(uint8_t dataPin, uint8_t irq_pin, const PS2Keymap_t &map = PS2Keymap_US);

/**
* Returns true if there is a char to be read, false if not.
*/
static bool available();


/**
* Retutns ps2 scan code.
*/
static uint8_t readScanCode(void);

/**
* Returns the char last read from the keyboard.
* If there is no char available, -1 is returned.
Expand Down

0 comments on commit 37d4d75

Please sign in to comment.