| 92 | } |
| 93 | |
| 94 | static inline uint8_t get_scan_code(void) |
| 95 | { |
| 96 | uint8_t c, i; |
| 97 | |
| 98 | i = tail; |
| 99 | if (i == head) return 0; |
| 100 | i++; |
| 101 | if (i >= BUFFER_SIZE) i = 0; |
| 102 | c = buffer[i]; |
| 103 | tail = i; |
| 104 | return c; |
| 105 | } |
| 106 | |
| 107 | // http://www.quadibloc.com/comp/scan.htm |
| 108 | // http://www.computer-engineering.org/ps2keyboard/scancodes2.html |