summaryrefslogtreecommitdiff
path: root/converter/adb_usb
diff options
context:
space:
mode:
Diffstat (limited to 'converter/adb_usb')
-rw-r--r--converter/adb_usb/led.c5
-rw-r--r--converter/adb_usb/matrix.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/converter/adb_usb/led.c b/converter/adb_usb/led.c
index 0e162f379b..1e7911f942 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
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "stdint.h"
+#include <stdint.h>
+#include <util/delay.h>
#include "adb.h"
#include "led.h"
void led_set(uint8_t usb_led)
{
+ // need a wait to send command without miss
+ _delay_ms(100);
adb_host_kbd_led(~usb_led);
}
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index 7e58569715..54be2b0f57 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -67,6 +67,13 @@ uint8_t matrix_cols(void)
void matrix_init(void)
{
adb_host_init();
+ // wait for keyboard to boot up and receive command
+ _delay_ms(1000);
+ // Enable keyboard left/right modifier distinction
+ // Addr:Keyboard(0010), Cmd:Listen(10), Register3(11)
+ // upper byte: reserved bits 0000, device address 0010
+ // lower byte: device handler 00000011
+ adb_host_listen(0x2B,0x02,0x03);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;