aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--keyboards/atreus62/atreus62.h38
-rw-r--r--keyboards/ergodox/keymaps/italian/keymap.c223
-rw-r--r--keyboards/ergodox/keymaps/italian/readme.md72
-rw-r--r--keyboards/frosty_flake/Makefile (renamed from keyboards/lets_split/rev2fliphalf/Makefile)2
-rw-r--r--keyboards/frosty_flake/config.h147
-rw-r--r--keyboards/frosty_flake/frosty_flake.c63
-rw-r--r--keyboards/frosty_flake/frosty_flake.h50
-rw-r--r--keyboards/frosty_flake/keymaps/default/Makefile21
-rw-r--r--keyboards/frosty_flake/keymaps/default/config.h8
-rw-r--r--keyboards/frosty_flake/keymaps/default/keymap.c11
-rw-r--r--keyboards/frosty_flake/keymaps/default/readme.md1
-rw-r--r--keyboards/frosty_flake/matrix.c135
-rw-r--r--keyboards/frosty_flake/readme.md32
-rw-r--r--keyboards/frosty_flake/rules.mk71
-rw-r--r--keyboards/lets_split/common/glcdfont.c276
-rw-r--r--keyboards/lets_split/i2c.h20
-rw-r--r--keyboards/lets_split/keymaps/OLED_sample/Makefile25
-rw-r--r--keyboards/lets_split/keymaps/OLED_sample/config.h45
-rw-r--r--keyboards/lets_split/keymaps/OLED_sample/keymap.c356
-rw-r--r--keyboards/lets_split/keymaps/OLED_sample/readme.md25
-rw-r--r--keyboards/lets_split/matrix.c2
-rw-r--r--keyboards/lets_split/rev2/rev2.c8
-rw-r--r--keyboards/lets_split/rev2/rev2.h59
-rw-r--r--keyboards/lets_split/rev2fliphalf/config.h91
-rw-r--r--keyboards/lets_split/rev2fliphalf/rev2fliphalf.c32
-rw-r--r--keyboards/lets_split/rev2fliphalf/rev2fliphalf.h28
-rw-r--r--keyboards/lets_split/rev2fliphalf/rules.mk5
-rw-r--r--keyboards/lets_split/rules.mk15
-rw-r--r--keyboards/lets_split/split_util.c5
-rw-r--r--keyboards/lets_split/split_util.h2
-rw-r--r--keyboards/lets_split/ssd1306.c468
-rw-r--r--keyboards/tada68/keymaps/default/keymap.c66
-rw-r--r--keyboards/tada68/keymaps/default/readme.md2
-rw-r--r--keyboards/tada68/readme.md15
-rw-r--r--keyboards/xd60/keymaps/cheese/README.md13
-rw-r--r--keyboards/xd60/keymaps/cheese/base_layout.pngbin0 -> 23729 bytes
-rw-r--r--keyboards/xd60/keymaps/cheese/fn_layout.pngbin0 -> 20690 bytes
-rw-r--r--keyboards/xd60/keymaps/cheese/keymap.c67
-rw-r--r--quantum/quantum.c8
-rw-r--r--quantum/quantum_keycodes.h3
-rw-r--r--tmk_core/common.mk14
-rw-r--r--tmk_core/protocol/lufa.mk12
-rw-r--r--tmk_core/protocol/lufa/adafruit_ble.h4
-rw-r--r--tmk_core/protocol/lufa/lufa.c73
-rw-r--r--tmk_core/protocol/lufa/outputselect.c6
-rw-r--r--tmk_core/protocol/lufa/outputselect.h1
47 files changed, 2307 insertions, 314 deletions
diff --git a/.gitignore b/.gitignore
index f66a961fd..6029afce4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
1.dep 1.dep
2*.o 2*.o
3*.bin
3*.eep 4*.eep
4*.elf 5*.elf
5*.hex 6*.hex
diff --git a/keyboards/atreus62/atreus62.h b/keyboards/atreus62/atreus62.h
index eacf5b451..ca5cda8a8 100644
--- a/keyboards/atreus62/atreus62.h
+++ b/keyboards/atreus62/atreus62.h
@@ -9,18 +9,34 @@ void promicro_bootloader_jmp(bool program);
9// The first section contains all of the arguements 9// The first section contains all of the arguements
10// The second converts the arguments into a two-dimensional array 10// The second converts the arguments into a two-dimensional array
11#define KEYMAP( \ 11#define KEYMAP( \
12 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ 12 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
13 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ 13 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
14 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ 14 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
15 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ 15 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \
16 k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \ 16 k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \
17) \ 17) \
18{ \ 18{ \
19 { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \ 19 { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \
20 { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \ 20 { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \
21 { k20, k21, k22, k23, k24, k25, KC_NO, k26, k27, k28, k29, k2a, k2b }, \ 21 { k20, k21, k22, k23, k24, k25, KC_NO, k26, k27, k28, k29, k2a, k2b }, \
22 { k30, k31, k32, k33, k34, k35, k46, k36, k37, k38, k39, k3a, k3b }, \ 22 { k30, k31, k32, k33, k34, k35, k46, k36, k37, k38, k39, k3a, k3b }, \
23 { k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b, k4c, k4d } \ 23 { k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b, k4c, k4d } \
24} 24}
25 25
26#endif \ No newline at end of file 26// Used to create a keymap using only KC_ prefixed keys.
27#define KC_KEYMAP( \
28 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
29 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
30 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
31 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \
32 k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \
33) \
34{ \
35 { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_NO, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \
36 { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_NO, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \
37 { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_NO, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \
38 { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k46, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b }, \
39 { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45, KC_##k47, KC_##k48, KC_##k49, KC_##k4a, KC_##k4b, KC_##k4c, KC_##k4d } \
40}
41
42#endif
diff --git a/keyboards/ergodox/keymaps/italian/keymap.c b/keyboards/ergodox/keymaps/italian/keymap.c
new file mode 100644
index 000000000..e4c7a569c
--- /dev/null
+++ b/keyboards/ergodox/keymaps/italian/keymap.c
@@ -0,0 +1,223 @@
1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4#include "version.h"
5
6#define BASE 0 // default layer
7#define SYMB 1 // symbols
8#define MDIA 2 // media keys
9
10enum custom_keycodes {
11 PLACEHOLDER = SAFE_RANGE, // can always be here
12 EPRM,
13 VRSN,
14 RGB_SLD
15};
16
17const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
18/* Keymap 0: Basic layer
19 *
20 * ,--------------------------------------------------. ,--------------------------------------------------.
21 * | \ | 1 | 2 | 3 | 4 | 5 | ESC | | T2 | 6 | 7 | 8 | 9 | 0 | ' |
22 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
23 * | Tab | Q | W | E | R | T | TT1 | | TT1 | Y | U | I | O | P | è |
24 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
25 * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ò | à |
26 * |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------|
27 * | LShift | Z | X | C | V | B | | | | N | M | , | . | ù |-/RShift|
28 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
29 * |</Win | + | - | * |//Ctr | |ì/RAlt| Left | Down | Up | Right | ~L1 |
30 * `----------------------------------' `----------------------------------'
31 * ,-------------. ,-------------.
32 * | Ins | LGui | | Win | Ctrl |
33 * ,------|------|------| |------+--------+------.
34 * | | | Home | | PgUp | | |
35 * |Backsp| Del |------| |------| Enter |Space |
36 * |ace | | End | | PgDn | | |
37 * `--------------------' `----------------------'
38 */
39// If it accepts an argument (i.e, is a function), it doesn't need KC_.
40// Otherwise, it needs KC_*
41[BASE] = KEYMAP( // layer 0 : default
42 // left hand
43 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
44 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TT(SYMB),
45 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G,
46 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT,
47 MT(MOD_LGUI,KC_NONUS_BSLASH),KC_PPLS, KC_PMNS,KC_PAST,MT(MOD_LCTL,KC_PSLS),
48 KC_INS, KC_LGUI,
49 KC_HOME,
50 KC_BSPC,KC_DEL, KC_END,
51 // right hand
52 TG(MDIA), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
53 TT(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
54 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
55 KC_LALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_BSLASH, MT(MOD_RSFT,KC_SLSH),
56 MT(MOD_RALT,KC_EQL), KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT,
57 KC_LGUI, KC_RCTL,
58 KC_PGUP,
59 KC_PGDN, KC_ENT, KC_SPC
60 ),
61/* Keymap 1: Symbol Layer
62 *
63 * ,--------------------------------------------------. ,--------------------------------------------------.
64 * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
65 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
66 * | | ! | @ | { | } | | | | | | | 7 | 8 | 9 | | F12 |
67 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
68 * | | # | $ | [ | ] | & |------| |------| | 4 | 5 | 6 | | |
69 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
70 * | | % | ^ | ( | ) | | | | | | 1 | 2 | 3 | | |
71 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
72 * | | | | | | | . | | | | |
73 * `----------------------------------' `----------------------------------'
74 * ,-------------. ,-------------.
75 * | | | | | |
76 * ,------|------|------| |------+------+------.
77 * | | | | | | | |
78 * | | |------| |------| | 0 |
79 * | | | | | | | |
80 * `--------------------' `--------------------'
81 */
82// SYMBOLS
83[SYMB] = KEYMAP(
84 // left hand
85 M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
86 KC_TRNS, KC_EXLM, RALT(KC_SCLN), RALT(KC_LCBR), RALT(KC_RCBR), KC_TILD, KC_TRNS,
87 KC_TRNS, RALT(KC_QUOT), KC_DLR, RALT(KC_LBRC), RALT(KC_RBRC), KC_CIRC,
88 KC_TRNS, KC_PERC, LSFT(KC_EQL), LSFT(KC_8), LSFT(KC_9), KC_TRNS, KC_TRNS,
89 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
90 KC_TRNS, KC_TRNS,
91 KC_TRNS,
92 KC_TRNS, KC_TRNS, KC_TRNS,
93 // right hand
94 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
95 KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
96 KC_TRNS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
97 KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
98 KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
99 KC_TRNS, KC_TRNS,
100 KC_TRNS,
101 KC_TRNS, KC_TRNS, KC_0
102),
103/* Keymap 2: Media and mouse keys
104 *
105 * ,--------------------------------------------------. ,--------------------------------------------------.
106 * | | | | | | | | | | | | | | | |
107 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
108 * | | | | MsUp | | | | | | Lclk | Rclk | | | | |
109 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
110 * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
111 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
112 * | | | | | | | | | | | | Prev | Next | | |
113 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
114 * | | | | | | |VolUp |VolDn | Mute | | |
115 * `----------------------------------' `----------------------------------'
116 * ,-------------. ,-------------.
117 * | | | | | |
118 * ,------|------|------| |------+------+------.
119 * | | | | | | |Brwser|
120 * | | |------| |------| |Back |
121 * | | | | | | | |
122 * `--------------------' `--------------------'
123 */
124// MEDIA AND MOUSE
125[MDIA] = KEYMAP(
126 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
127 KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
128 KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
129 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
130 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
131 KC_TRNS, KC_TRNS,
132 KC_TRNS,
133 KC_TRNS, KC_TRNS, KC_TRNS,
134 // right hand
135 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
136 KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
137 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
138 KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
139 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
140 KC_TRNS, KC_TRNS,
141 KC_TRNS,
142 KC_TRNS, KC_TRNS, KC_WBAK
143),
144};
145
146const uint16_t PROGMEM fn_actions[] = {
147 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
148};
149
150const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
151{
152 // MACRODOWN only works in this function
153 switch(id) {
154 case 0:
155 if (record->event.pressed) {
156 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
157 }
158 break;
159 case 1:
160 if (record->event.pressed) { // For resetting EEPROM
161 eeconfig_init();
162 }
163 break;
164 }
165 return MACRO_NONE;
166};
167
168bool process_record_user(uint16_t keycode, keyrecord_t *record) {
169 switch (keycode) {
170 // dynamically generate these.
171 case EPRM:
172 if (record->event.pressed) {
173 eeconfig_init();
174 }
175 return false;
176 break;
177 case VRSN:
178 if (record->event.pressed) {
179 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
180 }
181 return false;
182 break;
183 case RGB_SLD:
184 if (record->event.pressed) {
185 #ifdef RGBLIGHT_ENABLE
186 rgblight_mode(1);
187 #endif
188 }
189 return false;
190 break;
191 }
192 return true;
193}
194
195// Runs just one time when the keyboard initializes.
196void matrix_init_user(void) {
197
198};
199
200
201// Runs constantly in the background, in a loop.
202void matrix_scan_user(void) {
203
204 uint8_t layer = biton32(layer_state);
205
206 ergodox_board_led_off();
207 ergodox_right_led_1_off();
208 ergodox_right_led_2_off();
209 ergodox_right_led_3_off();
210 switch (layer) {
211 // TODO: Make this relevant to the ErgoDox EZ.
212 case 1:
213 ergodox_right_led_1_on();
214 break;
215 case 2:
216 ergodox_right_led_2_on();
217 break;
218 default:
219 // none
220 break;
221 }
222
223};
diff --git a/keyboards/ergodox/keymaps/italian/readme.md b/keyboards/ergodox/keymaps/italian/readme.md
new file mode 100644
index 000000000..215c24a5a
--- /dev/null
+++ b/keyboards/ergodox/keymaps/italian/readme.md
@@ -0,0 +1,72 @@
1# ErgoDox Italian layout
2
3## Layer 0
4```
5
6 ,--------------------------------------------------. ,--------------------------------------------------.
7 | \ | 1 | 2 | 3 | 4 | 5 | ESC | | T2 | 6 | 7 | 8 | 9 | 0 | ' |
8 |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
9 | Tab | Q | W | E | R | T | TT1 | | TT1 | Y | U | I | O | P | è |
10 |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
11 | Caps | A | S | D | F | G |------| |------| H | J | K | L | ò | à |
12 |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------|
13 | LShift | Z | X | C | V | B | | | | N | M | , | . | ù |-/RShift|
14 `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
15 |</Win | + | - | * |//Ctr | |ì/RAlt| Left | Down | Up | Right | ~L1 |
16 `----------------------------------' `----------------------------------'
17 ,-------------. ,-------------.
18 | Ins | LGui | | Win | Ctrl |
19 ,------|------|------| |------+--------+------.
20 | | | Home | | PgUp | | |
21 |Backsp| Del |------| |------| Enter |Space |
22 |ace | | End | | PgDn | | |
23 `--------------------' `----------------------'
24```
25
26## Layer 1
27```
28
29 ,--------------------------------------------------. ,--------------------------------------------------.
30 |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
31 |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
32 | | ! | @ | { | } | | | | | | | 7 | 8 | 9 | | F12 |
33 |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
34 | | # | $ | [ | ] | & |------| |------| | 4 | 5 | 6 | | |
35 |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
36 | | % | ^ | ( | ) | | | | | | 1 | 2 | 3 | | |
37 `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
38 | | | | | | | . | | | | |
39 `----------------------------------' `----------------------------------'
40 ,-------------. ,-------------.
41 | | | | | |
42 ,------|------|------| |------+------+------.
43 | | | | | | | |
44 | | |------| |------| | 0 |
45 | | | | | | | |
46 `--------------------' `--------------------'
47```
48
49## Layer 2
50```
51
52 ,--------------------------------------------------. ,--------------------------------------------------.
53 | | | | | | | | | | | | | | | |
54 |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
55 | | | | MsUp | | | | | | Lclk | Rclk | | | | |
56 |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
57 | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
58 |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
59 | | | | | | | | | | | | Prev | Next | | |
60 `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
61 | | | | | | |VolUp |VolDn | Mute | | |
62 `----------------------------------' `----------------------------------'
63 ,-------------. ,-------------.
64 | | | | | |
65 ,------|------|------| |------+------+------.
66 | | | | | | |Brwser|
67 | | |------| |------| |Back |
68 | | | | | | | |
69 `--------------------' `--------------------'
70```
71
72
diff --git a/keyboards/lets_split/rev2fliphalf/Makefile b/keyboards/frosty_flake/Makefile
index 4e2a6f00f..57b2ef62e 100644
--- a/keyboards/lets_split/rev2fliphalf/Makefile
+++ b/keyboards/frosty_flake/Makefile
@@ -1,3 +1,3 @@
1ifndef MAKEFILE_INCLUDED 1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile 2 include ../../Makefile
3endif \ No newline at end of file 3endif
diff --git a/keyboards/frosty_flake/config.h b/keyboards/frosty_flake/config.h
new file mode 100644
index 000000000..2c73f1074
--- /dev/null
+++ b/keyboards/frosty_flake/config.h
@@ -0,0 +1,147 @@
1/*
2Copyright 2012 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
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x6060
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Bathroom Epiphanies
28#define PRODUCT frosty_flake
29#define DESCRIPTION Frosty Flake controller for the CM Storm Quick Fire Rapid
30
31/*
32 * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies
33 * Ported from the Bathroom Epiphanies TMK Firmware:
34 * https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers
35 *
36 */
37
38/* key matrix size */
39#define MATRIX_ROWS 8 // Row0 - Row7 in the schematic
40#define MATRIX_COLS 18 // ColA - ColR in the schematic
41
42/*
43 * Keyboard Matrix Assignments
44 */
45#define UNUSED_PINS { B0, C4, D3 }
46
47/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
48#define DEBOUNCING_DELAY 5
49
50/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
51#define LOCKING_SUPPORT_ENABLE
52/* Locking resynchronize hack */
53#define LOCKING_RESYNC_ENABLE
54
55/*
56 * Force NKRO
57 *
58 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
59 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
60 * makefile for this to work.)
61 *
62 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
63 * until the next keyboard reset.
64 *
65 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
66 * fully operational during normal computer usage.
67 *
68 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
69 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
70 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
71 * power-up.
72 *
73 */
74//#define FORCE_NKRO
75
76/*
77 * Magic Key Options
78 *
79 * Magic keys are hotkey commands that allow control over firmware functions of
80 * the keyboard. They are best used in combination with the HID Listen program,
81 * found here: https://www.pjrc.com/teensy/hid_listen.html
82 *
83 * The options below allow the magic key functionality to be changed. This is
84 * useful if your keyboard/keypad is missing keys and you want magic key support.
85 *
86 */
87
88/* key combination for magic key command */
89#define IS_COMMAND() ( \
90 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
91)
92
93/* control how magic key switches layers */
94//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
95//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
96//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
97
98/* override magic key keymap */
99//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
100//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
101//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
102//#define MAGIC_KEY_HELP1 H
103//#define MAGIC_KEY_HELP2 SLASH
104//#define MAGIC_KEY_DEBUG D
105//#define MAGIC_KEY_DEBUG_MATRIX X
106//#define MAGIC_KEY_DEBUG_KBD K
107//#define MAGIC_KEY_DEBUG_MOUSE M
108//#define MAGIC_KEY_VERSION V
109//#define MAGIC_KEY_STATUS S
110//#define MAGIC_KEY_CONSOLE C
111//#define MAGIC_KEY_LAYER0_ALT1 ESC
112//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
113//#define MAGIC_KEY_LAYER0 0
114//#define MAGIC_KEY_LAYER1 1
115//#define MAGIC_KEY_LAYER2 2
116//#define MAGIC_KEY_LAYER3 3
117//#define MAGIC_KEY_LAYER4 4
118//#define MAGIC_KEY_LAYER5 5
119//#define MAGIC_KEY_LAYER6 6
120//#define MAGIC_KEY_LAYER7 7
121//#define MAGIC_KEY_LAYER8 8
122//#define MAGIC_KEY_LAYER9 9
123//#define MAGIC_KEY_BOOTLOADER PAUSE
124//#define MAGIC_KEY_LOCK CAPS
125//#define MAGIC_KEY_EEPROM E
126//#define MAGIC_KEY_NKRO N
127//#define MAGIC_KEY_SLEEP_LED Z
128
129/*
130 * Feature disable options
131 * These options are also useful to firmware size reduction.
132 */
133
134/* disable debug print */
135//#define NO_DEBUG
136
137/* disable print */
138//#define NO_PRINT
139
140/* disable action features */
141//#define NO_ACTION_LAYER
142//#define NO_ACTION_TAPPING
143//#define NO_ACTION_ONESHOT
144//#define NO_ACTION_MACRO
145//#define NO_ACTION_FUNCTION
146
147#endif
diff --git a/keyboards/frosty_flake/frosty_flake.c b/keyboards/frosty_flake/frosty_flake.c
new file mode 100644
index 000000000..1cd476038
--- /dev/null
+++ b/keyboards/frosty_flake/frosty_flake.c
@@ -0,0 +1,63 @@
1#include "frosty_flake.h"
2
3void matrix_init_kb(void) {
4 // put your keyboard start-up code here
5 // runs once when the firmware starts up
6
7 matrix_init_user();
8}
9
10void matrix_scan_kb(void) {
11 // put your looping keyboard code here
12 // runs every cycle (a lot)
13
14 matrix_scan_user();
15}
16
17bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
18 // put your per-action keyboard code here
19 // runs for every action, just before processing by the firmware
20
21 return process_record_user(keycode, record);
22}
23
24void led_set_kb(uint8_t usb_led) {
25 DDRB |= (1<<7);
26 DDRC |= (1<<5) | (1<<6);
27
28 print_dec(usb_led);
29
30 if (usb_led & (1<<USB_LED_CAPS_LOCK))
31 PORTC &= ~(1<<5);
32 else
33 PORTC |= (1<<5);
34
35 if (usb_led & (1<<USB_LED_NUM_LOCK))
36 PORTB &= ~(1<<7);
37 else
38 PORTB |= (1<<7);
39
40 if (usb_led & (1<<USB_LED_SCROLL_LOCK))
41 PORTC &= ~(1<<6);
42 else
43 PORTC |= (1<<6);
44
45 led_set_user(usb_led);
46}
47
48__attribute__ ((weak))
49void matrix_init_user(void) {
50}
51
52__attribute__ ((weak))
53void matrix_scan_user(void) {
54}
55
56__attribute__ ((weak))
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 return true;
59}
60
61__attribute__ ((weak))
62void led_set_user(uint8_t usb_led) {
63} \ No newline at end of file
diff --git a/keyboards/frosty_flake/frosty_flake.h b/keyboards/frosty_flake/frosty_flake.h
new file mode 100644
index 000000000..3b52df6ba
--- /dev/null
+++ b/keyboards/frosty_flake/frosty_flake.h
@@ -0,0 +1,50 @@
1#ifndef FROSTY_FLAKE_H
2#define FROSTY_FLAKE_H
3
4#include "quantum.h"
5
6// This a shortcut to help you visually see your layout.
7// The following is an example using the Planck MIT layout
8// The first section contains all of the arguements
9// The second converts the arguments into a two-dimensional array
10
11/*
12 Matrix col/row mapping
13
14 ,----. ,-------------------. ,-------------------. ,-------------------. ,--------------.
15 | J6 | | I4 | H4 | H2 | H6 | | A7 | E6 | D2 | D4 | | B4 | B7 | B6 | B0 | | C7 | C5 | A5 |
16 `----' `-------------------' `-------------------' `-------------------' `--------------'
17 ,-------------------------------------------------------------------------. ,--------------. ,-------------------.
18 | J4 | J7 | I7 | H7 | G7 | G4 | F4 | F7 | E7 | D7 | R7 | R4 | E4 | B2 | | L4 | O4 | Q4 | | K1 | L1 | Q1 | Q0 |
19 |-------------------------------------------------------------------------| |--------------| |-------------------|
20 | J2 | J5 | I5 | H5 | G5 | G2 | F2 | F5 | E5 | D5 | R5 | R2 | E2 | B3 | | K4 | O7 | Q7 | | K5 | L5 | Q5 | O5 |
21 |-------------------------------------------------------------------------| '--------------' |-------------- |
22 | O5 | J3 | I3 | H3 | G3 | G6 | F6 | F3 | E3 | D3 | R3 | R6 | B1 | | K2 | L2 | Q2 | |
23 |-------------------------------------------------------------------------| ,----. |-------------------|
24 | N2 | J1 | I1 | H1 | G1 | G0 | F0 | F1 | E1 | D1 | R0 | N3 | | O6 | | K3 | L3 | Q3 | O3 |
25 |-------------------------------------------------------------------------| ,--------------. |-------------- |
26 | A4 | P2 | C6 | K6 | C0 | M3 | D0 | A1 | | O0 | K0 | L0 | | L6 | Q6 | |
27 `-------------------------------------------------------------------------' `--------------' `-------------------'
28*/
29#define KEYMAP( \
30 KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \
31 KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, KK1, KL1, KQ1, KQ0, \
32 KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, KK5, KL5, KQ5, KO5, \
33 KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, KK2, KL2, KQ2, \
34 KN2, KI6, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, KK3, KL3, KQ3, KO3, \
35 KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0, KL6, KQ6 \
36) \
37{ \
38/* Columns and rows need to be swapped in the below definition */ \
39/* A B C D E F G H I J K L M N O P Q R */ \
40/* 0 */ { KC_NO, KB0, KC0, KD0, KC_NO, KF0, KG0, KC_NO, KC_NO, KC_NO, KK0, KL0, KC_NO, KC_NO, KO0, KC_NO, KQ0, KR0 }, \
41/* 1 */ { KA1, KB1, KC_NO, KD1, KE1, KF1, KG1, KH1, KI1, KJ1, KK1, KL1, KC_NO, KC_NO, KC_NO, KC_NO, KQ1, KC_NO }, \
42/* 2 */ { KC_NO, KB2, KC_NO, KD2, KE2, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KC_NO, KN2, KC_NO, KP2, KQ2, KR2 }, \
43/* 3 */ { KC_NO, KB3, KC_NO, KD3, KE3, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KN3, KO3, KC_NO, KQ3, KR3 }, \
44/* 4 */ { KA4, KB4, KC_NO, KD4, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KC_NO, KC_NO, KO4, KC_NO, KQ4, KR4 }, \
45/* 5 */ { KA5, KC_NO, KC5, KD5, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KC_NO, KC_NO, KO5, KC_NO, KQ5, KR5 }, \
46/* 6 */ { KC_NO, KB6, KC6, KC_NO, KE6, KF6, KG6, KH6, KI6, KJ6, KK6, KL6, KC_NO, KC_NO, KO6, KC_NO, KQ6, KR6 }, \
47/* 7 */ { KA7, KB7, KC7, KD7, KE7, KF7, KG7, KH7, KI7, KJ7, KC_NO, KC_NO, KC_NO, KC_NO, KO7, KC_NO, KQ7, KR7 } \
48}
49
50#endif
diff --git a/keyboards/frosty_flake/keymaps/default/Makefile b/keyboards/frosty_flake/keymaps/default/Makefile
new file mode 100644
index 000000000..9d3df5964
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/default/Makefile
@@ -0,0 +1,21 @@
1# Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
6MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
7EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
8CONSOLE_ENABLE = no # Console for debug(+400)
9COMMAND_ENABLE = yes # Commands for debug and configuration
10NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
11BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
12MIDI_ENABLE = no # MIDI controls
13AUDIO_ENABLE = no # Audio output on port C6
14UNICODE_ENABLE = no # Unicode
15BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
16RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
17SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
18
19ifndef QUANTUM_DIR
20 include ../../../../Makefile
21endif
diff --git a/keyboards/frosty_flake/keymaps/default/config.h b/keyboards/frosty_flake/keymaps/default/config.h
new file mode 100644
index 000000000..8893d122e
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/default/config.h
@@ -0,0 +1,8 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6// place overrides here
7
8#endif
diff --git a/keyboards/frosty_flake/keymaps/default/keymap.c b/keyboards/frosty_flake/keymaps/default/keymap.c
new file mode 100644
index 000000000..4dc7ed655
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/default/keymap.c
@@ -0,0 +1,11 @@
1#include "frosty_flake.h"
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4[0] = KEYMAP(\
5 KC_ESC, 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_PSCR,KC_SLCK,KC_PAUS, \
6 KC_GRV, 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_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
7 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, KC_DEL, KC_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \
8 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, KC_P4, KC_P5, KC_P6, \
9 KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \
10 KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT)
11}; \ No newline at end of file
diff --git a/keyboards/frosty_flake/keymaps/default/readme.md b/keyboards/frosty_flake/keymaps/default/readme.md
new file mode 100644
index 000000000..11bf4825f
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for frosty_flake
diff --git a/keyboards/frosty_flake/matrix.c b/keyboards/frosty_flake/matrix.c
new file mode 100644
index 000000000..05dffdb64
--- /dev/null
+++ b/keyboards/frosty_flake/matrix.c
@@ -0,0 +1,135 @@
1/*
2 Copyright 2017 Gabriel Young <gabeplaysdrums@live.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
18#include <stdint.h>
19#include <stdbool.h>
20#include <avr/io.h>
21#include <util/delay.h>
22#include "print.h"
23#include "debug.h"
24#include "util.h"
25#include "matrix.h"
26
27#ifndef DEBOUNCING_DELAY
28# define DEBOUNCING_DELAY 5
29#endif
30static uint8_t debouncing = DEBOUNCING_DELAY;
31
32static matrix_row_t matrix[MATRIX_ROWS];
33static matrix_row_t matrix_debouncing[MATRIX_ROWS];
34
35static matrix_row_t scan_col(void) {
36 return (
37 (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) |
38 (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<1)) |
39 (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) |
40 (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<3)) |
41 (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) |
42 (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<5)) |
43 (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<6)) |
44 (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<7))
45 );
46}
47
48static void select_col(uint8_t col) {
49 switch (col) {
50 case 0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break;
51 case 1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break;
52 case 2: PORTD = (PORTD & ~0b01111011) | 0b01101010; break;
53 case 3: PORTD = (PORTD & ~0b01111011) | 0b01111001; break;
54 case 4: PORTD = (PORTD & ~0b01111011) | 0b01100010; break;
55 case 5: PORTD = (PORTD & ~0b01111011) | 0b01110001; break;
56 case 6: PORTD = (PORTD & ~0b01111011) | 0b01100001; break;
57 case 7: PORTD = (PORTD & ~0b01111011) | 0b01110000; break;
58 case 8: PORTD = (PORTD & ~0b01111011) | 0b01100000; break;
59 case 9: PORTD = (PORTD & ~0b01111011) | 0b01101000; break;
60 case 10: PORTD = (PORTD & ~0b01111011) | 0b00101011; break;
61 case 11: PORTD = (PORTD & ~0b01111011) | 0b00110011; break;
62 case 12: PORTD = (PORTD & ~0b01111011) | 0b00100011; break;
63 case 13: PORTD = (PORTD & ~0b01111011) | 0b01111000; break;
64 case 14: PORTD = (PORTD & ~0b01111011) | 0b00010011; break;
65 case 15: PORTD = (PORTD & ~0b01111011) | 0b01101001; break;
66 case 16: PORTD = (PORTD & ~0b01111011) | 0b00001011; break;
67 case 17: PORTD = (PORTD & ~0b01111011) | 0b00111011; break;
68 }
69}
70
71void matrix_init(void) {
72 /* Row output pins */
73 DDRD |= 0b01111011;
74 /* Column input pins */
75 DDRC &= ~0b10000000;
76 DDRB &= ~0b01111111;
77 PORTC |= 0b10000000;
78 PORTB |= 0b01111111;
79
80 for (uint8_t i=0; i < MATRIX_ROWS; i++)
81 matrix[i] = matrix_debouncing[i] = 0;
82
83 matrix_init_quantum();
84}
85
86uint8_t matrix_scan(void) {
87 for (uint8_t col = 0; col < MATRIX_COLS; col++) {
88 select_col(col);
89 _delay_us(3);
90 matrix_row_t col_scan = scan_col();
91 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
92 bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<<col);
93 bool curr_bit = col_scan & (1<<row);
94 if (prev_bit != curr_bit) {
95 matrix_debouncing[row] ^= ((matrix_row_t)1<<col);
96 debouncing = DEBOUNCING_DELAY;
97 }
98 }
99 }
100
101 if (debouncing) {
102 if (--debouncing)
103 _delay_ms(1);
104 else
105 for (uint8_t i = 0; i < MATRIX_ROWS; i++)
106 matrix[i] = matrix_debouncing[i];
107 }
108
109 matrix_scan_quantum();
110 return 1;
111}
112
113inline matrix_row_t matrix_get_row(uint8_t row) {
114 return matrix[row];
115}
116
117void matrix_print(void) {
118 print("\nr\\c ABCDEFGHIJKLMNOPQR\n");
119 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
120 matrix_row_t matrix_row = matrix_get_row(row);
121 xprintf("%02X: ", row);
122 for (uint8_t col = 0; col < MATRIX_COLS; col++) {
123 bool curr_bit = matrix_row & (1<<col);
124 xprintf("%c", curr_bit ? '*' : '.');
125 }
126 print("\n");
127 }
128}
129
130uint8_t matrix_key_count(void) {
131 uint8_t count = 0;
132 for (uint8_t row = 0; row < MATRIX_ROWS; row++)
133 count += bitpop32(matrix[row]);
134 return count;
135} \ No newline at end of file
diff --git a/keyboards/frosty_flake/readme.md b/keyboards/frosty_flake/readme.md
new file mode 100644
index 000000000..ff440e33b
--- /dev/null
+++ b/keyboards/frosty_flake/readme.md
@@ -0,0 +1,32 @@
1frosty_flake keyboard firmware
2======================
3
4This is the firmware for Rev. 20140521 of the Frosty Flake controller by [Bathroom Epiphanies](http://bathroomepiphanies.com/controllers/), a replacement controller for the [Cooler Master Quick Fire Rapid](http://www.coolermaster.com/peripheral/keyboards/quickfirerapid/).
5
6The code was adapted from the [BathroomEpiphanies TMK Firmware](https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers), but has been cleaned up to match the [schematic](https://deskthority.net/wiki/File:Frosty_Flake_Schematics.pdf) and gone through some minor refactoring for QMK.
7
8## Quantum MK Firmware
9
10For the full Quantum feature list, see [the parent readme](/).
11
12## Building
13
14Download or clone the whole firmware and navigate to the keyboards/frosty_flake folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
15
16Depending on which keymap you would like to use, you will have to compile slightly differently.
17
18### Default
19
20To build with the default keymap, simply run `make default`.
21
22### Other Keymaps
23
24Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
25
26To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
27
28```
29$ make [default|jack|<name>]
30```
31
32Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/frosty_flake/rules.mk b/keyboards/frosty_flake/rules.mk
new file mode 100644
index 000000000..dd2f4b6ee
--- /dev/null
+++ b/keyboards/frosty_flake/rules.mk
@@ -0,0 +1,71 @@
1# MCU name
2#MCU = at90usb1287
3MCU = atmega32u2
4
5# Processor frequency.
6# This will define a symbol, F_CPU, in all source code files equal to the
7# processor frequency in Hz. You can then use this symbol in your source code to
8# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
9# automatically to create a 32-bit value in your source code.
10#
11# This will be an integer division of F_USB below, as it is sourced by
12# F_USB after it has run through any CPU prescalers. Note that this value
13# does not *change* the processor frequency - it should merely be updated to
14# reflect the processor speed set externally so that the code can use accurate
15# software delays.
16F_CPU = 16000000
17
18
19#
20# LUFA specific
21#
22# Target architecture (see library "Board Types" documentation).
23ARCH = AVR8
24
25# Input clock frequency.
26# This will define a symbol, F_USB, in all source code files equal to the
27# input clock frequency (before any prescaling is performed) in Hz. This value may
28# differ from F_CPU if prescaling is used on the latter, and is required as the
29# raw input clock is fed directly to the PLL sections of the AVR for high speed
30# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
31# at the end, this will be done automatically to create a 32-bit value in your
32# source code.
33#
34# If no clock division is performed on the input clock inside the AVR (via the
35# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
36F_USB = $(F_CPU)
37
38# Interrupt driven control endpoint task(+60)
39OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
40
41
42# Boot Section Size in *bytes*
43# Teensy halfKay 512
44# Teensy++ halfKay 1024
45# Atmel DFU loader 4096
46# LUFA bootloader 4096
47# USBaspLoader 2048
48OPT_DEFS += -DBOOTLOADER_SIZE=4096
49
50
51# Build Options
52# change yes to no to disable
53#
54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
55MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
57CONSOLE_ENABLE ?= yes # Console for debug(+400)
58COMMAND_ENABLE ?= yes # Commands for debug and configuration
59# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
60SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
61# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
62NKRO_ENABLE ?= no # USB Nkey Rollover
63BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
64MIDI_ENABLE ?= no # MIDI controls
65UNICODE_ENABLE ?= no # Unicode
66BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
67AUDIO_ENABLE ?= no # Audio output on port C6
68FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches
69
70CUSTOM_MATRIX = yes
71SRC += matrix.c \ No newline at end of file
diff --git a/keyboards/lets_split/common/glcdfont.c b/keyboards/lets_split/common/glcdfont.c
new file mode 100644
index 000000000..6f88bd23a
--- /dev/null
+++ b/keyboards/lets_split/common/glcdfont.c
@@ -0,0 +1,276 @@
1// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0.
2// See gfxfont.h for newer custom bitmap font info.
3
4#ifndef FONT5X7_H
5#define FONT5X7_H
6
7#ifdef __AVR__
8 #include <avr/io.h>
9 #include <avr/pgmspace.h>
10#elif defined(ESP8266)
11 #include <pgmspace.h>
12#else
13 #define PROGMEM
14#endif
15
16// Standard ASCII 5x7 font
17
18static const unsigned char font[] PROGMEM = {
19 0x00, 0x00, 0x00, 0x00, 0x00,
20 0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
21 0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
22 0x1C, 0x3E, 0x7C, 0x3E, 0x1C,
23 0x18, 0x3C, 0x7E, 0x3C, 0x18,
24 0x1C, 0x57, 0x7D, 0x57, 0x1C,
25 0x1C, 0x5E, 0x7F, 0x5E, 0x1C,
26 0x00, 0x18, 0x3C, 0x18, 0x00,
27 0xFF, 0xE7, 0xC3, 0xE7, 0xFF,
28 0x00, 0x18, 0x24, 0x18, 0x00,
29 0xFF, 0xE7, 0xDB, 0xE7, 0xFF,
30 0x30, 0x48, 0x3A, 0x06, 0x0E,
31 0x26, 0x29, 0x79, 0x29, 0x26,
32 0x40, 0x7F, 0x05, 0x05, 0x07,
33 0x40, 0x7F, 0x05, 0x25, 0x3F,
34 0x5A, 0x3C, 0xE7, 0x3C, 0x5A,
35 0x7F, 0x3E, 0x1C, 0x1C, 0x08,
36 0x08, 0x1C, 0x1C, 0x3E, 0x7F,
37 0x14, 0x22, 0x7F, 0x22, 0x14,
38 0x5F, 0x5F, 0x00, 0x5F, 0x5F,
39 0x06, 0x09, 0x7F, 0x01, 0x7F,
40 0x00, 0x66, 0x89, 0x95, 0x6A,
41 0x60, 0x60, 0x60, 0x60, 0x60,
42 0x94, 0xA2, 0xFF, 0xA2, 0x94,
43 0x08, 0x04, 0x7E, 0x04, 0x08,
44 0x10, 0x20, 0x7E, 0x20, 0x10,
45 0x08, 0x08, 0x2A, 0x1C, 0x08,
46 0x08, 0x1C, 0x2A, 0x08, 0x08,
47 0x1E, 0x10, 0x10, 0x10, 0x10,
48 0x0C, 0x1E, 0x0C, 0x1E, 0x0C,
49 0x30, 0x38, 0x3E, 0x38, 0x30,
50 0x06, 0x0E, 0x3E, 0x0E, 0x06,
51 0x00, 0x00, 0x00, 0x00, 0x00,
52 0x00, 0x00, 0x5F, 0x00, 0x00,
53 0x00, 0x07, 0x00, 0x07, 0x00,
54 0x14, 0x7F, 0x14, 0x7F, 0x14,
55 0x24, 0x2A, 0x7F, 0x2A, 0x12,
56 0x23, 0x13, 0x08, 0x64, 0x62,
57 0x36, 0x49, 0x56, 0x20, 0x50,
58 0x00, 0x08, 0x07, 0x03, 0x00,
59 0x00, 0x1C, 0x22, 0x41, 0x00,
60 0x00, 0x41, 0x22, 0x1C, 0x00,
61 0x2A, 0x1C, 0x7F, 0x1C, 0x2A,
62 0x08, 0x08, 0x3E, 0x08, 0x08,
63 0x00, 0x80, 0x70, 0x30, 0x00,
64 0x08, 0x08, 0x08, 0x08, 0x08,
65 0x00, 0x00, 0x60, 0x60, 0x00,
66 0x20, 0x10, 0x08, 0x04, 0x02,
67 0x3E, 0x51, 0x49, 0x45, 0x3E,
68 0x00, 0x42, 0x7F, 0x40, 0x00,
69 0x72, 0x49, 0x49, 0x49, 0x46,
70 0x21, 0x41, 0x49, 0x4D, 0x33,
71 0x18, 0x14, 0x12, 0x7F, 0x10,
72 0x27, 0x45, 0x45, 0x45, 0x39,
73 0x3C, 0x4A, 0x49, 0x49, 0x31,
74 0x41, 0x21, 0x11, 0x09, 0x07,
75 0x36, 0x49, 0x49, 0x49, 0x36,
76 0x46, 0x49, 0x49, 0x29, 0x1E,
77 0x00, 0x00, 0x14, 0x00, 0x00,
78 0x00, 0x40, 0x34, 0x00, 0x00,
79 0x00, 0x08, 0x14, 0x22, 0x41,
80 0x14, 0x14, 0x14, 0x14, 0x14,
81 0x00, 0x41, 0x22, 0x14, 0x08,
82 0x02, 0x01, 0x59, 0x09, 0x06,
83 0x3E, 0x41, 0x5D, 0x59, 0x4E,
84 0x7C, 0x12, 0x11, 0x12, 0x7C,
85 0x7F, 0x49, 0x49, 0x49, 0x36,
86 0x3E, 0x41, 0x41, 0x41, 0x22,
87 0x7F, 0x41, 0x41, 0x41, 0x3E,
88 0x7F, 0x49, 0x49, 0x49, 0x41,
89 0x7F, 0x09, 0x09, 0x09, 0x01,
90 0x3E, 0x41, 0x41, 0x51, 0x73,
91 0x7F, 0x08, 0x08, 0x08, 0x7F,
92 0x00, 0x41, 0x7F, 0x41, 0x00,
93 0x20, 0x40, 0x41, 0x3F, 0x01,
94 0x7F, 0x08, 0x14, 0x22, 0x41,
95 0x7F, 0x40, 0x40, 0x40, 0x40,
96 0x7F, 0x02, 0x1C, 0x02, 0x7F,
97 0x7F, 0x04, 0x08, 0x10, 0x7F,
98 0x3E, 0x41, 0x41, 0x41, 0x3E,
99 0x7F, 0x09, 0x09, 0x09, 0x06,
100 0x3E, 0x41, 0x51, 0x21, 0x5E,
101 0x7F, 0x09, 0x19, 0x29, 0x46,
102 0x26, 0x49, 0x49, 0x49, 0x32,
103 0x03, 0x01, 0x7F, 0x01, 0x03,
104 0x3F, 0x40, 0x40, 0x40, 0x3F,
105 0x1F, 0x20, 0x40, 0x20, 0x1F,
106 0x3F, 0x40, 0x38, 0x40, 0x3F,
107 0x63, 0x14, 0x08, 0x14, 0x63,
108 0x03, 0x04, 0x78, 0x04, 0x03,
109 0x61, 0x59, 0x49, 0x4D, 0x43,
110 0x00, 0x7F, 0x41, 0x41, 0x41,
111 0x02, 0x04, 0x08, 0x10, 0x20,
112 0x00, 0x41, 0x41, 0x41, 0x7F,
113 0x04, 0x02, 0x01, 0x02, 0x04,
114 0x40, 0x40, 0x40, 0x40, 0x40,
115 0x00, 0x03, 0x07, 0x08, 0x00,
116 0x20, 0x54, 0x54, 0x78, 0x40,
117 0x7F, 0x28, 0x44, 0x44, 0x38,
118 0x38, 0x44, 0x44, 0x44, 0x28,
119 0x38, 0x44, 0x44, 0x28, 0x7F,
120 0x38, 0x54, 0x54, 0x54, 0x18,
121 0x00, 0x08, 0x7E, 0x09, 0x02,
122 0x18, 0xA4, 0xA4, 0x9C, 0x78,
123 0x7F, 0x08, 0x04, 0x04, 0x78,
124 0x00, 0x44, 0x7D, 0x40, 0x00,
125 0x20, 0x40, 0x40, 0x3D, 0x00,
126 0x7F, 0x10, 0x28, 0x44, 0x00,
127 0x00, 0x41, 0x7F, 0x40, 0x00,
128 0x7C, 0x04, 0x78, 0x04, 0x78,
129 0x7C, 0x08, 0x04, 0x04, 0x78,
130 0x38, 0x44, 0x44, 0x44, 0x38,
131 0xFC, 0x18, 0x24, 0x24, 0x18,
132 0x18, 0x24, 0x24, 0x18, 0xFC,
133 0x7C, 0x08, 0x04, 0x04, 0x08,
134 0x48, 0x54, 0x54, 0x54, 0x24,
135 0x04, 0x04, 0x3F, 0x44, 0x24,
136 0x3C, 0x40, 0x40, 0x20, 0x7C,
137 0x1C, 0x20, 0x40, 0x20, 0x1C,
138 0x3C, 0x40, 0x30, 0x40, 0x3C,
139 0x44, 0x28, 0x10, 0x28, 0x44,
140 0x4C, 0x90, 0x90, 0x90, 0x7C,
141 0x44, 0x64, 0x54, 0x4C, 0x44,
142 0x00, 0x08, 0x36, 0x41, 0x00,
143 0x00, 0x00, 0x77, 0x00, 0x00,
144 0x00, 0x41, 0x36, 0x08, 0x00,
145 0x02, 0x01, 0x02, 0x04, 0x02,
146 0x3C, 0x26, 0x23, 0x26, 0x3C,
147 0x1E, 0xA1, 0xA1, 0x61, 0x12,
148 0x3A, 0x40, 0x40, 0x20, 0x7A,
149 0x38, 0x54, 0x54, 0x55, 0x59,
150 0x21, 0x55, 0x55, 0x79, 0x41,
151 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut
152 0x21, 0x55, 0x54, 0x78, 0x40,
153 0x20, 0x54, 0x55, 0x79, 0x40,
154 0x0C, 0x1E, 0x52, 0x72, 0x12,
155 0x39, 0x55, 0x55, 0x55, 0x59,
156 0x39, 0x54, 0x54, 0x54, 0x59,
157 0x39, 0x55, 0x54, 0x54, 0x58,
158 0x00, 0x00, 0x45, 0x7C, 0x41,
159 0x00, 0x02, 0x45, 0x7D, 0x42,
160 0x00, 0x01, 0x45, 0x7C, 0x40,
161 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut
162 0xF0, 0x28, 0x25, 0x28, 0xF0,
163 0x7C, 0x54, 0x55, 0x45, 0x00,
164 0x20, 0x54, 0x54, 0x7C, 0x54,
165 0x7C, 0x0A, 0x09, 0x7F, 0x49,
166 0x32, 0x49, 0x49, 0x49, 0x32,
167 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut
168 0x32, 0x4A, 0x48, 0x48, 0x30,
169 0x3A, 0x41, 0x41, 0x21, 0x7A,
170 0x3A, 0x42, 0x40, 0x20, 0x78,
171 0x00, 0x9D, 0xA0, 0xA0, 0x7D,
172 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut
173 0x3D, 0x40, 0x40, 0x40, 0x3D,
174 0x3C, 0x24, 0xFF, 0x24, 0x24,
175 0x48, 0x7E, 0x49, 0x43, 0x66,
176 0x2B, 0x2F, 0xFC, 0x2F, 0x2B,
177 0xFF, 0x09, 0x29, 0xF6, 0x20,
178 0xC0, 0x88, 0x7E, 0x09, 0x03,
179 0x20, 0x54, 0x54, 0x79, 0x41,
180 0x00, 0x00, 0x44, 0x7D, 0x41,
181 0x30, 0x48, 0x48, 0x4A, 0x32,
182 0x38, 0x40, 0x40, 0x22, 0x7A,
183 0x00, 0x7A, 0x0A, 0x0A, 0x72,
184 0x7D, 0x0D, 0x19, 0x31, 0x7D,
185 0x26, 0x29, 0x29, 0x2F, 0x28,
186 0x26, 0x29, 0x29, 0x29, 0x26,
187 0x30, 0x48, 0x4D, 0x40, 0x20,
188 0x38, 0x08, 0x08, 0x08, 0x08,
189 0x08, 0x08, 0x08, 0x08, 0x38,
190 0x2F, 0x10, 0xC8, 0xAC, 0xBA,
191 0x2F, 0x10, 0x28, 0x34, 0xFA,
192 0x00, 0x00, 0x7B, 0x00, 0x00,
193 0x08, 0x14, 0x2A, 0x14, 0x22,
194 0x22, 0x14, 0x2A, 0x14, 0x08,
195 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code
196 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block
197 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block
198 0x00, 0x00, 0x00, 0xFF, 0x00,
199 0x10, 0x10, 0x10, 0xFF, 0x00,
200 0x14, 0x14, 0x14, 0xFF, 0x00,
201 0x10, 0x10, 0xFF, 0x00, 0xFF,
202 0x10, 0x10, 0xF0, 0x10, 0xF0,
203 0x14, 0x14, 0x14, 0xFC, 0x00,
204 0x14, 0x14, 0xF7, 0x00, 0xFF,
205 0x00, 0x00, 0xFF, 0x00, 0xFF,
206 0x14, 0x14, 0xF4, 0x04, 0xFC,
207 0x14, 0x14, 0x17, 0x10, 0x1F,
208 0x10, 0x10, 0x1F, 0x10, 0x1F,
209 0x14, 0x14, 0x14, 0x1F, 0x00,
210 0x10, 0x10, 0x10, 0xF0, 0x00,
211 0x00, 0x00, 0x00, 0x1F, 0x10,
212 0x10, 0x10, 0x10, 0x1F, 0x10,
213 0x10, 0x10, 0x10, 0xF0, 0x10,
214 0x00, 0x00, 0x00, 0xFF, 0x10,
215 0x10, 0x10, 0x10, 0x10, 0x10,
216 0x10, 0x10, 0x10, 0xFF, 0x10,
217 0x00, 0x00, 0x00, 0xFF, 0x14,
218 0x00, 0x00, 0xFF, 0x00, 0xFF,
219 0x00, 0x00, 0x1F, 0x10, 0x17,
220 0x00, 0x00, 0xFC, 0x04, 0xF4,
221 0x14, 0x14, 0x17, 0x10, 0x17,
222 0x14, 0x14, 0xF4, 0x04, 0xF4,
223 0x00, 0x00, 0xFF, 0x00, 0xF7,
224 0x14, 0x14, 0x14, 0x14, 0x14,
225 0x14, 0x14, 0xF7, 0x00, 0xF7,
226 0x14, 0x14, 0x14, 0x17, 0x14,
227 0x10, 0x10, 0x1F, 0x10, 0x1F,
228 0x14, 0x14, 0x14, 0xF4, 0x14,
229 0x10, 0x10, 0xF0, 0x10, 0xF0,
230 0x00, 0x00, 0x1F, 0x10, 0x1F,
231 0x00, 0x00, 0x00, 0x1F, 0x14,
232 0x00, 0x00, 0x00, 0xFC, 0x14,
233 0x00, 0x00, 0xF0, 0x10, 0xF0,
234 0x10, 0x10, 0xFF, 0x10, 0xFF,
235 0x14, 0x14, 0x14, 0xFF, 0x14,
236 0x10, 0x10, 0x10, 0x1F, 0x00,
237 0x00, 0x00, 0x00, 0xF0, 0x10,
238 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
239 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
240 0xFF, 0xFF, 0xFF, 0x00, 0x00,
241 0x00, 0x00, 0x00, 0xFF, 0xFF,
242 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
243 0x38, 0x44, 0x44, 0x38, 0x44,
244 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta
245 0x7E, 0x02, 0x02, 0x06, 0x06,
246 0x02, 0x7E, 0x02, 0x7E, 0x02,
247 0x63, 0x55, 0x49, 0x41, 0x63,
248 0x38, 0x44, 0x44, 0x3C, 0x04,
249 0x40, 0x7E, 0x20, 0x1E, 0x20,
250 0x06, 0x02, 0x7E, 0x02, 0x02,
251 0x99, 0xA5, 0xE7, 0xA5, 0x99,
252 0x1C, 0x2A, 0x49, 0x2A, 0x1C,
253 0x4C, 0x72, 0x01, 0x72, 0x4C,
254 0x30, 0x4A, 0x4D, 0x4D, 0x30,
255 0x30, 0x48, 0x78, 0x48, 0x30,
256 0xBC, 0x62, 0x5A, 0x46, 0x3D,
257 0x3E, 0x49, 0x49, 0x49, 0x00,
258 0x7E, 0x01, 0x01, 0x01, 0x7E,
259 0x2A, 0x2A, 0x2A, 0x2A, 0x2A,
260 0x44, 0x44, 0x5F, 0x44, 0x44,
261 0x40, 0x51, 0x4A, 0x44, 0x40,
262 0x40, 0x44, 0x4A, 0x51, 0x40,
263 0x00, 0x00, 0xFF, 0x01, 0x03,
264 0xE0, 0x80, 0xFF, 0x00, 0x00,
265 0x08, 0x08, 0x6B, 0x6B, 0x08,
266 0x36, 0x12, 0x36, 0x24, 0x36,
267 0x06, 0x0F, 0x09, 0x0F, 0x06,
268 0x00, 0x00, 0x18, 0x18, 0x00,
269 0x00, 0x00, 0x10, 0x10, 0x00,
270 0x30, 0x40, 0xFF, 0x01, 0x01,
271 0x00, 0x1F, 0x01, 0x01, 0x1E,
272 0x00, 0x19, 0x1D, 0x17, 0x12,
273 0x00, 0x3C, 0x3C, 0x3C, 0x3C,
274 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP
275};
276#endif // FONT5X7_H
diff --git a/keyboards/lets_split/i2c.h b/keyboards/lets_split/i2c.h
index 08ce4b009..c15b6bc50 100644
--- a/keyboards/lets_split/i2c.h
+++ b/keyboards/lets_split/i2c.h
@@ -16,7 +16,7 @@
16#define SLAVE_BUFFER_SIZE 0x10 16#define SLAVE_BUFFER_SIZE 0x10
17 17
18// i2c SCL clock frequency 18// i2c SCL clock frequency
19#define SCL_CLOCK 100000L 19#define SCL_CLOCK 400000L
20 20
21extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; 21extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
22 22
@@ -28,4 +28,22 @@ uint8_t i2c_master_read(int);
28void i2c_reset_state(void); 28void i2c_reset_state(void);
29void i2c_slave_init(uint8_t address); 29void i2c_slave_init(uint8_t address);
30 30
31
32static inline unsigned char i2c_start_read(unsigned char addr) {
33 return i2c_master_start((addr << 1) | I2C_READ);
34}
35
36static inline unsigned char i2c_start_write(unsigned char addr) {
37 return i2c_master_start((addr << 1) | I2C_WRITE);
38}
39
40// from SSD1306 scrips
41extern unsigned char i2c_rep_start(unsigned char addr);
42extern void i2c_start_wait(unsigned char addr);
43extern unsigned char i2c_readAck(void);
44extern unsigned char i2c_readNak(void);
45extern unsigned char i2c_read(unsigned char ack);
46
47#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
48
31#endif 49#endif
diff --git a/keyboards/lets_split/keymaps/OLED_sample/Makefile b/keyboards/lets_split/keymaps/OLED_sample/Makefile
new file mode 100644
index 000000000..90616d1f1
--- /dev/null
+++ b/keyboards/lets_split/keymaps/OLED_sample/Makefile
@@ -0,0 +1,25 @@
1
2# Build Options
3# change to "no" to disable the options, or define them in the Makefile in
4# the appropriate keymap folder that will get included automatically
5#
6BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
7MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
8EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
9CONSOLE_ENABLE = no # Console for debug(+400)
10COMMAND_ENABLE = no # Commands for debug and configuration
11NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
12BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
13MIDI_ENABLE = no # MIDI controls
14AUDIO_ENABLE = no # Audio output on port C6
15UNICODE_ENABLE = no # Unicode
16BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
18ONEHAND_ENABLE = no # Enable one-hand typing
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23ifndef QUANTUM_DIR
24 include ../../../../Makefile
25endif \ No newline at end of file
diff --git a/keyboards/lets_split/keymaps/OLED_sample/config.h b/keyboards/lets_split/keymaps/OLED_sample/config.h
new file mode 100644
index 000000000..353ea368c
--- /dev/null
+++ b/keyboards/lets_split/keymaps/OLED_sample/config.h
@@ -0,0 +1,45 @@
1/*
2Copyright 2012 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
18#define USE_I2C
19//#define USE_SERIAL
20//#define MASTER_RIGHT
21#define FLIP_HALF
22
23#define SSD1306OLED
24
25
26#define PREVENT_STUCK_MODIFIERS
27#define TAPPING_FORCE_HOLD
28#define TAPPING_TERM 100
29
30#undef RGBLED_NUM
31#define RGBLIGHT_ANIMATIONS
32#define RGBLED_NUM 6
33#define RGBLIGHT_HUE_STEP 10
34#define RGBLIGHT_SAT_STEP 17
35#define RGBLIGHT_VAL_STEP 17
36
37
38
39
40#ifdef SUBPROJECT_rev1
41 #include "../../rev1/config.h"
42#endif
43#ifdef SUBPROJECT_rev2
44 #include "../../rev2/config.h"
45#endif \ No newline at end of file
diff --git a/keyboards/lets_split/keymaps/OLED_sample/keymap.c b/keyboards/lets_split/keymaps/OLED_sample/keymap.c
new file mode 100644
index 000000000..072b825ab
--- /dev/null
+++ b/keyboards/lets_split/keymaps/OLED_sample/keymap.c
@@ -0,0 +1,356 @@
1#include "lets_split.h"
2#include "bootloader.h"
3#include "action_layer.h"
4#include "eeconfig.h"
5#include "tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/Peripheral/TWI.h"
6#ifdef AUDIO_ENABLE
7 #include "audio.h"
8#endif
9
10extern keymap_config_t keymap_config;
11
12//Following line allows macro to read current RGB settings
13extern rgblight_config_t rgblight_config;
14
15
16// Each layer gets a name for readability, which is then used in the keymap matrix below.
17// The underscores don't mean anything - you can have a layer called STUFF or any other name.
18// Layer names don't all need to be of the same length, obviously, and you can also skip them
19// entirely and just use numbers.
20#define _QWERTY 0
21#define _COLEMAK 1
22#define _DVORAK 2
23#define _LOWER 3
24#define _RAISE 4
25#define _ADJUST 16
26
27enum custom_keycodes {
28 QWERTY = SAFE_RANGE,
29 COLEMAK,
30 DVORAK,
31 LOWER,
32 RAISE,
33 ADJUST,
34 BACKLIT,
35 RGBLED_TOGGLE,
36 RGBLED_STEP_MODE,
37 RGBLED_INCREASE_HUE,
38 RGBLED_DECREASE_HUE,
39 RGBLED_INCREASE_SAT,
40 RGBLED_DECREASE_SAT,
41 RGBLED_INCREASE_VAL,
42 RGBLED_DECREASE_VAL,
43};
44
45enum macro_keycodes {
46 KC_SAMPLEMACRO,
47};
48
49
50// Fillers to make layering more clear
51#define _______ KC_TRNS
52#define XXXXXXX KC_NO
53//Macros
54#define M_SAMPLE M(KC_SAMPLEMACRO)
55
56const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
57
58/* Qwerty
59 * ,-----------------------------------------------------------------------------------.
60 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
61 * |------+------+------+------+------+-------------+------+------+------+------+------|
62 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
63 * |------+------+------+------+------+------|------+------+------+------+------+------|
64 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
65 * |------+------+------+------+------+------+------+------+------+------+------+------|
66 * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
67 * `-----------------------------------------------------------------------------------'
68 */
69[_QWERTY] = KEYMAP( \
70 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
71 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
72 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
73 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
74),
75
76/* Colemak
77 * ,-----------------------------------------------------------------------------------.
78 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
79 * |------+------+------+------+------+-------------+------+------+------+------+------|
80 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
81 * |------+------+------+------+------+------|------+------+------+------+------+------|
82 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
83 * |------+------+------+------+------+------+------+------+------+------+------+------|
84 * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
85 * `-----------------------------------------------------------------------------------'
86 */
87[_COLEMAK] = KEYMAP( \
88 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
89 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
90 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
91 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
92),
93
94/* Dvorak
95 * ,-----------------------------------------------------------------------------------.
96 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
97 * |------+------+------+------+------+-------------+------+------+------+------+------|
98 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
99 * |------+------+------+------+------+------|------+------+------+------+------+------|
100 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
101 * |------+------+------+------+------+------+------+------+------+------+------+------|
102 * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
103 * `-----------------------------------------------------------------------------------'
104 */
105[_DVORAK] = KEYMAP( \
106 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
107 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
108 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
109 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
110),
111
112/* Lower
113 * ,-----------------------------------------------------------------------------------.
114 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
115 * |------+------+------+------+------+-------------+------+------+------+------+------|
116 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
117 * |------+------+------+------+------+------|------+------+------+------+------+------|
118 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
119 * |------+------+------+------+------+------+------+------+------+------+------+------|
120 * | | | | | | | | Next | Vol- | Vol+ | Play |
121 * `-----------------------------------------------------------------------------------'
122 */
123[_LOWER] = KEYMAP( \
124 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
125 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
126 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
127 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
128),
129
130/* Raise
131 * ,-----------------------------------------------------------------------------------.
132 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
133 * |------+------+------+------+------+-------------+------+------+------+------+------|
134 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
135 * |------+------+------+------+------+------|------+------+------+------+------+------|
136 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
137 * |------+------+------+------+------+------+------+------+------+------+------+------|
138 * | | | | | | | | Next | Vol- | Vol+ | Play |
139 * `-----------------------------------------------------------------------------------'
140 */
141[_RAISE] = KEYMAP( \
142 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
143 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
144 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
145 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
146),
147
148/* Adjust (Lower + Raise)
149 * ,-----------------------------------------------------------------------------------.
150 * | | Reset| | | | | | | | | | Del |
151 * |------+------+------+------+------+-------------+------+------+------+------+------|
152 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
153 * |------+------+------+------+------+------|------+------+------+------+------+------|
154 * | | | | | | | | | | | | |
155 * |------+------+------+------+------+------+------+------+------+------+------+------|
156 * | | | | | | | | | | | |
157 * `-----------------------------------------------------------------------------------'
158 */
159[_ADJUST] = KEYMAP( \
160 _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
161 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
162 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
163 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
164)
165
166
167};
168
169
170#ifdef AUDIO_ENABLE
171
172float tone_startup[][2] = SONG(STARTUP_SOUND);
173float tone_qwerty[][2] = SONG(QWERTY_SOUND);
174float tone_dvorak[][2] = SONG(DVORAK_SOUND);
175float tone_colemak[][2] = SONG(COLEMAK_SOUND);
176float tone_plover[][2] = SONG(PLOVER_SOUND);
177float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
178float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
179float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
180#endif
181
182// define variables for reactive RGB
183bool TOG_STATUS = false;
184int RGB_current_mode;
185
186void persistant_default_layer_set(uint16_t default_layer) {
187 eeconfig_update_default_layer(default_layer);
188 default_layer_set(default_layer);
189}
190
191// Setting ADJUST layer RGB back to default
192void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
193 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
194 rgblight_mode(RGB_current_mode);
195 layer_on(layer3);
196 } else {
197 layer_off(layer3);
198 }
199}
200
201bool process_record_user(uint16_t keycode, keyrecord_t *record) {
202 switch (keycode) {
203 case QWERTY:
204 if (record->event.pressed) {
205 #ifdef AUDIO_ENABLE
206 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
207 #endif
208 persistant_default_layer_set(1UL<<_QWERTY);
209 }
210 return false;
211 break;
212 case COLEMAK:
213 if (record->event.pressed) {
214 #ifdef AUDIO_ENABLE
215 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
216 #endif
217 persistant_default_layer_set(1UL<<_COLEMAK);
218 }
219 return false;
220 break;
221 case DVORAK:
222 if (record->event.pressed) {
223 #ifdef AUDIO_ENABLE
224 PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
225 #endif
226 persistant_default_layer_set(1UL<<_DVORAK);
227 }
228 return false;
229 break;
230 case LOWER:
231 if (record->event.pressed) {
232 //not sure how to have keyboard check mode and set it to a variable, so my work around
233 //uses another variable that would be set to true after the first time a reactive key is pressed.
234 if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
235 } else {
236 TOG_STATUS = !TOG_STATUS;
237 rgblight_mode(16);
238 }
239 layer_on(_LOWER);
240 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
241 } else {
242 rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change
243 TOG_STATUS = false;
244 layer_off(_LOWER);
245 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
246 }
247 return false;
248 break;
249 case RAISE:
250 if (record->event.pressed) {
251 //not sure how to have keyboard check mode and set it to a variable, so my work around
252 //uses another variable that would be set to true after the first time a reactive key is pressed.
253 if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
254 } else {
255 TOG_STATUS = !TOG_STATUS;
256 rgblight_mode(15);
257 }
258 layer_on(_RAISE);
259 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
260 } else {
261 rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change
262 layer_off(_RAISE);
263 TOG_STATUS = false;
264 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
265 }
266 return false;
267 break;
268 case BACKLIT:
269 if (record->event.pressed) {
270 register_code(KC_RSFT);
271 #ifdef BACKLIGHT_ENABLE
272 backlight_step();
273 #endif
274 } else {
275 unregister_code(KC_RSFT);
276 }
277 return false;
278 break;
279 //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released
280 case RGB_MOD:
281 if (record->event.pressed) {
282 rgblight_mode(RGB_current_mode);
283 rgblight_step();
284 RGB_current_mode = rgblight_config.mode;
285 }
286 return false;
287 break;
288 }
289 return true;
290}
291
292void matrix_init_user(void) {
293 #ifdef AUDIO_ENABLE
294 startup_user();
295 #endif
296 RGB_current_mode = rgblight_config.mode;
297}
298
299//SSD1306 OLED init and update loop, make sure to add #define SSD1306OLED in config.h
300#ifdef SSD1306OLED
301void matrix_master_OLED_init (void) {
302 TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000));
303 iota_gfx_init(); // turns on the display
304}
305
306void matrix_scan_user(void) {
307 iota_gfx_task(); // this is what updates the display continuously
308}
309#endif
310
311#ifdef AUDIO_ENABLE
312
313void startup_user()
314{
315 _delay_ms(20); // gets rid of tick
316 PLAY_NOTE_ARRAY(tone_startup, false, 0);
317}
318
319void shutdown_user()
320{
321 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
322 _delay_ms(150);
323 stop_all_notes();
324}
325
326void music_on_user(void)
327{
328 music_scale_user();
329}
330
331void music_scale_user(void)
332{
333 PLAY_NOTE_ARRAY(music_scale, false, 0);
334}
335
336#endif
337
338/*
339 * Macro definition
340 */
341const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
342{
343 if (!eeconfig_is_enabled()) {
344 eeconfig_init();
345 }
346
347 switch (id) {
348 case KC_SAMPLEMACRO:
349 if (record->event.pressed){
350 return MACRO (I(10), T(H), T(E), T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END);
351 }
352
353 }
354
355 return MACRO_NONE;
356}
diff --git a/keyboards/lets_split/keymaps/OLED_sample/readme.md b/keyboards/lets_split/keymaps/OLED_sample/readme.md
new file mode 100644
index 000000000..02888855b
--- /dev/null
+++ b/keyboards/lets_split/keymaps/OLED_sample/readme.md
@@ -0,0 +1,25 @@
1SSD1306 OLED Display via I2C
2======
3
4Features
5--------
6
7Some features supported by the firmware:
8
9
10* I2C connection between the two halves is required as the OLED display will use this connection as well. Note this
11 requires pull-up resistors on the data and clock lines.
12* OLED display will connect from either side
13
14
15Wiring
16------
17
18
19Work in progress...
20
21
22OLED Configuration
23-------------------------------
24
25Work in progress...
diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c
index 138969004..81dfb1445 100644
--- a/keyboards/lets_split/matrix.c
+++ b/keyboards/lets_split/matrix.c
@@ -226,9 +226,7 @@ uint8_t matrix_scan(void)
226 TXLED0; 226 TXLED0;
227 error_count = 0; 227 error_count = 0;
228 } 228 }
229
230 matrix_scan_quantum(); 229 matrix_scan_quantum();
231
232 return ret; 230 return ret;
233} 231}
234 232
diff --git a/keyboards/lets_split/rev2/rev2.c b/keyboards/lets_split/rev2/rev2.c
index c505d3a6e..8bfa171d0 100644
--- a/keyboards/lets_split/rev2/rev2.c
+++ b/keyboards/lets_split/rev2/rev2.c
@@ -5,6 +5,13 @@
5 float tone_goodbye[][2] = SONG(GOODBYE_SOUND); 5 float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
6#endif 6#endif
7 7
8#ifdef SSD1306OLED
9void led_set_kb(uint8_t usb_led) {
10 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
11 led_set_user(usb_led);
12}
13#endif
14
8void matrix_init_kb(void) { 15void matrix_init_kb(void) {
9 16
10 #ifdef AUDIO_ENABLE 17 #ifdef AUDIO_ENABLE
@@ -30,3 +37,4 @@ void shutdown_user(void) {
30 stop_all_notes(); 37 stop_all_notes();
31 #endif 38 #endif
32} 39}
40
diff --git a/keyboards/lets_split/rev2/rev2.h b/keyboards/lets_split/rev2/rev2.h
index 990976de2..054731366 100644
--- a/keyboards/lets_split/rev2/rev2.h
+++ b/keyboards/lets_split/rev2/rev2.h
@@ -6,23 +6,66 @@
6//void promicro_bootloader_jmp(bool program); 6//void promicro_bootloader_jmp(bool program);
7#include "quantum.h" 7#include "quantum.h"
8 8
9
10#ifdef USE_I2C
11#include <stddef.h>
12#ifdef __AVR__
13#include <avr/io.h>
14#include <avr/interrupt.h>
15#endif
16#ifdef SSD1306OLED
17extern bool iota_gfx_init(void);
18extern void iota_gfx_task(void);
19extern bool iota_gfx_off(void);
20extern bool iota_gfx_on(void);
21extern void iota_gfx_flush(void);
22extern void iota_gfx_write_char(uint8_t c);
23extern void iota_gfx_write(const char *data);
24extern void iota_gfx_write_P(const char *data);
25extern void iota_gfx_clear_screen(void);
26#endif
27#endif
28
9//void promicro_bootloader_jmp(bool program); 29//void promicro_bootloader_jmp(bool program);
10 30
31#ifndef FLIP_HALF
32//Standard Keymap
11#define KEYMAP( \ 33#define KEYMAP( \
12 k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \ 34 k40, k41, k42, k43, k44, k45, k05, k04, k03, k02, k01, k00, \
13 k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \ 35 k50, k51, k52, k53, k54, k55, k15, k14, k13, k12, k11, k10, \
14 k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \ 36 k60, k61, k62, k63, k64, k65, k25, k24, k23, k22, k21, k20, \
15 k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \ 37 k70, k71, k72, k73, k74, k75, k35, k34, k33, k32, k31, k30 \
38 ) \
39 { \
40 { k45, k44, k43, k42, k41, k40 }, \
41 { k55, k54, k53, k52, k51, k50 }, \
42 { k65, k64, k63, k62, k61, k60 }, \
43 { k75, k74, k73, k72, k71, k70 }, \
44 { k00, k01, k02, k03, k04, k05 }, \
45 { k10, k11, k12, k13, k14, k15 }, \
46 { k20, k21, k22, k23, k24, k25 }, \
47 { k30, k31, k32, k33, k34, k35 } \
48 }
49
50#else
51// Keymap with one side flipped
52#define KEYMAP( \
53 k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \
54 k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \
55 k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \
56 k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \
16 ) \ 57 ) \
17 { \ 58 { \
18 { k00, k01, k02, k03, k04, k05 }, \ 59 { k00, k01, k02, k03, k04, k05 }, \
19 { k10, k11, k12, k13, k14, k15 }, \ 60 { k10, k11, k12, k13, k14, k15 }, \
20 { k20, k21, k22, k23, k24, k25 }, \ 61 { k20, k21, k22, k23, k24, k25 }, \
21 { k30, k31, k32, k33, k34, k35 }, \ 62 { k30, k31, k32, k33, k34, k35 }, \
22 { k40, k41, k42, k43, k44, k45 }, \ 63 { k45, k44, k43, k42, k41, k40 }, \
23 { k50, k51, k52, k53, k54, k55 }, \ 64 { k55, k54, k53, k52, k51, k50 }, \
24 { k60, k61, k62, k63, k64, k65 }, \ 65 { k65, k64, k63, k62, k61, k60 }, \
25 { k70, k71, k72, k73, k74, k75 } \ 66 { k75, k74, k73, k72, k71, k70 } \
26 } 67 }
68#endif
69
27 70
28#endif \ No newline at end of file 71#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev2fliphalf/config.h b/keyboards/lets_split/rev2fliphalf/config.h
deleted file mode 100644
index 1c45cf136..000000000
--- a/keyboards/lets_split/rev2fliphalf/config.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2Copyright 2012 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
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x3060
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Wootpatoot
28#define PRODUCT Lets Split v2
29#define DESCRIPTION A split keyboard for the cheap makers
30
31/* key matrix size */
32// Rows are doubled-up
33#define MATRIX_ROWS 8
34#define MATRIX_COLS 6
35
36// wiring of each half
37#define MATRIX_ROW_PINS { D7, E6, B4, B5 }
38//#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
39#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order
40
41//#define CATERINA_BOOTLOADER
42
43/* COL2ROW or ROW2COL */
44#define DIODE_DIRECTION COL2ROW
45
46/* define if matrix has ghost */
47//#define MATRIX_HAS_GHOST
48
49/* number of backlight levels */
50// #define BACKLIGHT_LEVELS 3
51
52/* Set 0 if debouncing isn't needed */
53#define DEBOUNCING_DELAY 5
54
55/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
56#define LOCKING_SUPPORT_ENABLE
57/* Locking resynchronize hack */
58#define LOCKING_RESYNC_ENABLE
59
60/* key combination for command */
61#define IS_COMMAND() ( \
62 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
63)
64
65/* ws2812 RGB LED */
66#define RGB_DI_PIN D3
67#define RGBLIGHT_TIMER
68#define RGBLED_NUM 12 // Number of LEDs
69#define ws2812_PORTREG PORTD
70#define ws2812_DDRREG DDRD
71
72/*
73 * Feature disable options
74 * These options are also useful to firmware size reduction.
75 */
76
77/* disable debug print */
78// #define NO_DEBUG
79
80/* disable print */
81// #define NO_PRINT
82
83/* disable action features */
84//#define NO_ACTION_LAYER
85//#define NO_ACTION_TAPPING
86//#define NO_ACTION_ONESHOT
87//#define NO_ACTION_MACRO
88//#define NO_ACTION_FUNCTION
89
90
91#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c b/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c
deleted file mode 100644
index c505d3a6e..000000000
--- a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c
+++ /dev/null
@@ -1,32 +0,0 @@
1#include "lets_split.h"
2
3#ifdef AUDIO_ENABLE
4 float tone_startup[][2] = SONG(STARTUP_SOUND);
5 float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
6#endif
7
8void matrix_init_kb(void) {
9
10 #ifdef AUDIO_ENABLE
11 _delay_ms(20); // gets rid of tick
12 PLAY_NOTE_ARRAY(tone_startup, false, 0);
13 #endif
14
15 // // green led on
16 // DDRD |= (1<<5);
17 // PORTD &= ~(1<<5);
18
19 // // orange led on
20 // DDRB |= (1<<0);
21 // PORTB &= ~(1<<0);
22
23 matrix_init_user();
24};
25
26void shutdown_user(void) {
27 #ifdef AUDIO_ENABLE
28 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
29 _delay_ms(150);
30 stop_all_notes();
31 #endif
32}
diff --git a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h b/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h
deleted file mode 100644
index 7dc8e5ba8..000000000
--- a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef REV2FLIPHALF_H
2#define REV2FLIPHALF_H
3
4#include "../lets_split.h"
5
6//void promicro_bootloader_jmp(bool program);
7#include "quantum.h"
8
9//void promicro_bootloader_jmp(bool program);
10
11#define KEYMAP( \
12 k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \
13 k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \
14 k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \
15 k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \
16 ) \
17 { \
18 { k00, k01, k02, k03, k04, k05 }, \
19 { k10, k11, k12, k13, k14, k15 }, \
20 { k20, k21, k22, k23, k24, k25 }, \
21 { k30, k31, k32, k33, k34, k35 }, \
22 { k40, k41, k42, k43, k44, k45 }, \
23 { k50, k51, k52, k53, k54, k55 }, \
24 { k60, k61, k62, k63, k64, k65 }, \
25 { k70, k71, k72, k73, k74, k75 } \
26 }
27
28#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev2fliphalf/rules.mk b/keyboards/lets_split/rev2fliphalf/rules.mk
deleted file mode 100644
index 80a942d06..000000000
--- a/keyboards/lets_split/rev2fliphalf/rules.mk
+++ /dev/null
@@ -1,5 +0,0 @@
1BACKLIGHT_ENABLE = no
2
3ifndef QUANTUM_DIR
4 include ../../../Makefile
5endif
diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk
index 0efa78550..ff159e0f0 100644
--- a/keyboards/lets_split/rules.mk
+++ b/keyboards/lets_split/rules.mk
@@ -1,7 +1,8 @@
1SRC += matrix.c \ 1SRC += matrix.c \
2 i2c.c \ 2 i2c.c \
3 split_util.c \ 3 split_util.c \
4 serial.c 4 serial.c\
5 ssd1306.c
5 6
6# MCU name 7# MCU name
7#MCU = at90usb1287 8#MCU = at90usb1287
@@ -73,15 +74,3 @@ USE_I2C ?= yes
73SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 74SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
74 75
75CUSTOM_MATRIX = yes 76CUSTOM_MATRIX = yes
76
77avrdude: build
78 ls /dev/tty* > /tmp/1; \
79 echo "Reset your Pro Micro now"; \
80 while [[ -z $$USB ]]; do \
81 sleep 1; \
82 ls /dev/tty* > /tmp/2; \
83 USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
84 done; \
85 avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex
86
87.PHONY: avrdude
diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c
index 226dc1881..46586fbc0 100644
--- a/keyboards/lets_split/split_util.c
+++ b/keyboards/lets_split/split_util.c
@@ -21,7 +21,7 @@ static void setup_handedness(void) {
21 #ifdef EE_HANDS 21 #ifdef EE_HANDS
22 isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); 22 isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
23 #else 23 #else
24 // I2C_MASTER_RIGHT is deprecated use MASTER_RIGHT instead since this works for both serial and i2c 24 // I2c_MASTER_RIGHT ish deprecate use MASTER_RIGHT instead since this works for both serial and i2c:
25 #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) 25 #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT)
26 isLeftHand = !has_usb(); 26 isLeftHand = !has_usb();
27 #else 27 #else
@@ -33,6 +33,9 @@ static void setup_handedness(void) {
33static void keyboard_master_setup(void) { 33static void keyboard_master_setup(void) {
34#ifdef USE_I2C 34#ifdef USE_I2C
35 i2c_master_init(); 35 i2c_master_init();
36#ifdef SSD1306OLED
37 matrix_master_OLED_init ();
38#endif
36#else 39#else
37 serial_master_init(); 40 serial_master_init();
38#endif 41#endif
diff --git a/keyboards/lets_split/split_util.h b/keyboards/lets_split/split_util.h
index 6b896679c..3ae76c209 100644
--- a/keyboards/lets_split/split_util.h
+++ b/keyboards/lets_split/split_util.h
@@ -19,4 +19,6 @@ void split_keyboard_setup(void);
19bool has_usb(void); 19bool has_usb(void);
20void keyboard_slave_loop(void); 20void keyboard_slave_loop(void);
21 21
22void matrix_master_OLED_init (void);
23
22#endif 24#endif
diff --git a/keyboards/lets_split/ssd1306.c b/keyboards/lets_split/ssd1306.c
new file mode 100644
index 000000000..3c7816bb3
--- /dev/null
+++ b/keyboards/lets_split/ssd1306.c
@@ -0,0 +1,468 @@
1#include "config.h"
2#include "i2c.h"
3#include <stdbool.h>
4#include <string.h>
5#include <stdio.h>
6#include "print.h"
7#include "lets_split.h"
8#include "common/glcdfont.c"
9#ifdef ADAFRUIT_BLE_ENABLE
10#include "adafruit_ble.h"
11#endif
12#ifdef PROTOCOL_LUFA
13#include "lufa.h"
14#endif
15#include "sendchar.h"
16#include "pincontrol.h"
17
18//assign the right code to your layers
19#define _BASE 0
20#define _LOWER 8
21#define _RAISE 16
22#define _FNLAYER 64
23#define _NUMLAY 128
24#define _NLOWER 136
25#define _NFNLAYER 192
26#define _MOUSECURSOR 256
27#define _ADJUST 65560
28
29// Set this to 1 to help diagnose early startup problems
30// when testing power-on with ble. Turn it off otherwise,
31// as the latency of printing most of the debug info messes
32// with the matrix scan, causing keys to drop.
33#define DEBUG_TO_SCREEN 0
34
35// Controls the SSD1306 128x32 OLED display via i2c
36
37#define i2cAddress 0x3C
38
39#define DisplayHeight 32
40#define DisplayWidth 128
41
42#define FontHeight 8
43#define FontWidth 6
44
45#define MatrixRows (DisplayHeight / FontHeight)
46#define MatrixCols (DisplayWidth / FontWidth)
47
48struct CharacterMatrix {
49 uint8_t display[MatrixRows][MatrixCols];
50 uint8_t *cursor;
51 bool dirty;
52};
53
54static struct CharacterMatrix display;
55//static uint16_t last_battery_update;
56//static uint32_t vbat;
57//#define BatteryUpdateInterval 10000 /* milliseconds */
58#define ScreenOffInterval 300000 /* milliseconds */
59#if DEBUG_TO_SCREEN
60static uint8_t displaying;
61#endif
62static uint16_t last_flush;
63
64enum ssd1306_cmds {
65 DisplayOff = 0xAE,
66 DisplayOn = 0xAF,
67
68 SetContrast = 0x81,
69 DisplayAllOnResume = 0xA4,
70
71 DisplayAllOn = 0xA5,
72 NormalDisplay = 0xA6,
73 InvertDisplay = 0xA7,
74 SetDisplayOffset = 0xD3,
75 SetComPins = 0xda,
76 SetVComDetect = 0xdb,
77 SetDisplayClockDiv = 0xD5,
78 SetPreCharge = 0xd9,
79 SetMultiPlex = 0xa8,
80 SetLowColumn = 0x00,
81 SetHighColumn = 0x10,
82 SetStartLine = 0x40,
83
84 SetMemoryMode = 0x20,
85 ColumnAddr = 0x21,
86 PageAddr = 0x22,
87
88 ComScanInc = 0xc0,
89 ComScanDec = 0xc8,
90 SegRemap = 0xa0,
91 SetChargePump = 0x8d,
92 ExternalVcc = 0x01,
93 SwitchCapVcc = 0x02,
94
95 ActivateScroll = 0x2f,
96 DeActivateScroll = 0x2e,
97 SetVerticalScrollArea = 0xa3,
98 RightHorizontalScroll = 0x26,
99 LeftHorizontalScroll = 0x27,
100 VerticalAndRightHorizontalScroll = 0x29,
101 VerticalAndLeftHorizontalScroll = 0x2a,
102};
103
104
105// Write command sequence.
106// Returns true on success.
107static inline bool _send_cmd1(uint8_t cmd) {
108 bool res = false;
109
110 if (i2c_start_write(i2cAddress)) {
111 xprintf("failed to start write to %d\n", i2cAddress);
112 goto done;
113 }
114
115 if (i2c_master_write(0x0 /* command byte follows */)) {
116 print("failed to write control byte\n");
117
118 goto done;
119 }
120
121 if (i2c_master_write(cmd)) {
122 xprintf("failed to write command %d\n", cmd);
123 goto done;
124 }
125 res = true;
126done:
127 i2c_master_stop();
128 return res;
129}
130
131// Write 2-byte command sequence.
132// Returns true on success
133static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) {
134 if (!_send_cmd1(cmd)) {
135 return false;
136 }
137 return _send_cmd1(opr);
138}
139
140// Write 3-byte command sequence.
141// Returns true on success
142static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) {
143 if (!_send_cmd1(cmd)) {
144 return false;
145 }
146 if (!_send_cmd1(opr1)) {
147 return false;
148 }
149 return _send_cmd1(opr2);
150}
151
152#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;}
153#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;}
154#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;}
155
156static void matrix_clear(struct CharacterMatrix *matrix);
157
158static void clear_display(void) {
159 matrix_clear(&display);
160
161 // Clear all of the display bits (there can be random noise
162 // in the RAM on startup)
163 send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1);
164 send_cmd3(ColumnAddr, 0, DisplayWidth - 1);
165
166 if (i2c_start_write(i2cAddress)) {
167 goto done;
168 }
169 if (i2c_master_write(0x40)) {
170 // Data mode
171 goto done;
172 }
173 for (uint8_t row = 0; row < MatrixRows; ++row) {
174 for (uint8_t col = 0; col < DisplayWidth; ++col) {
175 i2c_master_write(0);
176 }
177 }
178
179 display.dirty = false;
180
181done:
182 i2c_master_stop();
183}
184
185#if DEBUG_TO_SCREEN
186#undef sendchar
187static int8_t capture_sendchar(uint8_t c) {
188 sendchar(c);
189 iota_gfx_write_char(c);
190
191 if (!displaying) {
192 iota_gfx_flush();
193 }
194 return 0;
195}
196#endif
197
198bool iota_gfx_init(void) {
199 bool success = false;
200
201 send_cmd1(DisplayOff);
202 send_cmd2(SetDisplayClockDiv, 0x80);
203 send_cmd2(SetMultiPlex, DisplayHeight - 1);
204
205 send_cmd2(SetDisplayOffset, 0);
206
207
208 send_cmd1(SetStartLine | 0x0);
209 send_cmd2(SetChargePump, 0x14 /* Enable */);
210 send_cmd2(SetMemoryMode, 0 /* horizontal addressing */);
211
212/// Flips the display orientation 0 degrees
213 send_cmd1(SegRemap | 0x1);
214 send_cmd1(ComScanDec);
215/*
216// the following Flip the display orientation 180 degrees
217 send_cmd1(SegRemap);
218 send_cmd1(ComScanInc);
219// end flip */
220 send_cmd2(SetComPins, 0x2);
221 send_cmd2(SetContrast, 0x8f);
222 send_cmd2(SetPreCharge, 0xf1);
223 send_cmd2(SetVComDetect, 0x40);
224 send_cmd1(DisplayAllOnResume);
225 send_cmd1(NormalDisplay);
226 send_cmd1(DeActivateScroll);
227 send_cmd1(DisplayOn);
228
229 send_cmd2(SetContrast, 0); // Dim
230
231 clear_display();
232
233 success = true;
234
235 iota_gfx_flush();
236
237#if DEBUG_TO_SCREEN
238 print_set_sendchar(capture_sendchar);
239#endif
240
241done:
242 return success;
243}
244
245bool iota_gfx_off(void) {
246 bool success = false;
247
248 send_cmd1(DisplayOff);
249 success = true;
250
251done:
252 return success;
253}
254
255bool iota_gfx_on(void) {
256 bool success = false;
257
258 send_cmd1(DisplayOn);
259 success = true;
260
261done:
262 return success;
263}
264
265static void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) {
266 *matrix->cursor = c;
267 ++matrix->cursor;
268
269 if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) {
270 // We went off the end; scroll the display upwards by one line
271 memmove(&matrix->display[0], &matrix->display[1],
272 MatrixCols * (MatrixRows - 1));
273 matrix->cursor = &matrix->display[MatrixRows - 1][0];
274 memset(matrix->cursor, ' ', MatrixCols);
275 }
276}
277
278static void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) {
279 matrix->dirty = true;
280
281 if (c == '\n') {
282 // Clear to end of line from the cursor and then move to the
283 // start of the next line
284 uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols;
285
286 while (cursor_col++ < MatrixCols) {
287 matrix_write_char_inner(matrix, ' ');
288 }
289 return;
290 }
291
292 matrix_write_char_inner(matrix, c);
293}
294
295void iota_gfx_write_char(uint8_t c) {
296 matrix_write_char(&display, c);
297}
298
299static void matrix_write(struct CharacterMatrix *matrix, const char *data) {
300 const char *end = data + strlen(data);
301 while (data < end) {
302 matrix_write_char(matrix, *data);
303 ++data;
304 }
305}
306
307void iota_gfx_write(const char *data) {
308 matrix_write(&display, data);
309}
310
311static void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
312 while (true) {
313 uint8_t c = pgm_read_byte(data);
314 if (c == 0) {
315 return;
316 }
317 matrix_write_char(matrix, c);
318 ++data;
319 }
320}
321
322void iota_gfx_write_P(const char *data) {
323 matrix_write_P(&display, data);
324}
325
326static void matrix_clear(struct CharacterMatrix *matrix) {
327 memset(matrix->display, ' ', sizeof(matrix->display));
328 matrix->cursor = &matrix->display[0][0];
329 matrix->dirty = true;
330}
331
332void iota_gfx_clear_screen(void) {
333 matrix_clear(&display);
334}
335
336static void matrix_render(struct CharacterMatrix *matrix) {
337 last_flush = timer_read();
338 iota_gfx_on();
339#if DEBUG_TO_SCREEN
340 ++displaying;
341#endif
342
343 // Move to the home position
344 send_cmd3(PageAddr, 0, MatrixRows - 1);
345 send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1);
346
347 if (i2c_start_write(i2cAddress)) {
348 goto done;
349 }
350 if (i2c_master_write(0x40)) {
351 // Data mode
352 goto done;
353 }
354
355 for (uint8_t row = 0; row < MatrixRows; ++row) {
356 for (uint8_t col = 0; col < MatrixCols; ++col) {
357 const uint8_t *glyph = font + (matrix->display[row][col] * (FontWidth - 1));
358
359 for (uint8_t glyphCol = 0; glyphCol < FontWidth - 1; ++glyphCol) {
360 uint8_t colBits = pgm_read_byte(glyph + glyphCol);
361 i2c_master_write(colBits);
362 }
363
364 // 1 column of space between chars (it's not included in the glyph)
365 i2c_master_write(0);
366 }
367 }
368
369 matrix->dirty = false;
370
371done:
372 i2c_master_stop();
373#if DEBUG_TO_SCREEN
374 --displaying;
375#endif
376}
377
378void iota_gfx_flush(void) {
379 matrix_render(&display);
380}
381
382static void matrix_update(struct CharacterMatrix *dest,
383 const struct CharacterMatrix *source) {
384 if (memcmp(dest->display, source->display, sizeof(dest->display))) {
385 memcpy(dest->display, source->display, sizeof(dest->display));
386 dest->dirty = true;
387 }
388}
389
390static void render_status_info(void) {
391#if DEBUG_TO_SCREEN
392 if (debug_enable) {
393 return;
394 }
395#endif
396
397 struct CharacterMatrix matrix;
398
399 matrix_clear(&matrix);
400 matrix_write_P(&matrix, PSTR("USB: "));
401#ifdef PROTOCOL_LUFA
402 switch (USB_DeviceState) {
403 case DEVICE_STATE_Unattached:
404 matrix_write_P(&matrix, PSTR("Unattached"));
405 break;
406 case DEVICE_STATE_Suspended:
407 matrix_write_P(&matrix, PSTR("Suspended"));
408 break;
409 case DEVICE_STATE_Configured:
410 matrix_write_P(&matrix, PSTR("Connected"));
411 break;
412 case DEVICE_STATE_Powered:
413 matrix_write_P(&matrix, PSTR("Powered"));
414 break;
415 case DEVICE_STATE_Default:
416 matrix_write_P(&matrix, PSTR("Default"));
417 break;
418 case DEVICE_STATE_Addressed:
419 matrix_write_P(&matrix, PSTR("Addressed"));
420 break;
421 default:
422 matrix_write_P(&matrix, PSTR("Invalid"));
423 }
424#endif
425
426// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
427
428 char buf[40];
429 snprintf(buf,sizeof(buf), "Undef-%ld", layer_state);
430 matrix_write_P(&matrix, PSTR("\n\nLayer: "));
431 switch (layer_state) {
432 case _BASE:
433 matrix_write_P(&matrix, PSTR("Default"));
434 break;
435 case _RAISE:
436 matrix_write_P(&matrix, PSTR("Raise"));
437 break;
438 case _LOWER:
439 matrix_write_P(&matrix, PSTR("Lower"));
440 break;
441 case _ADJUST:
442 matrix_write_P(&matrix, PSTR("ADJUST"));
443 break;
444 default:
445 matrix_write(&matrix, buf);
446 }
447
448 // Host Keyboard LED Status
449 char led[40];
450 snprintf(led, sizeof(led), "\n%s %s %s",
451 (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ",
452 (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ",
453 (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " ");
454 matrix_write(&matrix, led);
455 matrix_update(&display, &matrix);
456}
457
458void iota_gfx_task(void) {
459 render_status_info();
460
461 if (display.dirty) {
462 iota_gfx_flush();
463 }
464
465 if (timer_elapsed(last_flush) > ScreenOffInterval) {
466 iota_gfx_off();
467 }
468}
diff --git a/keyboards/tada68/keymaps/default/keymap.c b/keyboards/tada68/keymaps/default/keymap.c
index da57c0343..f28116e0a 100644
--- a/keyboards/tada68/keymaps/default/keymap.c
+++ b/keyboards/tada68/keymaps/default/keymap.c
@@ -1,9 +1,5 @@
1#include "tada68.h" 1#include "tada68.h"
2 2
3
4// Used for SHIFT_ESC
5#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
6
7// Each layer gets a name for readability, which is then used in the keymap matrix below. 3// Each layer gets a name for readability, which is then used in the keymap matrix below.
8// The underscores don't mean anything - you can have a layer called STUFF or any other name. 4// The underscores don't mean anything - you can have a layer called STUFF or any other name.
9// Layer names don't all need to be of the same length, obviously, and you can also skip them 5// Layer names don't all need to be of the same length, obviously, and you can also skip them
@@ -36,63 +32,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
36 32
37 /* Keymap _FL: Function Layer 33 /* Keymap _FL: Function Layer
38 * ,----------------------------------------------------------------. 34 * ,----------------------------------------------------------------.
39 * | | | | | | | | | | | | | | RESET| | 35 * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins |
40 * |----------------------------------------------------------------| 36 * |----------------------------------------------------------------|
41 * | | | | | | | | | | | |BL-|BL+|BL | | 37 * | | |Up | | | | | | | | | | | |Hme |
42 * |----------------------------------------------------------------| 38 * |----------------------------------------------------------------|
43 * | | | | | | | | | | | | | | 39 * | |<- |Dn | ->| | | | | | | | | |End |
44 * |----------------------------------------------------------------| 40 * |----------------------------------------------------------------|
45 * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | | | 41 * | | | |Bl-|BL |BL+| |VU-|VU+|MUT| |MouseL|MsU|Rck |
46 * |----------------------------------------------------------------| 42 * |----------------------------------------------------------------|
47 * | | | | | | | | | | | 43 * | | | | | | | |MsL|MsD|MsR |
48 * `----------------------------------------------------------------' 44 * `----------------------------------------------------------------'
49 */ 45 */
50[_FL] = KEYMAP_ANSI( 46[_FL] = KEYMAP_ANSI(
51 #ifdef RGBLIGHT_ENABLE 47 _______, 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, KC_INS , \
52 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET,_______, \ 48 _______,_______,KC_UP, _______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,KC_HOME, \
53 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,_______, \ 49 _______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______, _______,KC_END, \
54 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \ 50 _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,KC_VOLD,KC_VOLU,KC_MUTE,_______,KC_BTN1, KC_MS_U, KC_BTN2, \
55 _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,_______, \ 51 _______,_______,_______, _______, _______,_______,_______,KC_MS_L,KC_MS_D, KC_MS_R),
56 _______,_______,_______, _______, _______,_______,_______,_______,_______, _______),
57 #else
58 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET,_______, \
59 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,_______, \
60 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \
61 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
62 _______,_______,_______, _______, _______,_______,_______,_______,_______, _______),
63 #endif
64};
65
66/*enum function_id {
67 //SHIFT_ESC,
68}; 52};
69
70const uint16_t PROGMEM fn_actions[] = {
71 //[0] = ACTION_FUNCTION(SHIFT_ESC),
72};
73
74void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
75 static uint8_t shift_esc_shift_mask;
76 switch (id) {
77 case SHIFT_ESC:
78 shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
79 if (record->event.pressed) {
80 if (shift_esc_shift_mask) {
81 add_key(KC_GRV);
82 send_keyboard_report();
83 } else {
84 add_key(KC_ESC);
85 send_keyboard_report();
86 }
87 } else {
88 if (shift_esc_shift_mask) {
89 del_key(KC_GRV);
90 send_keyboard_report();
91 } else {
92 del_key(KC_ESC);
93 send_keyboard_report();
94 }
95 }
96 break;
97 }
98}*/
diff --git a/keyboards/tada68/keymaps/default/readme.md b/keyboards/tada68/keymaps/default/readme.md
index 36760d6b9..53412d7c2 100644
--- a/keyboards/tada68/keymaps/default/readme.md
+++ b/keyboards/tada68/keymaps/default/readme.md
@@ -1 +1,3 @@
1# default TADA68 layout 1# default TADA68 layout
2
3This layout replicates the default factory layout of the TADA68.
diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md
index 552fdea52..dbe2fdca1 100644
--- a/keyboards/tada68/readme.md
+++ b/keyboards/tada68/readme.md
@@ -1,4 +1,15 @@
1TADA68 keyboard firmware 1TADA68 keyboard firmware
2====================== 2========================
3 3
4TODO: to be updated. 41) from the keyboards/tada68 directory run:
5```
6$ make flashbin
7```
8
92) hit the reset button on the TADA, the lights will start flashing.
10
113) You'll see a new drive on your computer called TADA68. Backup the original factory `FLASH.BIN` file thats inside it.
12
134) Delete `FLASH.BIN` from the TADA drive and copy `tada68_default.bin` that was generated at the root of the qmk directory into the TADA drive.
14
155) Hit ESC on the keyboard. The lights will stop flashing and your firmware is loaded! \ No newline at end of file
diff --git a/keyboards/xd60/keymaps/cheese/README.md b/keyboards/xd60/keymaps/cheese/README.md
new file mode 100644
index 000000000..8a5b97c03
--- /dev/null
+++ b/keyboards/xd60/keymaps/cheese/README.md
@@ -0,0 +1,13 @@
1# cheese's Layout
2Customized xd60 keymap
3
4![Base Layout](base_layout.png "Base Layout")
5![Fn Layout](fn_layout.png "Fn Layout")
6
7## Programming Instructions:
8`cd` into keymap directory, `make dfu`
9
10## Features
11- Media keys and movement keys setup like on the pok3r
12- Lower right movement keys setup like on the fc660m (fn+direction for home/end/page up and down)
13- Caps lock can be triggered by pressing both shift keys at the same time (and deactivated the same way)
diff --git a/keyboards/xd60/keymaps/cheese/base_layout.png b/keyboards/xd60/keymaps/cheese/base_layout.png
new file mode 100644
index 000000000..211c4c731
--- /dev/null
+++ b/keyboards/xd60/keymaps/cheese/base_layout.png
Binary files differ
diff --git a/keyboards/xd60/keymaps/cheese/fn_layout.png b/keyboards/xd60/keymaps/cheese/fn_layout.png
new file mode 100644
index 000000000..fe5ae99e0
--- /dev/null
+++ b/keyboards/xd60/keymaps/cheese/fn_layout.png
Binary files differ
diff --git a/keyboards/xd60/keymaps/cheese/keymap.c b/keyboards/xd60/keymaps/cheese/keymap.c
new file mode 100644
index 000000000..25919a41f
--- /dev/null
+++ b/keyboards/xd60/keymaps/cheese/keymap.c
@@ -0,0 +1,67 @@
1#include "xd60.h"
2#include "action_layer.h"
3
4// Each layer gets a name for readability.
5// The underscores don't mean anything - you can
6// have a layer called STUFF or any other name.
7// Layer names don't all need to be of the same
8// length, and you can also skip them entirely
9// and just use numbers.
10#define _BL 0
11#define _FL 1
12#define _LS 2
13#define _RS 3
14
15const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
16
17 /* (Base Layer) Default Layer
18 * ,-----------------------------------------------------------.
19 * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
20 * |-----------------------------------------------------------|
21 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |
22 * |-----------------------------------------------------------|
23 * |FUNCTION| A| S| D| F| G| H| J| K| L| ;| '|Return|
24 * |-----------------------------------------------------------|
25 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
26 * |-----------------------------------------------------------|
27 * |Ctrl|Gui |Alt | Space |FN|Left|Up|Down|Right|
28 * `-----------------------------------------------------------'
29 */
30 [_BL] = KEYMAP(
31 KC_ESC, 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_BSPC, \
32 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, \
33 MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
34 F(0), KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, F(1), F(1), F(1), \
35 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FL), KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT),
36
37// Function Layer
38 [_FL] = KEYMAP(
39 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, KC_DEL, \
40 KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_CALC, KC_INS, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \
41 KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, \
42 KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, \
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END),
44
45// Left Shift Layer
46 [_LS] = KEYMAP(
47 KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
48 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
49 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
50 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_CAPS, KC_CAPS, \
51 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
52
53// Right Shift Layer
54 [_RS] = KEYMAP(
55 KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
56 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
57 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
58 KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
59 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
60
61};
62
63// Custom Actions
64const uint16_t PROGMEM fn_actions[] = {
65 [0] = ACTION_LAYER_MODS(_LS, MOD_LSFT),
66 [1] = ACTION_LAYER_MODS(_RS, MOD_RSFT),
67};
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 582f8920b..807a7084a 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -294,14 +294,6 @@ bool process_record_quantum(keyrecord_t *record) {
294 return false; 294 return false;
295 break; 295 break;
296 #endif 296 #endif
297 #ifdef ADAFRUIT_BLE_ENABLE
298 case OUT_BLE:
299 if (record->event.pressed) {
300 set_output(OUTPUT_ADAFRUIT_BLE);
301 }
302 return false;
303 break;
304 #endif
305 #endif 297 #endif
306 case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: 298 case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
307 if (record->event.pressed) { 299 if (record->event.pressed) {
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 903d57f1e..78b02a0de 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -159,9 +159,6 @@ enum quantum_keycodes {
159#ifdef BLUETOOTH_ENABLE 159#ifdef BLUETOOTH_ENABLE
160 OUT_BT, 160 OUT_BT,
161#endif 161#endif
162#ifdef ADAFRUIT_BLE_ENABLE
163 OUT_BLE,
164#endif
165 162
166 // always leave at the end 163 // always leave at the end
167 SAFE_RANGE 164 SAFE_RANGE
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index a86dccc61..47f6fc571 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -93,14 +93,20 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
93 TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE 93 TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE
94endif 94endif
95 95
96ifeq ($(strip $(ADAFRUIT_BLE_ENABLE)), yes)
97 TMK_COMMON_DEFS += -DADAFRUIT_BLE_ENABLE
98endif
99
100ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) 96ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
101 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE 97 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
102endif 98endif
103 99
100ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
101 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
102 TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_BLE
103endif
104
105ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
106 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
107 TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_EZKEY
108endif
109
104ifeq ($(strip $(ONEHAND_ENABLE)), yes) 110ifeq ($(strip $(ONEHAND_ENABLE)), yes)
105 TMK_COMMON_DEFS += -DONEHAND_ENABLE 111 TMK_COMMON_DEFS += -DONEHAND_ENABLE
106endif 112endif
diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk
index de0cc795f..5b1577972 100644
--- a/tmk_core/protocol/lufa.mk
+++ b/tmk_core/protocol/lufa.mk
@@ -22,11 +22,16 @@ ifeq ($(strip $(MIDI_ENABLE)), yes)
22 include $(TMK_PATH)/protocol/midi.mk 22 include $(TMK_PATH)/protocol/midi.mk
23endif 23endif
24 24
25ifeq ($(strip $(ADAFRUIT_BLE_ENABLE)), yes) 25ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
26 LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp 26 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
27 $(TMK_DIR)/protocol/serial_uart.c
27endif 28endif
28 29
29ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) 30ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
31 LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp
32endif
33
34ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
30 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ 35 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
31 $(TMK_DIR)/protocol/serial_uart.c 36 $(TMK_DIR)/protocol/serial_uart.c
32endif 37endif
@@ -54,6 +59,7 @@ LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
54LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" 59LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
55#LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT 60#LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
56LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 61LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
62LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
57LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1 63LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
58 64
59# Remote wakeup fix for ATmega32U2 https://github.com/tmk/tmk_keyboard/issues/361 65# Remote wakeup fix for ATmega32U2 https://github.com/tmk/tmk_keyboard/issues/361
diff --git a/tmk_core/protocol/lufa/adafruit_ble.h b/tmk_core/protocol/lufa/adafruit_ble.h
index 351fd55ae..b3bab3ca0 100644
--- a/tmk_core/protocol/lufa/adafruit_ble.h
+++ b/tmk_core/protocol/lufa/adafruit_ble.h
@@ -3,7 +3,7 @@
3 * Supports the Adafruit BLE board built around the nRF51822 chip. 3 * Supports the Adafruit BLE board built around the nRF51822 chip.
4 */ 4 */
5#pragma once 5#pragma once
6#ifdef ADAFRUIT_BLE_ENABLE 6#ifdef MODULE_ADAFRUIT_BLE
7#include <stdbool.h> 7#include <stdbool.h>
8#include <stdint.h> 8#include <stdint.h>
9#include <string.h> 9#include <string.h>
@@ -57,4 +57,4 @@ extern bool adafruit_ble_set_power_level(int8_t level);
57} 57}
58#endif 58#endif
59 59
60#endif // ADAFRUIT_BLE_ENABLE 60#endif // MODULE_ADAFRUIT_BLE
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index ba49284c9..4cb23ebc8 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -67,10 +67,11 @@
67#endif 67#endif
68 68
69#ifdef BLUETOOTH_ENABLE 69#ifdef BLUETOOTH_ENABLE
70 #include "bluetooth.h" 70 #ifdef MODULE_ADAFRUIT_BLE
71#endif
72#ifdef ADAFRUIT_BLE_ENABLE
73 #include "adafruit_ble.h" 71 #include "adafruit_ble.h"
72 #else
73 #include "bluetooth.h"
74 #endif
74#endif 75#endif
75 76
76#ifdef VIRTSER_ENABLE 77#ifdef VIRTSER_ENABLE
@@ -602,18 +603,16 @@ static void send_keyboard(report_keyboard_t *report)
602 uint8_t where = where_to_send(); 603 uint8_t where = where_to_send();
603 604
604#ifdef BLUETOOTH_ENABLE 605#ifdef BLUETOOTH_ENABLE
605 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { 606 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
606 bluefruit_serial_send(0xFD); 607 #ifdef MODULE_ADAFRUIT_BLE
607 for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) {
608 bluefruit_serial_send(report->raw[i]);
609 }
610 }
611#endif
612
613#ifdef ADAFRUIT_BLE_ENABLE
614 if (where == OUTPUT_ADAFRUIT_BLE) {
615 adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); 608 adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys));
616 } 609 #else
610 bluefruit_serial_send(0xFD);
611 for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) {
612 bluefruit_serial_send(report->raw[i]);
613 }
614 #endif
615 }
617#endif 616#endif
618 617
619 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) { 618 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
@@ -660,24 +659,22 @@ static void send_mouse(report_mouse_t *report)
660 uint8_t where = where_to_send(); 659 uint8_t where = where_to_send();
661 660
662#ifdef BLUETOOTH_ENABLE 661#ifdef BLUETOOTH_ENABLE
663 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { 662 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
664 bluefruit_serial_send(0xFD); 663 #ifdef MODULE_ADAFRUIT_BLE
665 bluefruit_serial_send(0x00);
666 bluefruit_serial_send(0x03);
667 bluefruit_serial_send(report->buttons);
668 bluefruit_serial_send(report->x);
669 bluefruit_serial_send(report->y);
670 bluefruit_serial_send(report->v); // should try sending the wheel v here
671 bluefruit_serial_send(report->h); // should try sending the wheel h here
672 bluefruit_serial_send(0x00);
673 }
674#endif
675
676#ifdef ADAFRUIT_BLE_ENABLE
677 if (where == OUTPUT_ADAFRUIT_BLE) {
678 // FIXME: mouse buttons 664 // FIXME: mouse buttons
679 adafruit_ble_send_mouse_move(report->x, report->y, report->v, report->h); 665 adafruit_ble_send_mouse_move(report->x, report->y, report->v, report->h);
680 } 666 #else
667 bluefruit_serial_send(0xFD);
668 bluefruit_serial_send(0x00);
669 bluefruit_serial_send(0x03);
670 bluefruit_serial_send(report->buttons);
671 bluefruit_serial_send(report->x);
672 bluefruit_serial_send(report->y);
673 bluefruit_serial_send(report->v); // should try sending the wheel v here
674 bluefruit_serial_send(report->h); // should try sending the wheel h here
675 bluefruit_serial_send(0x00);
676 #endif
677 }
681#endif 678#endif
682 679
683 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) { 680 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
@@ -727,6 +724,9 @@ static void send_consumer(uint16_t data)
727 724
728#ifdef BLUETOOTH_ENABLE 725#ifdef BLUETOOTH_ENABLE
729 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { 726 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
727 #ifdef MODULE_ADAFRUIT_BLE
728 adafruit_ble_send_consumer_key(data, 0);
729 #else
730 static uint16_t last_data = 0; 730 static uint16_t last_data = 0;
731 if (data == last_data) return; 731 if (data == last_data) return;
732 last_data = data; 732 last_data = data;
@@ -740,12 +740,7 @@ static void send_consumer(uint16_t data)
740 bluefruit_serial_send(0x00); 740 bluefruit_serial_send(0x00);
741 bluefruit_serial_send(0x00); 741 bluefruit_serial_send(0x00);
742 bluefruit_serial_send(0x00); 742 bluefruit_serial_send(0x00);
743 } 743 #endif
744#endif
745
746#ifdef ADAFRUIT_BLE_ENABLE
747 if (where == OUTPUT_ADAFRUIT_BLE) {
748 adafruit_ble_send_consumer_key(data, 0);
749 } 744 }
750#endif 745#endif
751 746
@@ -1130,7 +1125,7 @@ int main(void)
1130 // midi_send_noteoff(&midi_device, 0, 64, 127); 1125 // midi_send_noteoff(&midi_device, 0, 64, 127);
1131#endif 1126#endif
1132 1127
1133#ifdef BLUETOOTH_ENABLE 1128#ifdef MODULE_ADAFRUIT_EZKEY
1134 serial_init(); 1129 serial_init();
1135#endif 1130#endif
1136 1131
@@ -1161,7 +1156,7 @@ int main(void)
1161 1156
1162 print("Keyboard start.\n"); 1157 print("Keyboard start.\n");
1163 while (1) { 1158 while (1) {
1164 #if !defined(BLUETOOTH_ENABLE) && !defined(ADAFRUIT_BLE_ENABLE) 1159 #if !defined(BLUETOOTH_ENABLE)
1165 while (USB_DeviceState == DEVICE_STATE_Suspended) { 1160 while (USB_DeviceState == DEVICE_STATE_Suspended) {
1166 print("[s]"); 1161 print("[s]");
1167 suspend_power_down(); 1162 suspend_power_down();
@@ -1182,7 +1177,7 @@ int main(void)
1182 rgblight_task(); 1177 rgblight_task();
1183#endif 1178#endif
1184 1179
1185#ifdef ADAFRUIT_BLE_ENABLE 1180#ifdef MODULE_ADAFRUIT_BLE
1186 adafruit_ble_task(); 1181 adafruit_ble_task();
1187#endif 1182#endif
1188 1183
diff --git a/tmk_core/protocol/lufa/outputselect.c b/tmk_core/protocol/lufa/outputselect.c
index 5d2457bff..0df5d3b75 100644
--- a/tmk_core/protocol/lufa/outputselect.c
+++ b/tmk_core/protocol/lufa/outputselect.c
@@ -14,7 +14,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14
15#include "lufa.h" 15#include "lufa.h"
16#include "outputselect.h" 16#include "outputselect.h"
17#ifdef ADAFRUIT_BLE_ENABLE 17#ifdef MODULE_ADAFRUIT_BLE
18 #include "adafruit_ble.h" 18 #include "adafruit_ble.h"
19#endif 19#endif
20 20
@@ -34,9 +34,9 @@ uint8_t auto_detect_output(void) {
34 return OUTPUT_USB; 34 return OUTPUT_USB;
35 } 35 }
36 36
37#ifdef ADAFRUIT_BLE_ENABLE 37#ifdef MODULE_ADAFRUIT_BLE
38 if (adafruit_ble_is_connected()) { 38 if (adafruit_ble_is_connected()) {
39 return OUTPUT_ADAFRUIT_BLE; 39 return OUTPUT_BLUETOOTH;
40 } 40 }
41#endif 41#endif
42 42
diff --git a/tmk_core/protocol/lufa/outputselect.h b/tmk_core/protocol/lufa/outputselect.h
index 79b4dd35d..28cc3298e 100644
--- a/tmk_core/protocol/lufa/outputselect.h
+++ b/tmk_core/protocol/lufa/outputselect.h
@@ -18,7 +18,6 @@ enum outputs {
18 OUTPUT_NONE, 18 OUTPUT_NONE,
19 OUTPUT_USB, 19 OUTPUT_USB,
20 OUTPUT_BLUETOOTH, 20 OUTPUT_BLUETOOTH,
21 OUTPUT_ADAFRUIT_BLE,
22 21
23 // backward compatibility 22 // backward compatibility
24 OUTPUT_USB_AND_BT 23 OUTPUT_USB_AND_BT