]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - keyboard/hid_liber/matrix.c
Disable JTAG function for hid_liber to use PORTF.
[max/tmk_keyboard.git] / keyboard / hid_liber / matrix.c
index 975ff9aaca6a414d4baeefd5ce54948d8066823c..8e3739197dc6b7e5e09b26c9d95b63f94808ee9d 100644 (file)
@@ -1,19 +1,13 @@
-/*
-Copyright 2011 Jun Wako <wakojun@gmail.com>
-
-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 <http://www.gnu.org/licenses/>.
-*/
+/* Copyright 2012 Jun Wako <wakojun@gmail.com>
+ *
+ * This is heavily based on hid_liber/board.{c|h}.
+ * https://github.com/BathroomEpiphanies/AVR-Keyboard
+ *
+ * Copyright (c) 2012 Fredrik Atmer, Bathroom Epiphanies Inc
+ * http://bathroomepiphanies.com
+ *
+ * As for liscensing consult with the original files or its author.
+ */
 #include <stdint.h>
 #include <stdbool.h>
 #include <avr/io.h>
@@ -143,6 +137,10 @@ uint8_t matrix_cols(void)
 
 void matrix_init(void)
 {
+    // To use PORTF disable JTAG with writing JTD bit twice within four cycles.
+    MCUCR |= (1<<JTD);
+    MCUCR |= (1<<JTD);
+
     // initialize row and col
     setup_io_pins();
     setup_leds();