summaryrefslogtreecommitdiff
path: root/converter/sun_usb/matrix.c
diff options
context:
space:
mode:
authortmk <hasu@tmk-kbd.com>2015-06-03 00:03:08 +0900
committertmk <hasu@tmk-kbd.com>2015-06-03 00:29:36 +0900
commit49b0c7e5ef1683f001c4c9e1c7516da8c5fe592e (patch)
tree1e3b831f007e4d1632865acfd529b78d37fe19cc /converter/sun_usb/matrix.c
parent37af88217d62f22fd5d64a7b58285ce9a94d2176 (diff)
sun_usb: Fix LED status update at startup
Diffstat (limited to 'converter/sun_usb/matrix.c')
-rw-r--r--converter/sun_usb/matrix.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/converter/sun_usb/matrix.c b/converter/sun_usb/matrix.c
index f333f542bd..71c818f5ab 100644
--- a/converter/sun_usb/matrix.c
+++ b/converter/sun_usb/matrix.c
@@ -72,6 +72,21 @@ void matrix_init(void)
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
+ // wait for keyboard coming up
+ // otherwise LED status update fails
+ print("Reseting ");
+ while (1) {
+ print(".");
+ while (serial_recv());
+ serial_send(0x01);
+ _delay_ms(500);
+ if (serial_recv() == 0xFF) {
+ _delay_ms(500);
+ if (serial_recv() == 0x04)
+ break;
+ }
+ }
+ print(" Done\n");
return;
}