diff options
| -rw-r--r-- | keyboards/cannonkeys/instant60/instant60.h | 46 | ||||
| -rw-r--r-- | keyboards/cannonkeys/instant60/keymaps/default/keymap.c | 4 | ||||
| -rw-r--r-- | keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c | 48 | ||||
| -rw-r--r-- | keyboards/cannonkeys/stm32f072/keyboard.c | 7 |
4 files changed, 94 insertions, 11 deletions
diff --git a/keyboards/cannonkeys/instant60/instant60.h b/keyboards/cannonkeys/instant60/instant60.h index cca1b9a29..67d5ba98f 100644 --- a/keyboards/cannonkeys/instant60/instant60.h +++ b/keyboards/cannonkeys/instant60/instant60.h | |||
| @@ -2,16 +2,46 @@ | |||
| 2 | 2 | ||
| 3 | #include "quantum.h" | 3 | #include "quantum.h" |
| 4 | 4 | ||
| 5 | #define LAYOUT_default( \ | 5 | #define KNO KC_NO |
| 6 | |||
| 7 | #define LAYOUT_ansi( \ | ||
| 6 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ | 8 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ |
| 7 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ | 9 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ |
| 8 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ | 10 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ |
| 9 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ | 11 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ |
| 10 | K40, K41, K42, K45, K49, K4A, K4B, K4E \ | 12 | K40, K41, K42, K45, K49, K4A, K4B, K4E \ |
| 13 | ) { \ | ||
| 14 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KNO}, \ | ||
| 15 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ | ||
| 16 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ | ||
| 17 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, KNO }, \ | ||
| 18 | { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, K4A, K4B, KNO, KNO, K4E } \ | ||
| 19 | } | ||
| 20 | |||
| 21 | #define LAYOUT_tsangan( \ | ||
| 22 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ | ||
| 23 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ | ||
| 24 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ | ||
| 25 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E,\ | ||
| 26 | K40, K41, K42, K45, K49, K4B, K4E \ | ||
| 27 | ) { \ | ||
| 28 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ | ||
| 29 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ | ||
| 30 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ | ||
| 31 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, K3E }, \ | ||
| 32 | { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, KNO, K4B, KNO, KNO, K4E } \ | ||
| 33 | } | ||
| 34 | |||
| 35 | #define LAYOUT_all( \ | ||
| 36 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ | ||
| 37 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ | ||
| 38 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ | ||
| 39 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E,\ | ||
| 40 | K40, K41, K42, K45, K49, K4A, K4B, K4E \ | ||
| 11 | ) { \ | 41 | ) { \ |
| 12 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KC_NO}, \ | 42 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ |
| 13 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO, K1E }, \ | 43 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ |
| 14 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, KC_NO, K2E }, \ | 44 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ |
| 15 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, KC_NO, KC_NO }, \ | 45 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, K3E }, \ |
| 16 | { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, KC_NO, KC_NO, K4E } \ | 46 | { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, K4A, K4B, KNO, KNO, K4E } \ |
| 17 | } | 47 | } |
diff --git a/keyboards/cannonkeys/instant60/keymaps/default/keymap.c b/keyboards/cannonkeys/instant60/keymaps/default/keymap.c index e898a3f3b..7753181a4 100644 --- a/keyboards/cannonkeys/instant60/keymaps/default/keymap.c +++ b/keyboards/cannonkeys/instant60/keymaps/default/keymap.c | |||
| @@ -30,7 +30,7 @@ enum custom_keycodes { | |||
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 32 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 33 | [_BASE] = LAYOUT_default( | 33 | [_BASE] = LAYOUT_ansi( |
| 34 | KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ | 34 | KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ |
| 35 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ | 35 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ |
| 36 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ | 36 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ |
| @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 38 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL | 38 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL |
| 39 | ), | 39 | ), |
| 40 | 40 | ||
| 41 | [_FN1] = LAYOUT_default( | 41 | [_FN1] = LAYOUT_ansi( |
| 42 | KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ | 42 | KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ |
| 43 | RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 43 | RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ |
| 44 | BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 44 | BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ |
diff --git a/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c b/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c new file mode 100644 index 000000000..e95ac1b69 --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012,2013 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 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/>. | ||
| 16 | */ | ||
| 17 | #include QMK_KEYBOARD_H | ||
| 18 | |||
| 19 | extern keymap_config_t keymap_config; | ||
| 20 | |||
| 21 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 22 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 23 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 24 | // entirely and just use numbers. | ||
| 25 | #define _BASE 0 | ||
| 26 | #define _FN1 1 | ||
| 27 | |||
| 28 | enum custom_keycodes { | ||
| 29 | QWERTY = SAFE_RANGE, | ||
| 30 | }; | ||
| 31 | |||
| 32 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 33 | [_BASE] = LAYOUT_tsangan( | ||
| 34 | KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ | ||
| 35 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ | ||
| 36 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ | ||
| 37 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN1),\ | ||
| 38 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL | ||
| 39 | ), | ||
| 40 | |||
| 41 | [_FN1] = LAYOUT_tsangan( | ||
| 42 | KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______,\ | ||
| 43 | RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 44 | BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 45 | BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ | ||
| 46 | KC_GRV, _______, _______, _______, _______, _______, RESET | ||
| 47 | ) | ||
| 48 | }; | ||
diff --git a/keyboards/cannonkeys/stm32f072/keyboard.c b/keyboards/cannonkeys/stm32f072/keyboard.c index 4316d5186..f94ecb5fb 100644 --- a/keyboards/cannonkeys/stm32f072/keyboard.c +++ b/keyboards/cannonkeys/stm32f072/keyboard.c | |||
| @@ -15,7 +15,6 @@ backlight_config_t kb_backlight_config = { | |||
| 15 | .level = BACKLIGHT_LEVELS | 15 | .level = BACKLIGHT_LEVELS |
| 16 | }; | 16 | }; |
| 17 | 17 | ||
| 18 | |||
| 19 | bool eeprom_is_valid(void) | 18 | bool eeprom_is_valid(void) |
| 20 | { | 19 | { |
| 21 | return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && | 20 | return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && |
| @@ -51,9 +50,13 @@ void eeprom_init_kb(void) | |||
| 51 | } else { | 50 | } else { |
| 52 | // Save the magic number last, in case saving was interrupted | 51 | // Save the magic number last, in case saving was interrupted |
| 53 | eeprom_set_valid(true); | 52 | eeprom_set_valid(true); |
| 53 | save_backlight_config_to_eeprom(); | ||
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | __attribute__ ((weak)) | ||
| 58 | void matrix_init_board(void); | ||
| 59 | |||
| 57 | void matrix_init_kb(void){ | 60 | void matrix_init_kb(void){ |
| 58 | eeprom_init_kb(); | 61 | eeprom_init_kb(); |
| 59 | /* MOSI pin*/ | 62 | /* MOSI pin*/ |
| @@ -64,6 +67,8 @@ void matrix_init_kb(void){ | |||
| 64 | leds_init(); | 67 | leds_init(); |
| 65 | #endif | 68 | #endif |
| 66 | backlight_init_ports(); | 69 | backlight_init_ports(); |
| 70 | |||
| 71 | matrix_init_board(); | ||
| 67 | } | 72 | } |
| 68 | 73 | ||
| 69 | void matrix_scan_kb(void) | 74 | void matrix_scan_kb(void) |
