diff options
Diffstat (limited to 'keyboards/crkbd/rev1')
-rw-r--r-- | keyboards/crkbd/rev1/config.h | 2 | ||||
-rw-r--r-- | keyboards/crkbd/rev1/matrix.c | 50 | ||||
-rw-r--r-- | keyboards/crkbd/rev1/rev1.c | 7 |
3 files changed, 44 insertions, 15 deletions
diff --git a/keyboards/crkbd/rev1/config.h b/keyboards/crkbd/rev1/config.h index 6564c8503..4ea8ff38c 100644 --- a/keyboards/crkbd/rev1/config.h +++ b/keyboards/crkbd/rev1/config.h @@ -43,7 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/crkbd/rev1/matrix.c b/keyboards/crkbd/rev1/matrix.c index 718cc5744..dd93506db 100644 --- a/keyboards/crkbd/rev1/matrix.c +++ b/keyboards/crkbd/rev1/matrix.c @@ -93,6 +93,44 @@ uint8_t matrix_cols(void) return MATRIX_COLS; } +void tx_rx_leds_init(void) +{ +#ifndef NO_DEBUG_LEDS + TX_RX_LED_INIT; + TXLED0; + RXLED0; +#endif +} + +void tx_led_on(void) +{ +#ifndef NO_DEBUG_LEDS + TXLED1; +#endif +} + +void tx_led_off(void) +{ +#ifndef NO_DEBUG_LEDS + TXLED0; +#endif +} + +void rx_led_on(void) +{ +#ifndef NO_DEBUG_LEDS + RXLED1; +#endif +} + +void rx_led_off(void) +{ +#ifndef NO_DEBUG_LEDS + RXLED0; +#endif +} + + void matrix_init(void) { debug_enable = true; @@ -102,9 +140,7 @@ void matrix_init(void) unselect_rows(); init_cols(); - TX_RX_LED_INIT; - TXLED0; - RXLED0; + tx_rx_leds_init(); // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { @@ -189,10 +225,10 @@ int serial_transaction(int master_changed) { int ret=serial_update_buffers(); #endif if (ret ) { - if(ret==2) RXLED1; + if(ret==2) rx_led_on(); return 1; } - RXLED0; + rx_led_off(); memcpy(&matrix[slaveOffset], (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); return 0; @@ -241,7 +277,7 @@ uint8_t matrix_master_scan(void) { if( serial_transaction(mchanged) ) { #endif // turn on the indicator led when halves are disconnected - TXLED1; + tx_led_on(); error_count++; @@ -254,7 +290,7 @@ uint8_t matrix_master_scan(void) { } } else { // turn off the indicator led on no error - TXLED0; + tx_led_off(); error_count = 0; } matrix_scan_quantum(); diff --git a/keyboards/crkbd/rev1/rev1.c b/keyboards/crkbd/rev1/rev1.c index 38ab92788..b969b5e28 100644 --- a/keyboards/crkbd/rev1/rev1.c +++ b/keyboards/crkbd/rev1/rev1.c @@ -6,13 +6,6 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND); #endif -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - //led_set_user(usb_led); -} -#endif - #ifdef RGB_MATRIX_ENABLE // Logical Layout |