42,6 → 42,7 |
#include <sysinfo.h> |
#include <stdio.h> |
#include <thread.h> |
#include <bool.h> |
|
#define POLL_INTERVAL 10000 |
|
92,6 → 93,7 |
/* polling thread */ |
static void *sgcn_thread_impl(void *arg); |
|
static volatile bool polling_disabled = false; |
|
/** |
* Initializes the SGCN driver. |
120,6 → 122,16 |
return 0; |
} |
|
void kbd_port_yield(void) |
{ |
polling_disabled = true; |
} |
|
void kbd_port_reclaim(void) |
{ |
polling_disabled = false; |
} |
|
/** |
* Handler of the "key pressed" event. Reads codes of all the pressed keys from |
* the buffer. |
154,11 → 166,11 |
(void) arg; |
|
while (1) { |
sgcn_key_pressed(); |
if (polling_disabled == false) |
sgcn_key_pressed(); |
usleep(POLL_INTERVAL); |
} |
} |
|
|
/** @} |
*/ |