summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builddefs/common_features.mk6
-rw-r--r--builddefs/disable_features.mk1
-rw-r--r--builddefs/show_options.mk1
-rw-r--r--data/constants/keycodes/keycodes_0.0.1_quantum.hjson17
-rw-r--r--docs/_summary.md1
-rw-r--r--docs/feature_thermal_printer.md10
-rw-r--r--docs/keycodes.md9
-rw-r--r--docs/understanding_qmk.md1
-rw-r--r--keyboards/planck/keymaps/thermal_printer/config.h18
-rw-r--r--keyboards/planck/keymaps/thermal_printer/keymap.c303
-rw-r--r--keyboards/planck/keymaps/thermal_printer/readme.md2
-rw-r--r--keyboards/planck/keymaps/thermal_printer/rules.mk20
-rw-r--r--quantum/keycodes.h10
-rw-r--r--quantum/process_keycode/process_printer.c269
-rw-r--r--quantum/process_keycode/process_printer.h21
-rw-r--r--quantum/process_keycode/process_printer_bb.c270
-rw-r--r--quantum/quantum.c3
-rw-r--r--quantum/quantum.h4
18 files changed, 8 insertions, 958 deletions
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 9939e0e5df..e597924469 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -514,12 +514,6 @@ ifeq ($(strip $(RGB_KEYCODES_ENABLE)), yes)
514 SRC += $(QUANTUM_DIR)/process_keycode/process_rgb.c 514 SRC += $(QUANTUM_DIR)/process_keycode/process_rgb.c
515endif 515endif
516 516
517ifeq ($(strip $(PRINTING_ENABLE)), yes)
518 OPT_DEFS += -DPRINTING_ENABLE
519 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
520 QUANTUM_LIB_SRC += uart.c
521endif
522
523VARIABLE_TRACE ?= no 517VARIABLE_TRACE ?= no
524ifneq ($(strip $(VARIABLE_TRACE)),no) 518ifneq ($(strip $(VARIABLE_TRACE)),no)
525 SRC += $(QUANTUM_DIR)/variable_trace.c 519 SRC += $(QUANTUM_DIR)/variable_trace.c
diff --git a/builddefs/disable_features.mk b/builddefs/disable_features.mk
index 090a9b5a11..fe918b72b2 100644
--- a/builddefs/disable_features.mk
+++ b/builddefs/disable_features.mk
@@ -14,7 +14,6 @@ FEATURE_NAMES += LCD_BACKLIGHT
14FEATURE_NAMES += LCD 14FEATURE_NAMES += LCD
15FEATURE_NAMES += OLED 15FEATURE_NAMES += OLED
16FEATURE_NAMES += POINTING_DEVICE 16FEATURE_NAMES += POINTING_DEVICE
17FEATURE_NAMES += PRINTING
18FEATURE_NAMES += PS2_MOUSE 17FEATURE_NAMES += PS2_MOUSE
19FEATURE_NAMES += RGBLIGHT 18FEATURE_NAMES += RGBLIGHT
20FEATURE_NAMES += RGB_MATRIX 19FEATURE_NAMES += RGB_MATRIX
diff --git a/builddefs/show_options.mk b/builddefs/show_options.mk
index fac6576ba1..e9f7e7d047 100644
--- a/builddefs/show_options.mk
+++ b/builddefs/show_options.mk
@@ -43,7 +43,6 @@ OTHER_OPTION_NAMES = \
43 KEY_LOCK_ENABLE \ 43 KEY_LOCK_ENABLE \
44 KEY_OVERRIDE_ENABLE \ 44 KEY_OVERRIDE_ENABLE \
45 LEADER_ENABLE \ 45 LEADER_ENABLE \
46 PRINTING_ENABLE \
47 STENO_ENABLE \ 46 STENO_ENABLE \
48 STENO_PROTOCOL \ 47 STENO_PROTOCOL \
49 TAP_DANCE_ENABLE \ 48 TAP_DANCE_ENABLE \
diff --git a/data/constants/keycodes/keycodes_0.0.1_quantum.hjson b/data/constants/keycodes/keycodes_0.0.1_quantum.hjson
index ceb9d4d16c..1f3d2c70cd 100644
--- a/data/constants/keycodes/keycodes_0.0.1_quantum.hjson
+++ b/data/constants/keycodes/keycodes_0.0.1_quantum.hjson
@@ -424,36 +424,27 @@
424 424
425 "0x7C73": { 425 "0x7C73": {
426 "group": "quantum", 426 "group": "quantum",
427 "key": "PRINT_ON"
428 },
429 "0x7C74": {
430 "group": "quantum",
431 "key": "PRINT_OFF"
432 },
433
434 "0x7C75": {
435 "group": "quantum",
436 "key": "QK_CAPS_WORD_TOGGLE", 427 "key": "QK_CAPS_WORD_TOGGLE",
437 "aliases": [ 428 "aliases": [
438 "CW_TOGG" 429 "CW_TOGG"
439 ] 430 ]
440 }, 431 },
441 432
442 "0x7C76": { 433 "0x7C74": {
443 "group": "quantum", 434 "group": "quantum",
444 "key": "QK_AUTOCORRECT_ON", 435 "key": "QK_AUTOCORRECT_ON",
445 "aliases": [ 436 "aliases": [
446 "AC_ON" 437 "AC_ON"
447 ] 438 ]
448 }, 439 },
449 "0x7C77": { 440 "0x7C75": {
450 "group": "quantum", 441 "group": "quantum",
451 "key": "QK_AUTOCORRECT_OFF", 442 "key": "QK_AUTOCORRECT_OFF",
452 "aliases": [ 443 "aliases": [
453 "AC_OFF" 444 "AC_OFF"
454 ] 445 ]
455 }, 446 },
456 "0x7C78": { 447 "0x7C76": {
457 "group": "quantum", 448 "group": "quantum",
458 "key": "QK_AUTOCORRECT_TOGGLE", 449 "key": "QK_AUTOCORRECT_TOGGLE",
459 "aliases": [ 450 "aliases": [
@@ -461,4 +452,4 @@
461 ] 452 ]
462 } 453 }
463 } 454 }
464} \ No newline at end of file 455}
diff --git a/docs/_summary.md b/docs/_summary.md
index 0af0c7bc64..97b7e8a2ec 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -123,7 +123,6 @@
123 * [PS/2 Mouse](feature_ps2_mouse.md) 123 * [PS/2 Mouse](feature_ps2_mouse.md)
124 * [Split Keyboard](feature_split_keyboard.md) 124 * [Split Keyboard](feature_split_keyboard.md)
125 * [Stenography](feature_stenography.md) 125 * [Stenography](feature_stenography.md)
126 * [Thermal Printer](feature_thermal_printer.md)
127 * [Velocikey](feature_velocikey.md) 126 * [Velocikey](feature_velocikey.md)
128 127
129 * Keyboard Building 128 * Keyboard Building
diff --git a/docs/feature_thermal_printer.md b/docs/feature_thermal_printer.md
deleted file mode 100644
index 3f496646d4..0000000000
--- a/docs/feature_thermal_printer.md
+++ /dev/null
@@ -1,10 +0,0 @@
1# Thermal Printer
2
3<!-- FIXME: Describe thermal printers support here. -->
4
5## Thermal Printer Keycodes
6
7|Key |Description |
8|-----------|----------------------------------------|
9|`PRINT_ON` |Start printing everything the user types|
10|`PRINT_OFF`|Stop printing everything the user types |
diff --git a/docs/keycodes.md b/docs/keycodes.md
index 0c216ae499..3cde934828 100644
--- a/docs/keycodes.md
+++ b/docs/keycodes.md
@@ -718,15 +718,6 @@ See also: [RGB Matrix Lighting](feature_rgb_matrix.md)
718|`RGB_SPI` | |Increase effect speed (does not support eeprom yet), decrease speed when Shift is held| 718|`RGB_SPI` | |Increase effect speed (does not support eeprom yet), decrease speed when Shift is held|
719|`RGB_SPD` | |Decrease effect speed (does not support eeprom yet), increase speed when Shift is held| 719|`RGB_SPD` | |Decrease effect speed (does not support eeprom yet), increase speed when Shift is held|
720 720
721## Thermal Printer :id=thermal-printer
722
723See also: [Thermal Printer](feature_thermal_printer.md)
724
725|Key |Description |
726|-----------|----------------------------------------|
727|`PRINT_ON` |Start printing everything the user types|
728|`PRINT_OFF`|Stop printing everything the user types |
729
730## US ANSI Shifted Symbols :id=us-ansi-shifted-symbols 721## US ANSI Shifted Symbols :id=us-ansi-shifted-symbols
731 722
732See also: [US ANSI Shifted Symbols](keycodes_us_ansi_shifted.md) 723See also: [US ANSI Shifted Symbols](keycodes_us_ansi_shifted.md)
diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md
index ba47fc3ad3..ab7834e24a 100644
--- a/docs/understanding_qmk.md
+++ b/docs/understanding_qmk.md
@@ -159,7 +159,6 @@ The `process_record()` function itself is deceptively simple, but hidden within
159 * [`bool process_unicodemap(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_unicodemap.c#L42) 159 * [`bool process_unicodemap(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_unicodemap.c#L42)
160 * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_ucis.c#L70) 160 * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_ucis.c#L70)
161 * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_leader.c#L48) 161 * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_leader.c#L48)
162 * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_printer.c#L77)
163 * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_auto_shift.c#L353) 162 * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_auto_shift.c#L353)
164 * [`bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_dynamic_tapping_term.c#L35) 163 * [`bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_dynamic_tapping_term.c#L35)
165 * [`bool process_space_cadet(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_space_cadet.c#L123) 164 * [`bool process_space_cadet(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_space_cadet.c#L123)
diff --git a/keyboards/planck/keymaps/thermal_printer/config.h b/keyboards/planck/keymaps/thermal_printer/config.h
deleted file mode 100644
index dd9d6a9d25..0000000000
--- a/keyboards/planck/keymaps/thermal_printer/config.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#pragma once
2
3/*
4 * MIDI options
5 */
6
7/* enable basic MIDI features:
8 - MIDI notes can be sent when in Music mode is on
9*/
10#define MIDI_BASIC
11
12/* enable advanced MIDI features:
13 - MIDI notes can be added to the keymap
14 - Octave shift and transpose
15 - Virtual sustain, portamento, and modulation wheel
16 - etc.
17*/
18//#define MIDI_ADVANCED
diff --git a/keyboards/planck/keymaps/thermal_printer/keymap.c b/keyboards/planck/keymaps/thermal_printer/keymap.c
deleted file mode 100644
index 6e23014ac5..0000000000
--- a/keyboards/planck/keymaps/thermal_printer/keymap.c
+++ /dev/null
@@ -1,303 +0,0 @@
1
2#include QMK_KEYBOARD_H
3
4extern keymap_config_t keymap_config;
5
6// Each layer gets a name for readability, which is then used in the keymap matrix below.
7// The underscores don't mean anything - you can have a layer called STUFF or any other name.
8// Layer names don't all need to be of the same length, obviously, and you can also skip them
9// entirely and just use numbers.
10#define _QWERTY 0
11#define _COLEMAK 1
12#define _DVORAK 2
13#define _LOWER 3
14#define _RAISE 4
15#define _PLOVER 5
16#define _ADJUST 16
17
18enum planck_keycodes {
19 QWERTY = SAFE_RANGE,
20 COLEMAK,
21 DVORAK,
22 PLOVER,
23 LOWER,
24 RAISE,
25 BACKLIT,
26 EXT_PLV
27};
28
29const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
30
31/* Qwerty
32 * ,-----------------------------------------------------------------------------------.
33 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
34 * |------+------+------+------+------+-------------+------+------+------+------+------|
35 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
36 * |------+------+------+------+------+------|------+------+------+------+------+------|
37 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
38 * |------+------+------+------+------+------+------+------+------+------+------+------|
39 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
40 * `-----------------------------------------------------------------------------------'
41 */
42[_QWERTY] = LAYOUT_planck_grid(
43 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
44 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
45 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
46 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
47),
48
49/* Colemak
50 * ,-----------------------------------------------------------------------------------.
51 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
52 * |------+------+------+------+------+-------------+------+------+------+------+------|
53 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
54 * |------+------+------+------+------+------|------+------+------+------+------+------|
55 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
56 * |------+------+------+------+------+------+------+------+------+------+------+------|
57 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
58 * `-----------------------------------------------------------------------------------'
59 */
60[_COLEMAK] = LAYOUT_planck_grid(
61 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
62 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
63 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
64 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
65),
66
67/* Dvorak
68 * ,-----------------------------------------------------------------------------------.
69 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
70 * |------+------+------+------+------+-------------+------+------+------+------+------|
71 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
72 * |------+------+------+------+------+------|------+------+------+------+------+------|
73 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
74 * |------+------+------+------+------+------+------+------+------+------+------+------|
75 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
76 * `-----------------------------------------------------------------------------------'
77 */
78[_DVORAK] = LAYOUT_planck_grid(
79 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
80 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
81 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
82 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
83),
84
85/* Lower
86 * ,-----------------------------------------------------------------------------------.
87 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
88 * |------+------+------+------+------+-------------+------+------+------+------+------|
89 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
90 * |------+------+------+------+------+------|------+------+------+------+------+------|
91 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
92 * |------+------+------+------+------+------+------+------+------+------+------+------|
93 * | | | | | | | | Next | Vol- | Vol+ | Play |
94 * `-----------------------------------------------------------------------------------'
95 */
96[_LOWER] = LAYOUT_planck_grid(
97 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
98 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
99 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______,
100 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
101),
102
103/* Raise
104 * ,-----------------------------------------------------------------------------------.
105 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
106 * |------+------+------+------+------+-------------+------+------+------+------+------|
107 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
108 * |------+------+------+------+------+------|------+------+------+------+------+------|
109 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
110 * |------+------+------+------+------+------+------+------+------+------+------+------|
111 * | | | | | | | | Next | Vol- | Vol+ | Play |
112 * `-----------------------------------------------------------------------------------'
113 */
114[_RAISE] = LAYOUT_planck_grid(
115 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
116 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
117 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______,
118 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
119),
120
121/* Plover layer (http://opensteno.org)
122 * ,-----------------------------------------------------------------------------------.
123 * | # | # | # | # | # | # | # | # | # | # | # | # |
124 * |------+------+------+------+------+-------------+------+------+------+------+------|
125 * | | S | T | P | H | * | * | F | P | L | T | D |
126 * |------+------+------+------+------+------|------+------+------+------+------+------|
127 * |TogOut| S | K | W | R | * | * | R | B | G | S | Z |
128 * |------+------+------+------+------+------+------+------+------+------+------+------|
129 * | Exit | | | A | O | | E | U | | | |
130 * `-----------------------------------------------------------------------------------'
131 */
132
133[_PLOVER] = LAYOUT_planck_grid(
134 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
135 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
136 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
137 EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
138),
139
140/* Adjust (Lower + Raise)
141 * ,-----------------------------------------------------------------------------------.
142 * | | Reset| | Print|no prnt | | | | | | | Del |
143 * |------+------+------+------+------+-------------+------+------+------+------+------|
144 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
145 * |------+------+------+------+------+------|------+------+------+------+------+------|
146 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
147 * |------+------+------+------+------+------+------+------+------+------+------+------|
148 * | | | | | | | | | | | |
149 * `-----------------------------------------------------------------------------------'
150 */
151[_ADJUST] = LAYOUT_planck_grid(
152 _______, QK_BOOT, _______, PRINT_ON, PRINT_OFF, _______, _______, _______, _______, _______, _______, KC_DEL,
153 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
154 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
155 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
156)
157
158
159};
160
161#ifdef AUDIO_ENABLE
162
163float tone_startup[][2] = SONG(STARTUP_SOUND);
164float tone_qwerty[][2] = SONG(QWERTY_SOUND);
165float tone_dvorak[][2] = SONG(DVORAK_SOUND);
166float tone_colemak[][2] = SONG(COLEMAK_SOUND);
167float tone_plover[][2] = SONG(PLOVER_SOUND);
168float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
169float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
170
171float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
172#endif
173
174
175void persistent_default_layer_set(uint16_t default_layer) {
176 eeconfig_update_default_layer(default_layer);
177 default_layer_set(default_layer);
178}
179
180bool process_record_user(uint16_t keycode, keyrecord_t *record) {
181 switch (keycode) {
182 case QWERTY:
183 if (record->event.pressed) {
184 #ifdef AUDIO_ENABLE
185 PLAY_SONG(tone_qwerty);
186 #endif
187 persistent_default_layer_set(1UL<<_QWERTY);
188 }
189 return false;
190 break;
191 case COLEMAK:
192 if (record->event.pressed) {
193 #ifdef AUDIO_ENABLE
194 PLAY_SONG(tone_colemak);
195 #endif
196 persistent_default_layer_set(1UL<<_COLEMAK);
197 }
198 return false;
199 break;
200 case DVORAK:
201 if (record->event.pressed) {
202 #ifdef AUDIO_ENABLE
203 PLAY_SONG(tone_dvorak);
204 #endif
205 persistent_default_layer_set(1UL<<_DVORAK);
206 }
207 return false;
208 break;
209 case LOWER:
210 if (record->event.pressed) {
211 layer_on(_LOWER);
212 update_tri_layer(_LOWER, _RAISE, _ADJUST);
213 } else {
214 layer_off(_LOWER);
215 update_tri_layer(_LOWER, _RAISE, _ADJUST);
216 }
217 return false;
218 break;
219 case RAISE:
220 if (record->event.pressed) {
221 layer_on(_RAISE);
222 update_tri_layer(_LOWER, _RAISE, _ADJUST);
223 } else {
224 layer_off(_RAISE);
225 update_tri_layer(_LOWER, _RAISE, _ADJUST);
226 }
227 return false;
228 break;
229 case BACKLIT:
230 if (record->event.pressed) {
231 register_code(KC_RSFT);
232 #ifdef BACKLIGHT_ENABLE
233 backlight_step();
234 #endif
235 } else {
236 unregister_code(KC_RSFT);
237 }
238 return false;
239 break;
240 case PLOVER:
241 if (record->event.pressed) {
242 #ifdef AUDIO_ENABLE
243 stop_all_notes();
244 PLAY_SONG(tone_plover);
245 #endif
246 layer_off(_RAISE);
247 layer_off(_LOWER);
248 layer_off(_ADJUST);
249 layer_on(_PLOVER);
250 if (!eeconfig_is_enabled()) {
251 eeconfig_init();
252 }
253 keymap_config.raw = eeconfig_read_keymap();
254 keymap_config.nkro = 1;
255 eeconfig_update_keymap(keymap_config.raw);
256 }
257 return false;
258 break;
259 case EXT_PLV:
260 if (record->event.pressed) {
261 #ifdef AUDIO_ENABLE
262 PLAY_SONG(tone_plover_gb);
263 #endif
264 layer_off(_PLOVER);
265 }
266 return false;
267 break;
268 }
269 return true;
270}
271
272void matrix_init_user(void) {
273 #ifdef AUDIO_ENABLE
274 startup_user();
275 #endif
276}
277
278#ifdef AUDIO_ENABLE
279
280void startup_user()
281{
282 _delay_ms(20); // gets rid of tick
283 PLAY_SONG(tone_startup);
284}
285
286void shutdown_user()
287{
288 PLAY_SONG(tone_goodbye);
289 _delay_ms(150);
290 stop_all_notes();
291}
292
293void music_on_user(void)
294{
295 music_scale_user();
296}
297
298void music_scale_user(void)
299{
300 PLAY_SONG(music_scale);
301}
302
303#endif
diff --git a/keyboards/planck/keymaps/thermal_printer/readme.md b/keyboards/planck/keymaps/thermal_printer/readme.md
deleted file mode 100644
index de9680b498..0000000000
--- a/keyboards/planck/keymaps/thermal_printer/readme.md
+++ /dev/null
@@ -1,2 +0,0 @@
1# The Default Planck Layout
2
diff --git a/keyboards/planck/keymaps/thermal_printer/rules.mk b/keyboards/planck/keymaps/thermal_printer/rules.mk
deleted file mode 100644
index 3959624376..0000000000
--- a/keyboards/planck/keymaps/thermal_printer/rules.mk
+++ /dev/null
@@ -1,20 +0,0 @@
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 # Enable Bootmagic Lite
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 = yes # Enable keyboard backlight functionality
12MIDI_ENABLE = no # MIDI controls
13AUDIO_ENABLE = yes # 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.
17PRINTING_ENABLE = yes
18
19# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
20SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
diff --git a/quantum/keycodes.h b/quantum/keycodes.h
index e3c9321d16..c27a5a732c 100644
--- a/quantum/keycodes.h
+++ b/quantum/keycodes.h
@@ -709,12 +709,10 @@ enum qk_keycode_defines {
709 DT_PRNT = 0x7C70, 709 DT_PRNT = 0x7C70,
710 DT_UP = 0x7C71, 710 DT_UP = 0x7C71,
711 DT_DOWN = 0x7C72, 711 DT_DOWN = 0x7C72,
712 PRINT_ON = 0x7C73, 712 QK_CAPS_WORD_TOGGLE = 0x7C73,
713 PRINT_OFF = 0x7C74, 713 QK_AUTOCORRECT_ON = 0x7C74,
714 QK_CAPS_WORD_TOGGLE = 0x7C75, 714 QK_AUTOCORRECT_OFF = 0x7C75,
715 QK_AUTOCORRECT_ON = 0x7C76, 715 QK_AUTOCORRECT_TOGGLE = 0x7C76,
716 QK_AUTOCORRECT_OFF = 0x7C77,
717 QK_AUTOCORRECT_TOGGLE = 0x7C78,
718 SAFE_RANGE = 0x7E00, 716 SAFE_RANGE = 0x7E00,
719 717
720// Alias 718// Alias
diff --git a/quantum/process_keycode/process_printer.c b/quantum/process_keycode/process_printer.c
deleted file mode 100644
index 6dd1f28c9b..0000000000
--- a/quantum/process_keycode/process_printer.c
+++ /dev/null
@@ -1,269 +0,0 @@
1/* Copyright 2016 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "process_printer.h"
18#include "action_util.h"
19#include "uart.h"
20
21bool printing_enabled = false;
22uint8_t character_shift = 0;
23
24void enable_printing(void) {
25 printing_enabled = true;
26 uart_init(19200);
27}
28
29void disable_printing(void) {
30 printing_enabled = false;
31}
32
33uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29};
34
35// uint8_t keycode_to_ascii[0xFF][2];
36
37// keycode_to_ascii[KC_MINUS] = {0x2D, 0x5F};
38
39void print_char(char c) {
40 USB_Disable();
41 uart_write(c);
42 USB_Init();
43}
44
45void print_string(char c[]) {
46 for (uint8_t i = 0; i < strlen(c); i++)
47 print_char(c[i]);
48}
49
50void print_box_string(const char text[]) {
51 size_t len = strlen(text);
52 char out[len * 3 + 8];
53 out[0] = 0xDA;
54 for (uint8_t i = 0; i < len; i++) {
55 out[i + 1] = 0xC4;
56 }
57 out[len + 1] = 0xBF;
58 out[len + 2] = '\n';
59
60 out[len + 3] = 0xB3;
61 for (uint8_t i = 0; i < len; i++) {
62 out[len + 4 + i] = text[i];
63 }
64 out[len * 2 + 4] = 0xB3;
65 out[len * 2 + 5] = '\n';
66
67 out[len * 2 + 6] = 0xC0;
68 for (uint8_t i = 0; i < len; i++) {
69 out[len * 2 + 7 + i] = 0xC4;
70 }
71 out[len * 3 + 7] = 0xD9;
72 out[len * 3 + 8] = '\n';
73
74 print_string(out);
75}
76
77bool process_printer(uint16_t keycode, keyrecord_t *record) {
78 if (keycode == PRINT_ON) {
79 enable_printing();
80 return false;
81 }
82 if (keycode == PRINT_OFF) {
83 disable_printing();
84 return false;
85 }
86
87 if (printing_enabled) {
88 switch (keycode) {
89 case KC_EXLM ... KC_RPRN:
90 case KC_UNDS:
91 case KC_PLUS:
92 case KC_LCBR:
93 case KC_RCBR:
94 case KC_PIPE:
95 case KC_TILD:
96 keycode &= 0xFF;
97 case KC_LEFT_SHIFT:
98 case KC_RIGHT_SHIFT:
99 if (record->event.pressed) {
100 character_shift++;
101 } else {
102 character_shift--;
103 }
104 return false;
105 break;
106 }
107
108 switch (keycode) {
109 case KC_F1:
110 if (record->event.pressed) {
111 print_box_string("This is a line of text!");
112 }
113 return false;
114 case KC_ESCAPE:
115 if (record->event.pressed) {
116 print_char(0x1B);
117 }
118 return false;
119 break;
120 case KC_SPACE:
121 if (record->event.pressed) {
122 print_char(0x20);
123 }
124 return false;
125 break;
126 case KC_A ... KC_Z:
127 if (record->event.pressed) {
128 if (character_shift) {
129 print_char(0x41 + (keycode - KC_A));
130 } else {
131 print_char(0x61 + (keycode - KC_A));
132 }
133 }
134 return false;
135 break;
136 case KC_1 ... KC_0:
137 if (record->event.pressed) {
138 if (character_shift) {
139 print_char(shifted_numbers[keycode - KC_1]);
140 } else {
141 print_char(0x30 + ((keycode - KC_1 + 1) % 10));
142 }
143 }
144 return false;
145 break;
146 case KC_ENTER:
147 if (record->event.pressed) {
148 if (character_shift) {
149 print_char(0x0C);
150 } else {
151 print_char(0x0A);
152 }
153 }
154 return false;
155 break;
156 case KC_BACKSPACE:
157 if (record->event.pressed) {
158 if (character_shift) {
159 print_char(0x18);
160 } else {
161 print_char(0x1A);
162 }
163 }
164 return false;
165 break;
166 case KC_DOT:
167 if (record->event.pressed) {
168 if (character_shift) {
169 print_char(0x3E);
170 } else {
171 print_char(0x2E);
172 }
173 }
174 return false;
175 break;
176 case KC_COMMA:
177 if (record->event.pressed) {
178 if (character_shift) {
179 print_char(0x3C);
180 } else {
181 print_char(0x2C);
182 }
183 }
184 return false;
185 break;
186 case KC_SLASH:
187 if (record->event.pressed) {
188 if (character_shift) {
189 print_char(0x3F);
190 } else {
191 print_char(0x2F);
192 }
193 }
194 return false;
195 break;
196 case KC_QUOTE:
197 if (record->event.pressed) {
198 if (character_shift) {
199 print_char(0x22);
200 } else {
201 print_char(0x27);
202 }
203 }
204 return false;
205 break;
206 case KC_GRAVE:
207 if (record->event.pressed) {
208 if (character_shift) {
209 print_char(0x7E);
210 } else {
211 print_char(0x60);
212 }
213 }
214 return false;
215 break;
216 case KC_MINUS:
217 if (record->event.pressed) {
218 if (character_shift) {
219 print_char(0x5F);
220 } else {
221 print_char(0x2D);
222 }
223 }
224 return false;
225 break;
226 case KC_EQUAL:
227 if (record->event.pressed) {
228 if (character_shift) {
229 print_char(0x2B);
230 } else {
231 print_char(0x3D);
232 }
233 }
234 return false;
235 break;
236 case KC_LEFT_BRACKET:
237 if (record->event.pressed) {
238 if (character_shift) {
239 print_char(0x7B);
240 } else {
241 print_char(0x5B);
242 }
243 }
244 return false;
245 break;
246 case KC_RIGHT_BRACKET:
247 if (record->event.pressed) {
248 if (character_shift) {
249 print_char(0x7D);
250 } else {
251 print_char(0x5D);
252 }
253 }
254 return false;
255 break;
256 case KC_BACKSLASH:
257 if (record->event.pressed) {
258 if (character_shift) {
259 print_char(0x7C);
260 } else {
261 print_char(0x5C);
262 }
263 }
264 return false;
265 break;
266 }
267 }
268 return true;
269}
diff --git a/quantum/process_keycode/process_printer.h b/quantum/process_keycode/process_printer.h
deleted file mode 100644
index 6f4d09f333..0000000000
--- a/quantum/process_keycode/process_printer.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* Copyright 2016 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include "quantum.h"
20
21bool process_printer(uint16_t keycode, keyrecord_t *record);
diff --git a/quantum/process_keycode/process_printer_bb.c b/quantum/process_keycode/process_printer_bb.c
deleted file mode 100644
index 88a9f33994..0000000000
--- a/quantum/process_keycode/process_printer_bb.c
+++ /dev/null
@@ -1,270 +0,0 @@
1/* Copyright 2016 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "process_printer.h"
18#include "action_util.h"
19
20bool printing_enabled = false;
21uint8_t character_shift = 0;
22
23#define SERIAL_PIN_DDR DDRD
24#define SERIAL_PIN_PORT PORTD
25#define SERIAL_PIN_MASK _BV(PD3)
26#define SERIAL_DELAY 52
27
28inline static void serial_delay(void) {
29 _delay_us(SERIAL_DELAY);
30}
31
32inline static void serial_high(void) {
33 SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
34}
35
36inline static void serial_low(void) {
37 SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
38}
39
40inline static void serial_output(void) {
41 SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
42}
43
44void enable_printing() {
45 printing_enabled = true;
46 serial_output();
47 serial_high();
48}
49
50void disable_printing() {
51 printing_enabled = false;
52}
53
54uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29};
55
56// uint8_t keycode_to_ascii[0xFF][2];
57
58// keycode_to_ascii[KC_MINUS] = {0x2D, 0x5F};
59
60void print_char(char c) {
61 uint8_t b = 8;
62 serial_output();
63 while (b--) {
64 if (c & (1 << b)) {
65 serial_high();
66 } else {
67 serial_low();
68 }
69 serial_delay();
70 }
71}
72
73void print_string(char c[]) {
74 for (uint8_t i = 0; i < strlen(c); i++)
75 print_char(c[i]);
76}
77
78bool process_printer(uint16_t keycode, keyrecord_t *record) {
79 if (keycode == PRINT_ON) {
80 enable_printing();
81 return false;
82 }
83 if (keycode == PRINT_OFF) {
84 disable_printing();
85 return false;
86 }
87
88 if (printing_enabled) {
89 switch (keycode) {
90 case KC_EXLM ... KC_RPRN:
91 case KC_UNDS:
92 case KC_PLUS:
93 case KC_LCBR:
94 case KC_RCBR:
95 case KC_PIPE:
96 case KC_TILD:
97 keycode &= 0xFF;
98 case KC_LEFT_SHIFT:
99 case KC_RIGHT_SHIFT:
100 if (record->event.pressed) {
101 character_shift++;
102 } else {
103 character_shift--;
104 }
105 return false;
106 break;
107 }
108
109 switch (keycode) {
110 case KC_F1:
111 if (record->event.pressed) {
112 print_string("This is a line of text!\n\n\n");
113 }
114 return false;
115 case KC_ESCAPE:
116 if (record->event.pressed) {
117 print_char(0x1B);
118 }
119 return false;
120 break;
121 case KC_SPACE:
122 if (record->event.pressed) {
123 print_char(0x20);
124 }
125 return false;
126 break;
127 case KC_A ... KC_Z:
128 if (record->event.pressed) {
129 if (character_shift) {
130 print_char(0x41 + (keycode - KC_A));
131 } else {
132 print_char(0x61 + (keycode - KC_A));
133 }
134 }
135 return false;
136 break;
137 case KC_1 ... KC_0:
138 if (record->event.pressed) {
139 if (character_shift) {
140 print_char(shifted_numbers[keycode - KC_1]);
141 } else {
142 print_char(0x30 + ((keycode - KC_1 + 1) % 10));
143 }
144 }
145 return false;
146 break;
147 case KC_ENTER:
148 if (record->event.pressed) {
149 if (character_shift) {
150 print_char(0x0C);
151 } else {
152 print_char(0x0A);
153 }
154 }
155 return false;
156 break;
157 case KC_BACKSPACE:
158 if (record->event.pressed) {
159 if (character_shift) {
160 print_char(0x18);
161 } else {
162 print_char(0x1A);
163 }
164 }
165 return false;
166 break;
167 case KC_DOT:
168 if (record->event.pressed) {
169 if (character_shift) {
170 print_char(0x3E);
171 } else {
172 print_char(0x2E);
173 }
174 }
175 return false;
176 break;
177 case KC_COMMA:
178 if (record->event.pressed) {
179 if (character_shift) {
180 print_char(0x3C);
181 } else {
182 print_char(0x2C);
183 }
184 }
185 return false;
186 break;
187 case KC_SLASH:
188 if (record->event.pressed) {
189 if (character_shift) {
190 print_char(0x3F);
191 } else {
192 print_char(0x2F);
193 }
194 }
195 return false;
196 break;
197 case KC_QUOTE:
198 if (record->event.pressed) {
199 if (character_shift) {
200 print_char(0x22);
201 } else {
202 print_char(0x27);
203 }
204 }
205 return false;
206 break;
207 case KC_GRAVE:
208 if (record->event.pressed) {
209 if (character_shift) {
210 print_char(0x7E);
211 } else {
212 print_char(0x60);
213 }
214 }
215 return false;
216 break;
217 case KC_MINUS:
218 if (record->event.pressed) {
219 if (character_shift) {
220 print_char(0x5F);
221 } else {
222 print_char(0x2D);
223 }
224 }
225 return false;
226 break;
227 case KC_EQUAL:
228 if (record->event.pressed) {
229 if (character_shift) {
230 print_char(0x2B);
231 } else {
232 print_char(0x3D);
233 }
234 }
235 return false;
236 break;
237 case KC_LEFT_BRACKET:
238 if (record->event.pressed) {
239 if (character_shift) {
240 print_char(0x7B);
241 } else {
242 print_char(0x5B);
243 }
244 }
245 return false;
246 break;
247 case KC_RIGHT_BRACKET:
248 if (record->event.pressed) {
249 if (character_shift) {
250 print_char(0x7D);
251 } else {
252 print_char(0x5D);
253 }
254 }
255 return false;
256 break;
257 case KC_BACKSLASH:
258 if (record->event.pressed) {
259 if (character_shift) {
260 print_char(0x7C);
261 } else {
262 print_char(0x5C);
263 }
264 }
265 return false;
266 break;
267 }
268 }
269 return true;
270}
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 2333357be1..c60ec22d8b 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -316,9 +316,6 @@ bool process_record_quantum(keyrecord_t *record) {
316#ifdef LEADER_ENABLE 316#ifdef LEADER_ENABLE
317 process_leader(keycode, record) && 317 process_leader(keycode, record) &&
318#endif 318#endif
319#ifdef PRINTING_ENABLE
320 process_printer(keycode, record) &&
321#endif
322#ifdef AUTO_SHIFT_ENABLE 319#ifdef AUTO_SHIFT_ENABLE
323 process_auto_shift(keycode, record) && 320 process_auto_shift(keycode, record) &&
324#endif 321#endif
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 9c1b9952b8..4192b3fb16 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -121,10 +121,6 @@ extern layer_state_t layer_state;
121# include "process_tap_dance.h" 121# include "process_tap_dance.h"
122#endif 122#endif
123 123
124#ifdef PRINTING_ENABLE
125# include "process_printer.h"
126#endif
127
128#ifdef AUTO_SHIFT_ENABLE 124#ifdef AUTO_SHIFT_ENABLE
129# include "process_auto_shift.h" 125# include "process_auto_shift.h"
130#endif 126#endif