From 06db39583fe87a8d13c0c345887b71a577198049 Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 13 Jan 2011 22:46:57 +0900 Subject: ADB keyboard LEDs support --- adb/README | 2 ++ adb/matrix.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'adb') diff --git a/adb/README b/adb/README index edd118d41..d6c9ec9aa 100644 --- a/adb/README +++ b/adb/README @@ -1,8 +1,10 @@ ADB to USB keyboard converter ============================= +http://geekhack.org/showwiki.php?title=Island:14290 This firmware converts ADB keyboard protocol to USB. + Build ----- 0. Connect ADB keyboard to Teensy by 3 lines(Vcc, GND, Data). diff --git a/adb/matrix.c b/adb/matrix.c index ca8858d0b..550506ec4 100644 --- a/adb/matrix.c +++ b/adb/matrix.c @@ -9,6 +9,7 @@ #include "util.h" #include "debug.h" #include "adb.h" +#include "usb_keyboard.h" #include "matrix_skel.h" @@ -71,8 +72,13 @@ uint8_t matrix_scan(void) uint16_t codes; uint8_t key0, key1; - _matrix_is_modified = false; + static uint8_t prev_led = 0; + if (prev_led != usb_keyboard_leds) { + adb_host_kbd_led(~usb_keyboard_leds); + prev_led = usb_keyboard_leds; + } + _matrix_is_modified = false; codes = adb_host_kbd_recv(); key0 = codes>>8; key1 = codes&0xFF; -- cgit v1.2.3