diff options
| author | tmk <nobody@nowhere> | 2013-10-14 23:37:05 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2013-10-14 23:37:05 +0900 |
| commit | c18c52f551545b46a28902c69730eefbdb75577d (patch) | |
| tree | 03ef488ac04d24efc319aa429bfacbade3507c04 /converter/adb_usb | |
| parent | 59ecced486618161ab18ea9a95dd51e1414fedb8 (diff) | |
| download | qmk_firmware-c18c52f551545b46a28902c69730eefbdb75577d.tar.gz qmk_firmware-c18c52f551545b46a28902c69730eefbdb75577d.zip | |
Merge blargg's fix into adb.c
- <http://geekhack.org/index.php?topic=14290.msg1075201#msg1075201>
Diffstat (limited to 'converter/adb_usb')
| -rw-r--r-- | converter/adb_usb/led.c | 5 | ||||
| -rw-r--r-- | converter/adb_usb/matrix.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/converter/adb_usb/led.c b/converter/adb_usb/led.c index 0e162f379..1e7911f94 100644 --- a/converter/adb_usb/led.c +++ b/converter/adb_usb/led.c | |||
| @@ -15,12 +15,15 @@ You should have received a copy of the GNU General Public License | |||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "stdint.h" | 18 | #include <stdint.h> |
| 19 | #include <util/delay.h> | ||
| 19 | #include "adb.h" | 20 | #include "adb.h" |
| 20 | #include "led.h" | 21 | #include "led.h" |
| 21 | 22 | ||
| 22 | 23 | ||
| 23 | void led_set(uint8_t usb_led) | 24 | void led_set(uint8_t usb_led) |
| 24 | { | 25 | { |
| 26 | // need a wait to send command without miss | ||
| 27 | _delay_ms(100); | ||
| 25 | adb_host_kbd_led(~usb_led); | 28 | adb_host_kbd_led(~usb_led); |
| 26 | } | 29 | } |
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c index 7e5856971..54be2b0f5 100644 --- a/converter/adb_usb/matrix.c +++ b/converter/adb_usb/matrix.c | |||
| @@ -67,6 +67,13 @@ uint8_t matrix_cols(void) | |||
| 67 | void matrix_init(void) | 67 | void matrix_init(void) |
| 68 | { | 68 | { |
| 69 | adb_host_init(); | 69 | adb_host_init(); |
| 70 | // wait for keyboard to boot up and receive command | ||
| 71 | _delay_ms(1000); | ||
| 72 | // Enable keyboard left/right modifier distinction | ||
| 73 | // Addr:Keyboard(0010), Cmd:Listen(10), Register3(11) | ||
| 74 | // upper byte: reserved bits 0000, device address 0010 | ||
| 75 | // lower byte: device handler 00000011 | ||
| 76 | adb_host_listen(0x2B,0x02,0x03); | ||
| 70 | 77 | ||
| 71 | // initialize matrix state: all keys off | 78 | // initialize matrix state: all keys off |
| 72 | for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; | 79 | for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; |
