/*
-Copyright 2011 Jun Wako <wakojun@gmail.com>
+Copyright 2011,2012 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "debug.h"
#include "command.h"
#include "util.h"
+#include "sendchar.h"
#ifdef MOUSEKEY_ENABLE
#include "mousekey.h"
#endif
void keyboard_init(void)
{
- debug_keyboard = true;
+ // TODO: to enable debug print magic key bind on boot time
+
+ // TODO: configuration of sendchar impl
+ print_sendchar_func = sendchar;
timer_init();
matrix_init();
void keyboard_task(void)
{
static matrix_row_t matrix_prev[MATRIX_ROWS];
+ static uint8_t led_status = 0;
matrix_row_t matrix_row = 0;
matrix_row_t matrix_change = 0;
matrix_row = matrix_get_row(r);
matrix_change = matrix_row ^ matrix_prev[r];
if (matrix_change) {
- matrix_debug();
+ if (debug_matrix) matrix_print();
for (int c = 0; c < MATRIX_COLS; c++) {
if (matrix_change & (1<<c)) {
}
}
+ // update LED
+ if (led_status != host_keyboard_leds()) {
+ led_status = host_keyboard_leds();
+ keyboard_set_leds(led_status);
+ }
+
return;
}