aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kannan <andrew.kannan@gmail.com>2019-05-19 13:03:06 -0400
committerDrashna Jaelre <drashna@live.com>2019-05-19 10:03:06 -0700
commite8372692c58c3e731a7ccef58ddeaa45e2e71e9f (patch)
tree205959b182c1a2eb5ab996571099082993e84463
parentb479eff94013c32b6f3f926a23b7e4a6cf7a3a6e (diff)
downloadqmk_firmware-e8372692c58c3e731a7ccef58ddeaa45e2e71e9f.tar.gz
qmk_firmware-e8372692c58c3e731a7ccef58ddeaa45e2e71e9f.zip
[Keyboard] Instant60 VIA Support (#5909)
* VIA Support for Instant60 * Backlighting updates * Update default keymap * Add Standard layout default VIA supported layout * Clean up some backslashes * Add info.json * Update info json metadata * add info.json for practice65 * Update keyboards/cannonkeys/instant60/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/cannonkeys/practice65/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/cannonkeys/instant60/keymaps/via/keymap.c Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update keyboards/cannonkeys/instant60/keymaps/via_standard/keymap.c Co-Authored-By: fauxpark <fauxpark@gmail.com> * Remove unused enum
-rw-r--r--keyboards/cannonkeys/instant60/config.h12
-rw-r--r--keyboards/cannonkeys/instant60/info.json15
-rw-r--r--keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c8
-rw-r--r--keyboards/cannonkeys/instant60/keymaps/via/keymap.c43
-rw-r--r--keyboards/cannonkeys/instant60/keymaps/via/rules.mk5
-rw-r--r--keyboards/cannonkeys/instant60/keymaps/via_standard/keymap.c43
-rw-r--r--keyboards/cannonkeys/instant60/keymaps/via_standard/rules.mk5
-rw-r--r--keyboards/cannonkeys/practice65/info.json12
-rw-r--r--keyboards/cannonkeys/stm32f072/keyboard.c182
-rw-r--r--keyboards/cannonkeys/stm32f072/led.c3
10 files changed, 317 insertions, 11 deletions
diff --git a/keyboards/cannonkeys/instant60/config.h b/keyboards/cannonkeys/instant60/config.h
index d7554c172..095384fb9 100644
--- a/keyboards/cannonkeys/instant60/config.h
+++ b/keyboards/cannonkeys/instant60/config.h
@@ -66,12 +66,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
66// Bump this every time we change what we store 66// Bump this every time we change what we store
67// This will automatically reset the EEPROM with defaults 67// This will automatically reset the EEPROM with defaults
68// and avoid loading invalid data from the EEPROM 68// and avoid loading invalid data from the EEPROM
69#define EEPROM_VERSION 0x01 69#define EEPROM_VERSION 0x02
70#define EEPROM_VERSION_ADDR 34 70#define EEPROM_VERSION_ADDR 34
71 71
72#define EEPROM_CUSTOM_BACKLIGHT 804
73
74 72
73#define DYNAMIC_KEYMAP_LAYER_COUNT 4
74// Dynamic macro starts after dynamic keymaps (35+(4*5*15*2)) = (35+600) = 635
75// start + layer * rows * col * 2
76#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
77#define EEPROM_CUSTOM_BACKLIGHT 636
78#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 637
79#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 200
80#define DYNAMIC_KEYMAP_MACRO_COUNT 16
75 81
76/* 82/*
77 * Feature disable options 83 * Feature disable options
diff --git a/keyboards/cannonkeys/instant60/info.json b/keyboards/cannonkeys/instant60/info.json
new file mode 100644
index 000000000..73a64b8b3
--- /dev/null
+++ b/keyboards/cannonkeys/instant60/info.json
@@ -0,0 +1,15 @@
1{
2 "keyboard_name": "Instant60",
3 "url": "https://cannonkeys.com",
4 "maintainer": "awkannan",
5 "width": 15,
6 "height": 5,
7 "layouts": {
8 "LAYOUT_ansi": {
9 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
10 },
11 "LAYOUT_tsangan": {
12 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
13 }
14 }
15}
diff --git a/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c b/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c
index e95ac1b69..c16c50630 100644
--- a/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c
+++ b/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c
@@ -31,18 +31,18 @@ enum custom_keycodes {
31 31
32const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 32const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
33 [_BASE] = LAYOUT_tsangan( 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, \ 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_BSLS, 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, \ 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_BSPC, \
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, \
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),\ 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 38 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL
39 ), 39 ),
40 40
41 [_FN1] = LAYOUT_tsangan( 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, _______,\ 42 KC_GRV, 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, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
45 BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ 45 BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
46 KC_GRV, _______, _______, _______, _______, _______, RESET 46 _______, _______, _______, _______, _______, _______, RESET
47 ) 47 )
48}; 48};
diff --git a/keyboards/cannonkeys/instant60/keymaps/via/keymap.c b/keyboards/cannonkeys/instant60/keymaps/via/keymap.c
new file mode 100644
index 000000000..9be7d187e
--- /dev/null
+++ b/keyboards/cannonkeys/instant60/keymaps/via/keymap.c
@@ -0,0 +1,43 @@
1/*
2Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include QMK_KEYBOARD_H
18
19
20// Each layer gets a name for readability, which is then used in the keymap matrix below.
21// The underscores don't mean anything - you can have a layer called STUFF or any other name.
22// Layer names don't all need to be of the same length, obviously, and you can also skip them
23// entirely and just use numbers.
24#define _BASE 0
25#define _FN1 1
26
27const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
28 [_BASE] = LAYOUT_all(
29 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_BSLS, KC_DEL,
30 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_BSPC,
31 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,
32 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),
33 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL
34 ),
35
36 [_FN1] = LAYOUT_all(
37 KC_GRV, 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, _______,
38 RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
39 BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,
40 BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
41 _______, _______, _______, _______, _______, _______, _______, RESET
42 )
43};
diff --git a/keyboards/cannonkeys/instant60/keymaps/via/rules.mk b/keyboards/cannonkeys/instant60/keymaps/via/rules.mk
new file mode 100644
index 000000000..d12497792
--- /dev/null
+++ b/keyboards/cannonkeys/instant60/keymaps/via/rules.mk
@@ -0,0 +1,5 @@
1# rules.mk overrides to enable VIA
2
3RAW_ENABLE = yes
4DYNAMIC_KEYMAP_ENABLE = yes
5
diff --git a/keyboards/cannonkeys/instant60/keymaps/via_standard/keymap.c b/keyboards/cannonkeys/instant60/keymaps/via_standard/keymap.c
new file mode 100644
index 000000000..b182ac5f4
--- /dev/null
+++ b/keyboards/cannonkeys/instant60/keymaps/via_standard/keymap.c
@@ -0,0 +1,43 @@
1/*
2Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include QMK_KEYBOARD_H
18
19
20// Each layer gets a name for readability, which is then used in the keymap matrix below.
21// The underscores don't mean anything - you can have a layer called STUFF or any other name.
22// Layer names don't all need to be of the same length, obviously, and you can also skip them
23// entirely and just use numbers.
24#define _BASE 0
25#define _FN1 1
26
27const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
28 [_BASE] = LAYOUT_all(
29 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,
30 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,
31 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,
32 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),
33 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL
34 ),
35
36 [_FN1] = LAYOUT_all(
37 KC_GRV, 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, _______,
38 RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
39 BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,
40 BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
41 _______, _______, _______, _______, _______, _______, _______, RESET
42 )
43};
diff --git a/keyboards/cannonkeys/instant60/keymaps/via_standard/rules.mk b/keyboards/cannonkeys/instant60/keymaps/via_standard/rules.mk
new file mode 100644
index 000000000..d12497792
--- /dev/null
+++ b/keyboards/cannonkeys/instant60/keymaps/via_standard/rules.mk
@@ -0,0 +1,5 @@
1# rules.mk overrides to enable VIA
2
3RAW_ENABLE = yes
4DYNAMIC_KEYMAP_ENABLE = yes
5
diff --git a/keyboards/cannonkeys/practice65/info.json b/keyboards/cannonkeys/practice65/info.json
new file mode 100644
index 000000000..6c448fda2
--- /dev/null
+++ b/keyboards/cannonkeys/practice65/info.json
@@ -0,0 +1,12 @@
1{
2 "keyboard_name": "Practice65",
3 "url": "https://cannonkeys.com",
4 "maintainer": "awkannan",
5 "width": 16,
6 "height": 5,
7 "layouts": {
8 "LAYOUT_default": {
9 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}]
10 }
11 }
12}
diff --git a/keyboards/cannonkeys/stm32f072/keyboard.c b/keyboards/cannonkeys/stm32f072/keyboard.c
index f94ecb5fb..02c6dae18 100644
--- a/keyboards/cannonkeys/stm32f072/keyboard.c
+++ b/keyboards/cannonkeys/stm32f072/keyboard.c
@@ -5,9 +5,16 @@
5#include "util.h" 5#include "util.h"
6#include "quantum.h" 6#include "quantum.h"
7 7
8#include "ws2812.h"
9
10#include "raw_hid.h"
11#include "dynamic_keymap.h"
8#include "tmk_core/common/eeprom.h" 12#include "tmk_core/common/eeprom.h"
9 13
10#include "ws2812.h" 14// HACK
15#include "keyboards/zeal60/zeal60_api.h" // Temporary hack
16#include "keyboards/zeal60/zeal60_keycodes.h" // Temporary hack
17
11 18
12backlight_config_t kb_backlight_config = { 19backlight_config_t kb_backlight_config = {
13 .enable = true, 20 .enable = true,
@@ -41,6 +48,17 @@ void load_custom_config(){
41 kb_backlight_config.raw = eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_BACKLIGHT); 48 kb_backlight_config.raw = eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_BACKLIGHT);
42} 49}
43 50
51#ifdef DYNAMIC_KEYMAP_ENABLE
52void dynamic_keymap_custom_reset(void){
53 void *p = (void*)(EEPROM_CUSTOM_BACKLIGHT);
54 void *end = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR);
55 while ( p != end ) {
56 eeprom_update_byte(p, 0);
57 ++p;
58 }
59}
60#endif
61
44void eeprom_init_kb(void) 62void eeprom_init_kb(void)
45{ 63{
46 // If the EEPROM has the magic, the data is good. 64 // If the EEPROM has the magic, the data is good.
@@ -48,9 +66,17 @@ void eeprom_init_kb(void)
48 if (eeprom_is_valid()) { 66 if (eeprom_is_valid()) {
49 load_custom_config(); 67 load_custom_config();
50 } else { 68 } else {
69#ifdef DYNAMIC_KEYMAP_ENABLE
70 // This resets the keymaps in EEPROM to what is in flash.
71 dynamic_keymap_reset();
72 // This resets the macros in EEPROM to nothing.
73 dynamic_keymap_macro_reset();
74 // Reset the custom stuff
75 dynamic_keymap_custom_reset();
76#endif
51 // Save the magic number last, in case saving was interrupted 77 // Save the magic number last, in case saving was interrupted
78 save_backlight_config_to_eeprom();
52 eeprom_set_valid(true); 79 eeprom_set_valid(true);
53 save_backlight_config_to_eeprom();
54 } 80 }
55} 81}
56 82
@@ -120,6 +146,158 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
120 save_backlight_config_to_eeprom(); 146 save_backlight_config_to_eeprom();
121 } 147 }
122 return false; 148 return false;
149 default:
150 break;
123 } 151 }
152
153 #ifdef DYNAMIC_KEYMAP_ENABLE
154 // Handle macros
155 if (record->event.pressed) {
156 if ( keycode >= MACRO00 && keycode <= MACRO15 )
157 {
158 uint8_t id = keycode - MACRO00;
159 dynamic_keymap_macro_send(id);
160 return false;
161 }
162 }
163 #endif //DYNAMIC_KEYMAP_ENABLE
164
124 return true; 165 return true;
125} 166}
167
168
169// Start Dynamic Keymap code
170#ifdef RAW_ENABLE
171
172void raw_hid_receive( uint8_t *data, uint8_t length )
173{
174 uint8_t *command_id = &(data[0]);
175 uint8_t *command_data = &(data[1]);
176 switch ( *command_id )
177 {
178 case id_get_protocol_version:
179 {
180 command_data[0] = PROTOCOL_VERSION >> 8;
181 command_data[1] = PROTOCOL_VERSION & 0xFF;
182 break;
183 }
184 case id_get_keyboard_value:
185 {
186 switch( command_data[0])
187 {
188 case id_uptime:
189 {
190 uint32_t value = timer_read32();
191 command_data[1] = (value >> 24 ) & 0xFF;
192 command_data[2] = (value >> 16 ) & 0xFF;
193 command_data[3] = (value >> 8 ) & 0xFF;
194 command_data[4] = value & 0xFF;
195 break;
196 }
197 default:
198 {
199 *command_id = id_unhandled;
200 break;
201 }
202 }
203 break;
204 }
205#ifdef DYNAMIC_KEYMAP_ENABLE
206
207 case id_dynamic_keymap_get_keycode:
208 {
209 uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] );
210 command_data[3] = keycode >> 8;
211 command_data[4] = keycode & 0xFF;
212 break;
213 }
214 case id_dynamic_keymap_set_keycode:
215 {
216 dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] );
217 break;
218 }
219 case id_dynamic_keymap_reset:
220 {
221 dynamic_keymap_reset();
222 break;
223 }
224 case id_dynamic_keymap_macro_get_count:
225 {
226 command_data[0] = dynamic_keymap_macro_get_count();
227 break;
228 }
229 case id_dynamic_keymap_macro_get_buffer_size:
230 {
231 uint16_t size = dynamic_keymap_macro_get_buffer_size();
232 command_data[0] = size >> 8;
233 command_data[1] = size & 0xFF;
234 break;
235 }
236 case id_dynamic_keymap_macro_get_buffer:
237 {
238 uint16_t offset = ( command_data[0] << 8 ) | command_data[1];
239 uint16_t size = command_data[2]; // size <= 28
240 dynamic_keymap_macro_get_buffer( offset, size, &command_data[3] );
241 break;
242 }
243 case id_dynamic_keymap_macro_set_buffer:
244 {
245 uint16_t offset = ( command_data[0] << 8 ) | command_data[1];
246 uint16_t size = command_data[2]; // size <= 28
247 dynamic_keymap_macro_set_buffer( offset, size, &command_data[3] );
248 break;
249 }
250 case id_dynamic_keymap_macro_reset:
251 {
252 dynamic_keymap_macro_reset();
253 break;
254 }
255 case id_dynamic_keymap_get_layer_count:
256 {
257 command_data[0] = dynamic_keymap_get_layer_count();
258 break;
259 }
260 case id_dynamic_keymap_get_buffer:
261 {
262 uint16_t offset = ( command_data[0] << 8 ) | command_data[1];
263 uint16_t size = command_data[2]; // size <= 28
264 dynamic_keymap_get_buffer( offset, size, &command_data[3] );
265 break;
266 }
267 case id_dynamic_keymap_set_buffer:
268 {
269 uint16_t offset = ( command_data[0] << 8 ) | command_data[1];
270 uint16_t size = command_data[2]; // size <= 28
271 dynamic_keymap_set_buffer( offset, size, &command_data[3] );
272 break;
273 }
274#endif // DYNAMIC_KEYMAP_ENABLE
275 case id_eeprom_reset:
276 {
277 eeprom_reset();
278 break;
279 }
280 case id_bootloader_jump:
281 {
282 // Need to send data back before the jump
283 // Informs host that the command is handled
284 raw_hid_send( data, length );
285 // Give host time to read it
286 wait_ms(100);
287 bootloader_jump();
288 break;
289 }
290 default:
291 {
292 // Unhandled message.
293 *command_id = id_unhandled;
294 break;
295 }
296 }
297
298 // Return same buffer with values changed
299 raw_hid_send( data, length );
300
301}
302
303#endif
diff --git a/keyboards/cannonkeys/stm32f072/led.c b/keyboards/cannonkeys/stm32f072/led.c
index d69d94685..5c7df47da 100644
--- a/keyboards/cannonkeys/stm32f072/led.c
+++ b/keyboards/cannonkeys/stm32f072/led.c
@@ -77,10 +77,9 @@ void backlight_init_ports(void) {
77 pwmStart(&PWMD3, &pwmCFG); 77 pwmStart(&PWMD3, &pwmCFG);
78 // pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3, 0xFFFF,cie_lightness(0xFFFF))); 78 // pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3, 0xFFFF,cie_lightness(0xFFFF)));
79 if(kb_backlight_config.enable){ 79 if(kb_backlight_config.enable){
80 backlight_set(kb_backlight_config.level);
80 if(kb_backlight_config.breathing){ 81 if(kb_backlight_config.breathing){
81 breathing_enable(); 82 breathing_enable();
82 } else{
83 backlight_set(kb_backlight_config.level);
84 } 83 }
85 } else { 84 } else {
86 backlight_set(0); 85 backlight_set(0);