summaryrefslogtreecommitdiff
path: root/keyboard/gh60/matrix.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2014-12-11 17:36:42 -0500
committerJack Humbert <jack.humb@gmail.com>2014-12-11 17:36:42 -0500
commitd9a1b9086f23477ffdcce3c1ff49ec1ce7c8791f (patch)
tree47fb4e6f2311dd5193af921c379629dac98c09a2 /keyboard/gh60/matrix.c
parent1c6770f18cd5d7794c9ad198ada8062de8679e7c (diff)
led
Diffstat (limited to 'keyboard/gh60/matrix.c')
-rw-r--r--keyboard/gh60/matrix.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/keyboard/gh60/matrix.c b/keyboard/gh60/matrix.c
index 508b1afbc8..83016b77ae 100644
--- a/keyboard/gh60/matrix.c
+++ b/keyboard/gh60/matrix.c
@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdbool.h>
#include <avr/io.h>
#include <util/delay.h>
+#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;
}