]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
brings alps64 up-to-date (needs testing)
authorJack Humbert <jack.humb@gmail.com>
Sat, 28 May 2016 15:56:06 +0000 (11:56 -0400)
committerJack Humbert <jack.humb@gmail.com>
Sat, 28 May 2016 15:56:06 +0000 (11:56 -0400)
keyboard/alps64/Makefile
keyboard/alps64/alps64.c [new file with mode: 0644]
keyboard/alps64/alps64.h [new file with mode: 0644]
keyboard/alps64/config.h
keyboard/alps64/keymap_common.c [deleted file]
keyboard/alps64/keymap_common.h [deleted file]
keyboard/alps64/keymaps/default.c
keyboard/alps64/keymaps/hasu.c
keyboard/alps64/matrix.c
quantum/matrix.c
quantum/quantum.h

index 7634c4280ebceee82b5a2726d3b196f861312fa0..bd6ecb6b910c423573ab1158a9783fcc33d6a855 100644 (file)
 TARGET = alps64
 
 # Directory common source filess exist
+TOP_DIR = ../..
 TMK_DIR = ../../tmk_core
 
 # Directory keyboard dependent files exist
 TARGET_DIR = .
 
 # project specific files
-SRC =  keymap_common.c \
-       matrix.c \
+SRC =  alps64.c \
        led.c
 
 ifdef KEYMAP
@@ -127,8 +127,7 @@ COMMAND_ENABLE = yes    # Commands for debug and configuration
 
 # Search Path
 VPATH += $(TARGET_DIR)
+VPATH += $(TOP_DIR)
 VPATH += $(TMK_DIR)
 
-include $(TMK_DIR)/protocol/lufa.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk
+include $(TOP_DIR)/quantum/quantum.mk
diff --git a/keyboard/alps64/alps64.c b/keyboard/alps64/alps64.c
new file mode 100644 (file)
index 0000000..dde10c1
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+Copyright 2012,2013 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/>.
+*/
+#include "quantum.h"
+
+#define LED_ON()    do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0)
+#define LED_OFF()   do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0)
+#define LED_TGL()   do { DDRC |= (1<<5); PINC |= (1<<5); } while (0)
+
+__attribute__ ((weak))
+void matrix_init_user(void) {
+
+}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {
+
+}
+
+void matrix_init_kb(void) {
+    LED_ON();
+    _delay_ms(500);
+    LED_OFF();
+    
+    matrix_init_user();
+}
+
+void matrix_scan_kb(void) {
+    matrix_scan_user();
+}
diff --git a/keyboard/alps64/alps64.h b/keyboard/alps64/alps64.h
new file mode 100644 (file)
index 0000000..d077720
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+Copyright 2012,2013 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/>.
+*/
+#ifndef ALPS64_H
+#define ALPS64_H
+
+#include "quantum.h"
+
+/* Alps64 keymap definition macro */
+#define KEYMAP( \
+    K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \
+    K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
+    K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
+    K31, K41, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, K22, \
+    K30, K40, K50,           K60,                     K70, K00, K10, K20  \
+) { \
+    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
+    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
+    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
+    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \
+    { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \
+    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
+    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \
+    { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 } \
+}
+
+/* AEK US */
+#define KEYMAP_AEK( \
+    K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \
+    K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
+    K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
+    K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \
+    K30, K40, K50,           K60,                          K00, K10, K20  \
+) KEYMAP( \
+    K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, NUHS,K27, \
+    K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
+    K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
+    K31, NUBS,K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, ESC, \
+    K30, K40, K50,           K60,                     APP, K00, K10, K20  \
+)
+
+#endif
index 824d3e8302916ee4174abefe97eb3da5081b0f2d..858a82ecdd9fd98b3c0257dff35e257e1d0f45e3 100644 (file)
@@ -18,6 +18,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef CONFIG_H
 #define CONFIG_H
 
+#include "config_common.h"
 
 /* USB Device descriptor parameter */
 #define VENDOR_ID       0xFEED
@@ -31,6 +32,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define MATRIX_ROWS 8
 #define MATRIX_COLS 8
 
+#define MATRIX_COL_PINS {  B0, B1, B2, B3, B4, B5, B6, B7 }
+#define MATRIX_ROW_PINS {  D0, D1, D2, D3, D4, D5, D6, C2 }
+#define UNUSED_PINS
+
 /* define if matrix has ghost */
 //#define MATRIX_HAS_GHOST
 
