diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-05-28 11:56:06 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-05-28 11:56:06 -0400 |
commit | de57799530d3184722532f93d156364067d8fcd5 (patch) | |
tree | e328efac498525222a5d415c0a7e1303a8c0d775 | |
parent | 209ee3cd052b22b4cc32aecbc4b03cb8fb229a23 (diff) | |
download | qmk_firmware-de57799530d3184722532f93d156364067d8fcd5.tar.gz qmk_firmware-de57799530d3184722532f93d156364067d8fcd5.zip |
brings alps64 up-to-date (needs testing)
-rw-r--r-- | keyboard/alps64/Makefile | 9 | ||||
-rw-r--r-- | keyboard/alps64/alps64.c (renamed from keyboard/alps64/keymap_common.c) | 31 | ||||
-rw-r--r-- | keyboard/alps64/alps64.h (renamed from keyboard/alps64/keymap_common.h) | 21 | ||||
-rw-r--r-- | keyboard/alps64/config.h | 5 | ||||
-rw-r--r-- | keyboard/alps64/keymaps/default.c | 4 | ||||
-rw-r--r-- | keyboard/alps64/keymaps/hasu.c | 4 | ||||
-rw-r--r-- | keyboard/alps64/matrix.c | 5 | ||||
-rw-r--r-- | quantum/matrix.c | 6 | ||||
-rw-r--r-- | quantum/quantum.h | 1 |
9 files changed, 44 insertions, 42 deletions
diff --git a/keyboard/alps64/Makefile b/keyboard/alps64/Makefile index 7634c4280..bd6ecb6b9 100644 --- a/keyboard/alps64/Makefile +++ b/keyboard/alps64/Makefile | |||
@@ -42,14 +42,14 @@ | |||
42 | TARGET = alps64 | 42 | TARGET = alps64 |
43 | 43 | ||
44 | # Directory common source filess exist | 44 | # Directory common source filess exist |
45 | TOP_DIR = ../.. | ||
45 | TMK_DIR = ../../tmk_core | 46 | TMK_DIR = ../../tmk_core |
46 | 47 | ||
47 | # Directory keyboard dependent files exist | 48 | # Directory keyboard dependent files exist |
48 | TARGET_DIR = . | 49 | TARGET_DIR = . |
49 | 50 | ||
50 | # project specific files | 51 | # project specific files |
51 | SRC = keymap_common.c \ | 52 | SRC = alps64.c \ |
52 | matrix.c \ | ||
53 | led.c | 53 | led.c |
54 | 54 | ||
55 | ifdef KEYMAP | 55 | ifdef KEYMAP |
@@ -127,8 +127,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
127 | 127 | ||
128 | # Search Path | 128 | # Search Path |
129 | VPATH += $(TARGET_DIR) | 129 | VPATH += $(TARGET_DIR) |
130 | VPATH += $(TOP_DIR) | ||
130 | VPATH += $(TMK_DIR) | 131 | VPATH += $(TMK_DIR) |
131 | 132 | ||
132 | include $(TMK_DIR)/protocol/lufa.mk | 133 | include $(TOP_DIR)/quantum/quantum.mk |
133 | include $(TMK_DIR)/common.mk | ||
134 | include $(TMK_DIR)/rules.mk | ||
diff --git a/keyboard/alps64/keymap_common.c b/keyboard/alps64/alps64.c index fdb1769e1..dde10c11e 100644 --- a/keyboard/alps64/keymap_common.c +++ b/keyboard/alps64/alps64.c | |||
@@ -14,17 +14,30 @@ GNU General Public License for more details. | |||
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | */ | 16 | */ |
17 | #include "keymap_common.h" | 17 | #include "quantum.h" |
18 | 18 | ||
19 | #define LED_ON() do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0) | ||
20 | #define LED_OFF() do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0) | ||
21 | #define LED_TGL() do { DDRC |= (1<<5); PINC |= (1<<5); } while (0) | ||
19 | 22 | ||
20 | /* translates key to keycode */ | 23 | __attribute__ ((weak)) |
21 | uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) | 24 | void matrix_init_user(void) { |
22 | { | 25 | |
23 | return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); | 26 | } |
27 | |||
28 | __attribute__ ((weak)) | ||
29 | void matrix_scan_user(void) { | ||
30 | |||
31 | } | ||
32 | |||
33 | void matrix_init_kb(void) { | ||
34 | LED_ON(); | ||
35 | _delay_ms(500); | ||
36 | LED_OFF(); | ||
37 | |||
38 | matrix_init_user(); | ||
24 | } | 39 | } |
25 | 40 | ||
26 | /* translates Fn keycode to action */ | 41 | void matrix_scan_kb(void) { |
27 | action_t keymap_fn_to_action(uint8_t keycode) | 42 | matrix_scan_user(); |
28 | { | ||
29 | return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; | ||
30 | } | 43 | } |
diff --git a/keyboard/alps64/keymap_common.h b/keyboard/alps64/alps64.h index 957db5792..d0777201e 100644 --- a/keyboard/alps64/keymap_common.h +++ b/keyboard/alps64/alps64.h | |||
@@ -14,25 +14,10 @@ GNU General Public License for more details. | |||
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | */ | 16 | */ |
17 | #ifndef KEYMAP_COMMON_H | 17 | #ifndef ALPS64_H |
18 | #define KEYMAP_COMMON_H | 18 | #define ALPS64_H |
19 | |||
20 | #include <stdint.h> | ||
21 | #include <stdbool.h> | ||
22 | #include <avr/pgmspace.h> | ||
23 | #include "keycode.h" | ||
24 | #include "action.h" | ||
25 | #include "action_macro.h" | ||
26 | #include "report.h" | ||
27 | #include "host.h" | ||
28 | #include "print.h" | ||
29 | #include "debug.h" | ||
30 | #include "keymap.h" | ||
31 | |||
32 | |||
33 | extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; | ||
34 | extern const uint16_t fn_actions[]; | ||
35 | 19 | ||
20 | #include "quantum.h" | ||
36 | 21 | ||
37 | /* Alps64 keymap definition macro */ | 22 | /* Alps64 keymap definition macro */ |
38 | #define KEYMAP( \ | 23 | #define KEYMAP( \ |
diff --git a/keyboard/alps64/config.h b/keyboard/alps64/config.h index 824d3e830..858a82ecd 100644 --- a/keyboard/alps64/config.h +++ b/keyboard/alps64/config.h | |||
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
18 | #ifndef CONFIG_H | 18 | #ifndef CONFIG_H |
19 | #define CONFIG_H | 19 | #define CONFIG_H |
20 | 20 | ||
21 | #include "config_common.h" | ||
21 | 22 | ||
22 | /* USB Device descriptor parameter */ | 23 | /* USB Device descriptor parameter */ |
23 | #define VENDOR_ID 0xFEED | 24 | #define VENDOR_ID 0xFEED |
@@ -31,6 +32,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
31 | #define MATRIX_ROWS 8 | 32 | #define MATRIX_ROWS 8 |
32 | #define MATRIX_COLS 8 | 33 | #define MATRIX_COLS 8 |
33 | 34 | ||
35 | #define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } | ||
36 | #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5, D6, C2 } | ||
37 | #define UNUSED_PINS | ||
38 | |||
34 | /* define if matrix has ghost */ | 39 | /* define if matrix has ghost */ |
35 | //#define MATRIX_HAS_GHOST | 40 | //#define MATRIX_HAS_GHOST |
36 | 41 | ||
diff --git a/keyboard/alps64/keymaps/default.c b/keyboard/alps64/keymaps/default.c index a54899196..2c45dc7f3 100644 --- a/keyboard/alps64/keymaps/default.c +++ b/keyboard/alps64/keymaps/default.c | |||
@@ -1,6 +1,6 @@ | |||
1 | #include "keymap_common.h" | 1 | #include "alps64.h" |
2 | 2 | ||
3 | const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
4 | /* 0: qwerty */ | 4 | /* 0: qwerty */ |
5 | KEYMAP( \ | 5 | KEYMAP( \ |
6 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS, BSPC, \ | 6 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS, BSPC, \ |
diff --git a/keyboard/alps64/keymaps/hasu.c b/keyboard/alps64/keymaps/hasu.c index d297d72fe..e93dd0d41 100644 --- a/keyboard/alps64/keymaps/hasu.c +++ b/keyboard/alps64/keymaps/hasu.c | |||
@@ -1,9 +1,9 @@ | |||
1 | #include "keymap_common.h" | 1 | #include "alps64.h" |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Hasu | 4 | * Hasu |
5 | */ | 5 | */ |
6 | const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 6 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
7 | /* Default Layer | 7 | /* Default Layer |
8 | * ,-----------------------------------------------------------. | 8 | * ,-----------------------------------------------------------. |
9 | * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | | 9 | * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | |
diff --git a/keyboard/alps64/matrix.c b/keyboard/alps64/matrix.c index 5638d7f69..805999d4a 100644 --- a/keyboard/alps64/matrix.c +++ b/keyboard/alps64/matrix.c | |||
@@ -55,10 +55,6 @@ uint8_t matrix_cols(void) | |||
55 | return MATRIX_COLS; | 55 | return MATRIX_COLS; |
56 | } | 56 | } |
57 | 57 | ||
58 | #define LED_ON() do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0) | ||
59 | #define LED_OFF() do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0) | ||
60 | #define LED_TGL() do { DDRC |= (1<<5); PINC |= (1<<5); } while (0) | ||
61 | |||
62 | void matrix_init(void) | 58 | void matrix_init(void) |
63 | { | 59 | { |
64 | // initialize row and col | 60 | // initialize row and col |
@@ -160,6 +156,7 @@ static void unselect_rows(void) | |||
160 | PORTC &= ~0b00000100; | 156 | PORTC &= ~0b00000100; |
161 | } | 157 | } |
162 | 158 | ||
159 | |||
163 | static void select_row(uint8_t row) | 160 | static void select_row(uint8_t row) |
164 | { | 161 | { |
165 | // Output low(DDR:1, PORT:0) to select | 162 | // Output low(DDR:1, PORT:0) to select |
diff --git a/quantum/matrix.c b/quantum/matrix.c index d5fd7def8..412662a79 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c | |||
@@ -68,8 +68,10 @@ uint8_t matrix_cols(void) { | |||
68 | 68 | ||
69 | void matrix_init(void) { | 69 | void matrix_init(void) { |
70 | /* frees PORTF by setting the JTD bit twice within four cycles */ | 70 | /* frees PORTF by setting the JTD bit twice within four cycles */ |
71 | MCUCR |= _BV(JTD); | 71 | #ifdef __AVR_ATmega32U4__ |
72 | MCUCR |= _BV(JTD); | 72 | MCUCR |= _BV(JTD); |
73 | MCUCR |= _BV(JTD); | ||
74 | #endif | ||
73 | /* initializes the I/O pins */ | 75 | /* initializes the I/O pins */ |
74 | #if DIODE_DIRECTION == COL2ROW | 76 | #if DIODE_DIRECTION == COL2ROW |
75 | for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { | 77 | for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { |
diff --git a/quantum/quantum.h b/quantum/quantum.h index 69a0d8126..71533f48b 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "eeconfig.h" | 23 | #include "eeconfig.h" |
24 | #include <stddef.h> | 24 | #include <stddef.h> |
25 | #include <avr/io.h> | 25 | #include <avr/io.h> |
26 | #include <util/delay.h> | ||
26 | 27 | ||
27 | extern uint32_t default_layer_state; | 28 | extern uint32_t default_layer_state; |
28 | 29 | ||