From 6746e37088ce8ba03529c1226bd216705edb2b1f Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 10 Apr 2015 01:25:48 +0900 Subject: Remove core library and build files --- common/keyboard.c | 150 ------------------------------------------------------ 1 file changed, 150 deletions(-) delete mode 100644 common/keyboard.c (limited to 'common/keyboard.c') diff --git a/common/keyboard.c b/common/keyboard.c deleted file mode 100644 index 1e3fb510a4..0000000000 --- a/common/keyboard.c +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -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 -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include "keyboard.h" -#include "matrix.h" -#include "keymap.h" -#include "host.h" -#include "led.h" -#include "keycode.h" -#include "timer.h" -#include "print.h" -#include "debug.h" -#include "command.h" -#include "util.h" -#include "sendchar.h" -#include "bootmagic.h" -#include "eeconfig.h" -#include "backlight.h" -#ifdef MOUSEKEY_ENABLE -# include "mousekey.h" -#endif -#ifdef PS2_MOUSE_ENABLE -# include "ps2_mouse.h" -#endif -#ifdef SERIAL_MOUSE_ENABLE -#include "serial_mouse.h" -#endif - - -#ifdef MATRIX_HAS_GHOST -static bool has_ghost_in_row(uint8_t row) -{ - matrix_row_t matrix_row = matrix_get_row(row); - // No ghost exists when less than 2 keys are down on the row - if (((matrix_row - 1) & matrix_row) == 0) - return false; - - // Ghost occurs when the row shares column line with other row - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - if (i != row && (matrix_get_row(i) & matrix_row)) - return true; - } - return false; -} -#endif - - -void keyboard_init(void) -{ - timer_init(); - matrix_init(); -#ifdef PS2_MOUSE_ENABLE - ps2_mouse_init(); -#endif -#ifdef SERIAL_MOUSE_ENABLE - serial_mouse_init(); -#endif - - -#ifdef BOOTMAGIC_ENABLE - bootmagic(); -#endif - -#ifdef BACKLIGHT_ENABLE - backlight_init(); -#endif -} - -/* - * Do keyboard routine jobs: scan mantrix, light LEDs, ... - * This is repeatedly called as fast as possible. - */ -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_scan(); - for (uint8_t r = 0; r < MATRIX_ROWS; r++) { - matrix_row = matrix_get_row(r); - matrix_change = matrix_row ^ matrix_prev[r]; - if (matrix_change) { - if (debug_matrix) matrix_print(); -#ifdef MATRIX_HAS_GHOST - if (has_ghost_in_row(r)) { - matrix_prev[r] = matrix_row; - continue; - } -#endif - for (uint8_t c = 0; c < MATRIX_COLS; c++) { - if (matrix_change & ((matrix_row_t)1<