diff --git a/keyboard/alps64/keymap_common.c b/keyboard/alps64/keymap_common.c
deleted file mode 100644 (file)
index fdb1769..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-Copyright 2012,2013 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/>.
-*/
-#include "keymap_common.h"
-
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
-}
diff --git a/keyboard/alps64/keymap_common.h b/keyboard/alps64/keymap_common.h
deleted file mode 100644 (file)
index 957db57..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-Copyright 2012,2013 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/>.
-*/
-#ifndef KEYMAP_COMMON_H
-#define KEYMAP_COMMON_H
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/pgmspace.h>
-#include "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "report.h"
-#include "host.h"
-#include "print.h"
-#include "debug.h"
-#include "keymap.h"
-
-
-extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
-extern const uint16_t fn_actions[];
-
-
-/* Alps64 keymap definition macro */
-#define KEYMAP( \
-    K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \
-    K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
-    K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
-    K31, K41, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, K22, \
-    K30, K40, K50,           K60,                     K70, K00, K10, K20  \
-) { \
-    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
-    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
-    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
-    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \
-    { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \
-    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
-    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \
-    { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 } \
-}
-
-/* AEK US */
-#define KEYMAP_AEK( \
-    K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \
-    K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
-    K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
-    K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \
-    K30, K40, K50,           K60,                          K00, K10, K20  \
-) KEYMAP( \
-    K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, NUHS,K27, \
-    K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
-    K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
-    K31, NUBS,K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, ESC, \
-    K30, K40, K50,           K60,                     APP, K00, K10, K20  \
-)
-
-#endif
index a54899196aafbe5d83cd7937d6b491d1267bbf46..2c45dc7f342dd5698264eaf6901370af1ea8ca94 100644 (file)
@@ -1,6 +1,6 @@
-#include "keymap_common.h"
+#include "alps64.h"
 
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     /* 0: qwerty */
     KEYMAP( \
         GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NUHS, BSPC, \
index d297d72fea3bc493647cf1c2d0bb21e1af151e99..e93dd0d410f5de10d8626d5c570c73261542a557 100644 (file)
@@ -1,9 +1,9 @@
-#include "keymap_common.h"
+#include "alps64.h"
 
 /*
  * Hasu
  */
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     /* Default Layer
      * ,-----------------------------------------------------------.
      * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|   \   |
index 5638d7f69d9ef63f72490cd7a5485041ce23e5ce..805999d4a1a739051fd2fe0a14ebf1cd08336a74 100644 (file)
@@ -55,10 +55,6 @@ uint8_t matrix_cols(void)
     return MATRIX_COLS;
 }
 
-#define LED_ON()    do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0)
-#define LED_OFF()   do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0)
-#define LED_TGL()   do { DDRC |= (1<<5); PINC |= (1<<5); } while (0)
-
 void matrix_init(void)
 {
     // initialize row and col
@@ -160,6 +156,7 @@ static void unselect_rows(void)
     PORTC &= ~0b00000100;
 }
 
+
 static void select_row(uint8_t row)
 {
     // Output low(DDR:1, PORT:0) to select
index d5fd7def8ab30efed89bfd33d6399ce53b938562..412662a794fc187648f01bdada225e3811e8d693 100644 (file)
@@ -68,8 +68,10 @@ uint8_t matrix_cols(void) {
 
 void matrix_init(void) {
     /* frees PORTF by setting the JTD bit twice within four cycles */
-    MCUCR |= _BV(JTD);
-    MCUCR |= _BV(JTD);
+    #ifdef __AVR_ATmega32U4__
+        MCUCR |= _BV(JTD);
+        MCUCR |= _BV(JTD);
+    #endif
     /* initializes the I/O pins */
 #if DIODE_DIRECTION == COL2ROW
     for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
index 69a0d8126ab85255bfce205934da89f6cf0336a6..71533f48b913f578c9a3f57b2e20c624daa026b3 100644 (file)
@@ -23,6 +23,7 @@
 #include "eeconfig.h"
 #include <stddef.h>
 #include <avr/io.h>
+#include <util/delay.h>
 
 extern uint32_t default_layer_state;