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
This commit is contained in:
Drashna Jaelre 2019-04-18 14:02:32 -07:00 committed by MechMerlin
parent 162a1d39b6
commit a58c66df88
4 changed files with 14 additions and 16 deletions

View File

@ -22,9 +22,9 @@ extern uint8_t is_master;
// Layer names don't all need to be of the same length, obviously, and you can also skip them // Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers. // entirely and just use numbers.
#define _QWERTY 0 #define _QWERTY 0
#define _LOWER 3 #define _LOWER 1
#define _RAISE 4 #define _RAISE 2
#define _ADJUST 16 #define _ADJUST 3
enum custom_keycodes { enum custom_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
@ -246,4 +246,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return true; return true;
} }

View File

@ -22,9 +22,9 @@ extern uint8_t is_master;
// Layer names don't all need to be of the same length, obviously, and you can also skip them // Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers. // entirely and just use numbers.
#define _QWERTY 0 #define _QWERTY 0
#define _LOWER 3 #define _LOWER 1
#define _RAISE 4 #define _RAISE 2
#define _ADJUST 16 #define _ADJUST 3
enum custom_keycodes { enum custom_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
@ -240,4 +240,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return true; return true;
} }

View File

@ -22,9 +22,9 @@ extern uint8_t is_master;
// Layer names don't all need to be of the same length, obviously, and you can also skip them // Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers. // entirely and just use numbers.
#define _QWERTY 0 #define _QWERTY 0
#define _LOWER 3 #define _LOWER 1
#define _RAISE 4 #define _RAISE 2
#define _ADJUST 16 #define _ADJUST 3
enum custom_keycodes { enum custom_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
@ -241,4 +241,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return true; return true;
} }

View File

@ -3,11 +3,12 @@
#include <stdio.h> #include <stdio.h>
#include "crkbd.h" #include "crkbd.h"
// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c
#define L_BASE 0 #define L_BASE 0
#define L_LOWER 8 #define L_LOWER 2
#define L_RAISE 16 #define L_RAISE 4
#define L_ADJUST 65536 #define L_ADJUST 8
#define L_ADJUST_TRI 65560 #define L_ADJUST_TRI 14
char layer_state_str[24]; char layer_state_str[24];