From cb410729e631af9f962726c394956401b7c18079 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 5 Jul 2016 23:56:42 -0400 Subject: remove uno_slave for now, even though it's freakin cool --- keyboards/lets_split/uno_slave/uno-matrix.c | 160 ---------------------------- 1 file changed, 160 deletions(-) delete mode 100644 keyboards/lets_split/uno_slave/uno-matrix.c (limited to 'keyboards/lets_split/uno_slave/uno-matrix.c') diff --git a/keyboards/lets_split/uno_slave/uno-matrix.c b/keyboards/lets_split/uno_slave/uno-matrix.c deleted file mode 100644 index 4ac3c33ac..000000000 --- a/keyboards/lets_split/uno_slave/uno-matrix.c +++ /dev/null @@ -1,160 +0,0 @@ -#define F_CPU 16000000UL - -#include -#include -#include - -#include "uno-matrix.h" - -#define debug(X) NULL -#define debug_hex(X) NULL - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - //debug_enable = true; - //debug_matrix = true; - //debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - //Serial.println(cols, BIN); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<