From d9a1b9086f23477ffdcce3c1ff49ec1ce7c8791f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 11 Dec 2014 17:36:42 -0500 Subject: led --- keyboard/gh60/matrix.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'keyboard/gh60/matrix.c') diff --git a/keyboard/gh60/matrix.c b/keyboard/gh60/matrix.c index 508b1afbc..83016b77a 100644 --- a/keyboard/gh60/matrix.c +++ b/keyboard/gh60/matrix.c @@ -22,6 +22,7 @@ along with this program. If not, see . #include #include #include +#include "action_layer.h" #include "print.h" #include "debug.h" #include "util.h" @@ -55,12 +56,21 @@ uint8_t matrix_cols(void) return MATRIX_COLS; } +static +void setup_leds(void) { + DDRF |= 0x00; + PORTF |= 0x00; +} + + void matrix_init(void) { // initialize row and col unselect_rows(); init_cols(); + setup_leds(); + // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix[i] = 0; @@ -94,6 +104,18 @@ uint8_t matrix_scan(void) } } + // uint8_t layer = biton32(default_layer_state); + switch (default_layer_state) { + case 1: + DDRF &= ~(1<<0); + PORTF &= ~(1<<0); + break; + case 2: + DDRF |= (1<<0); + PORTF |= (1<<0); + break; + } + return 1; } -- cgit v1.2.3