aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-04-18 14:02:32 -0700
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-04-18 14:02:32 -0700
commita58c66df88d1da9c57e5e4ccffb78c7882b55706 (patch)
tree7f8516d78de2764a818b5584a96e3f604f5f0757
parent162a1d39b6ece786d31b934db3fb1b5721c05568 (diff)
downloadqmk_firmware-a58c66df88d1da9c57e5e4ccffb78c7882b55706.tar.gz
qmk_firmware-a58c66df88d1da9c57e5e4ccffb78c7882b55706.zip
Reduce CRKBD firmware size by reducing layer numbers (#5471)
* Reduce CRKBD firmware size by reducing layer numbers * Update layer output code based on mtei's suggestion/code * Fix spacing * Revert "Update layer output code based on mtei's suggestion/code" This reverts commit 036d347db309170afd5676e694adfda69f912615. Unfortunately, because this is NOT in the keymap itself, the layer macros aren't accessible and will error on commit * Add comment for future person
-rw-r--r--keyboards/crkbd/keymaps/default/keymap.c7
-rw-r--r--keyboards/crkbd/keymaps/omgvee/keymap.c7
-rw-r--r--keyboards/crkbd/keymaps/thefrey/keymap.c7
-rw-r--r--keyboards/crkbd/lib/layer_state_reader.c9
4 files changed, 14 insertions, 16 deletions
diff --git a/keyboards/crkbd/keymaps/default/keymap.c b/keyboards/crkbd/keymaps/default/keymap.c
index 1e2e57a2b..5bb89d259 100644
--- a/keyboards/crkbd/keymaps/default/keymap.c
+++ b/keyboards/crkbd/keymaps/default/keymap.c
@@ -22,9 +22,9 @@ extern uint8_t is_master;
22// Layer names don't all need to be of the same length, obviously, and you can also skip them 22// Layer names don't all need to be of the same length, obviously, and you can also skip them
23// entirely and just use numbers. 23// entirely and just use numbers.
24#define _QWERTY 0 24#define _QWERTY 0
25#define _LOWER 3 25#define _LOWER 1
26#define _RAISE 4 26#define _RAISE 2
27#define _ADJUST 16 27#define _ADJUST 3
28 28
29enum custom_keycodes { 29enum custom_keycodes {
30 QWERTY = SAFE_RANGE, 30 QWERTY = SAFE_RANGE,
@@ -246,4 +246,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
246 } 246 }
247 return true; 247 return true;
248} 248}
249
diff --git a/keyboards/crkbd/keymaps/omgvee/keymap.c b/keyboards/crkbd/keymaps/omgvee/keymap.c
index 2f79250f8..2c33d8b8c 100644
--- a/keyboards/crkbd/keymaps/omgvee/keymap.c
+++ b/keyboards/crkbd/keymaps/omgvee/keymap.c
@@ -22,9 +22,9 @@ extern uint8_t is_master;
22// Layer names don't all need to be of the same length, obviously, and you can also skip them 22// Layer names don't all need to be of the same length, obviously, and you can also skip them
23// entirely and just use numbers. 23// entirely and just use numbers.
24#define _QWERTY 0 24#define _QWERTY 0
25#define _LOWER 3 25#define _LOWER 1
26#define _RAISE 4 26#define _RAISE 2
27#define _ADJUST 16 27#define _ADJUST 3
28 28
29enum custom_keycodes { 29enum custom_keycodes {
30 QWERTY = SAFE_RANGE, 30 QWERTY = SAFE_RANGE,
@@ -240,4 +240,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
240 } 240 }
241 return true; 241 return true;
242} 242}
243
diff --git a/keyboards/crkbd/keymaps/thefrey/keymap.c b/keyboards/crkbd/keymaps/thefrey/keymap.c
index 5077bfc87..9a142a924 100644
--- a/keyboards/crkbd/keymaps/thefrey/keymap.c
+++ b/keyboards/crkbd/keymaps/thefrey/keymap.c
@@ -22,9 +22,9 @@ extern uint8_t is_master;
22// Layer names don't all need to be of the same length, obviously, and you can also skip them 22// Layer names don't all need to be of the same length, obviously, and you can also skip them
23// entirely and just use numbers. 23// entirely and just use numbers.
24#define _QWERTY 0 24#define _QWERTY 0
25#define _LOWER 3 25#define _LOWER 1
26#define _RAISE 4 26#define _RAISE 2
27#define _ADJUST 16 27#define _ADJUST 3
28 28
29enum custom_keycodes { 29enum custom_keycodes {
30 QWERTY = SAFE_RANGE, 30 QWERTY = SAFE_RANGE,
@@ -241,4 +241,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
241 } 241 }
242 return true; 242 return true;
243} 243}
244
diff --git a/keyboards/crkbd/lib/layer_state_reader.c b/keyboards/crkbd/lib/layer_state_reader.c
index eddb71337..63d80b136 100644
--- a/keyboards/crkbd/lib/layer_state_reader.c
+++ b/keyboards/crkbd/lib/layer_state_reader.c
@@ -3,11 +3,12 @@
3#include <stdio.h> 3#include <stdio.h>
4#include "crkbd.h" 4#include "crkbd.h"
5 5
6// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c
6#define L_BASE 0 7#define L_BASE 0
7#define L_LOWER 8 8#define L_LOWER 2
8#define L_RAISE 16 9#define L_RAISE 4
9#define L_ADJUST 65536 10#define L_ADJUST 8
10#define L_ADJUST_TRI 65560 11#define L_ADJUST_TRI 14
11 12
12char layer_state_str[24]; 13char layer_state_str[24];
13 14