]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
ps2_usb: Fix set led status at startup
authortmk <hasu@tmk-kbd.com>
Wed, 28 Sep 2016 09:31:22 +0000 (18:31 +0900)
committertmk <hasu@tmk-kbd.com>
Tue, 4 Oct 2016 01:21:57 +0000 (10:21 +0900)
converter/ps2_usb/matrix.c

index 45cf2a4a90fa87e2305bf5622e26a4d2f6bba5b0..24b29ed33004015761e1c1d7b994bdf8de4aead1 100644 (file)
@@ -22,6 +22,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "util.h"
 #include "debug.h"
 #include "ps2.h"
+#include "host.h"
+#include "led.h"
 #include "matrix.h"
 
 
@@ -215,6 +217,12 @@ uint8_t matrix_scan(void)
                         print("Overrun\n");
                         state = INIT;
                         break;
+                    case 0xAA:  // Self-test passed
+                    case 0xFC:  // Self-test failed
+                        printf("BAT %s\n", (code == 0xAA) ? "OK" : "NG");
+                        led_set(host_keyboard_leds());
+                        state = INIT;
+                        break;
                     default:    // normal key make
                         if (code < 0x80) {
                             matrix_make(code);