summaryrefslogtreecommitdiff
path: root/keyboards/crkbd/rev1/common/keymaps/via/keymap.c
diff options
context:
space:
mode:
authorKosuke Adachi <ks@fstn.jp>2020-11-17 14:18:45 +0900
committerGitHub <noreply@github.com>2020-11-16 21:18:45 -0800
commit503b76253891a9820ad2d21a89617654dc4414fb (patch)
treedd5e29cb2584a86486e9c779ccb6f125771365fa /keyboards/crkbd/rev1/common/keymaps/via/keymap.c
parent88c09aa89232ad9581f5e2313f377443ee6dd0dc (diff)
downloadqmk_firmware-503b76253891a9820ad2d21a89617654dc4414fb.tar.gz
qmk_firmware-503b76253891a9820ad2d21a89617654dc4414fb.zip
Refactor the crkbd/via keymap and fix OLED bugs (#10354)
* Refactor the crkbd/via keymap and fix OLED bugs * Revert "Refactor the crkbd/via keymap and fix OLED bugs" This reverts commit dc9db029fc6b077fc7600b49e920b755c522d100. * Fix OLED display bugs * Remove unused functions * Remove uncessary the key logger * Add new lines at end of file * Remove unnecesary extern for is_master * Remove extern is_master from rev1.h * Remove ssd1306 from common dir because its the legacy lib * Update default keymap based the via keymap * Remove foostan keymap because it will be legacy * Revert Remove unnecesary extern for is_master * Remove unnecessary backslashes.
Diffstat (limited to 'keyboards/crkbd/rev1/common/keymaps/via/keymap.c')
-rw-r--r--keyboards/crkbd/rev1/common/keymaps/via/keymap.c47
1 files changed, 14 insertions, 33 deletions
diff --git a/keyboards/crkbd/rev1/common/keymaps/via/keymap.c b/keyboards/crkbd/rev1/common/keymaps/via/keymap.c
index a3b2e52ce5..ecd1f17a5c 100644
--- a/keyboards/crkbd/rev1/common/keymaps/via/keymap.c
+++ b/keyboards/crkbd/rev1/common/keymaps/via/keymap.c
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- [0] = LAYOUT_split_3x6_3( \
+ [0] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
@@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
- [1] = LAYOUT_split_3x6_3( \
+ [1] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
@@ -40,11 +40,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
- KC_LGUI, _______, KC_SPC, KC_ENT, _______, KC_RALT\
+ KC_LGUI, _______, KC_SPC, KC_ENT, _______, KC_RALT
//`--------------------------' `--------------------------'
),
- [2] = LAYOUT_split_3x6_3( \
+ [2] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
@@ -56,15 +56,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//`--------------------------' `--------------------------'
),
- [3] = LAYOUT_split_3x6_3( \
+ [3] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
- RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\
+ RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
- RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\
+ RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
- RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\
+ RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
- KC_LGUI, _______, KC_SPC, KC_ENT, _______, KC_RALT\
+ KC_LGUI, _______, KC_SPC, KC_ENT, _______, KC_RALT
//`--------------------------' `--------------------------'
)
};
@@ -83,30 +83,28 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
#define L_ADJUST 8
void oled_render_layer_state(void) {
- oled_write_P("Layer: ", false);
+ oled_write_P(PSTR("Layer: "), false);
switch (layer_state) {
case L_BASE:
- oled_write_ln_P("Default", false);
+ oled_write_ln_P(PSTR("Default"), false);
break;
case L_LOWER:
- oled_write_ln_P("Lower", false);
+ oled_write_ln_P(PSTR("Lower"), false);
break;
case L_RAISE:
- oled_write_ln_P("Raise", false);
+ oled_write_ln_P(PSTR("Raise"), false);
break;
case L_ADJUST:
case L_ADJUST|L_LOWER:
case L_ADJUST|L_RAISE:
case L_ADJUST|L_LOWER|L_RAISE:
- oled_write_ln_P("Adjust", false);
+ oled_write_ln_P(PSTR("Adjust"), false);
break;
}
}
char keylog_str[24] = {};
-char keylogs_str[21] = {};
-int keylogs_str_idx = 0;
const char code_to_name[60] = {
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
@@ -128,25 +126,11 @@ void set_keylog(uint16_t keycode, keyrecord_t *record) {
snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
record->event.key.row, record->event.key.col,
keycode, name);
-
- // update keylogs
- if (keylogs_str_idx == sizeof(keylogs_str) - 1) {
- keylogs_str_idx = 0;
- for (int i = 0; i < sizeof(keylogs_str) - 1; i++) {
- keylogs_str[i] = ' ';
- }
- }
-
- keylogs_str[keylogs_str_idx] = name;
- keylogs_str_idx++;
}
void oled_render_keylog(void) {
oled_write(keylog_str, false);
}
-void oled_render_keylogs(void) {
- oled_write(keylogs_str, false);
-}
void render_bootmagic_status(bool status) {
/* Show Ctrl-Gui Swap options */
@@ -176,8 +160,6 @@ void oled_task_user(void) {
if (is_master) {
oled_render_layer_state();
oled_render_keylog();
- // oled_render_keylogs();
- // oled_renger_bootmagic_icon(keymap_config.swap_lalt_lgui);
} else {
oled_render_logo();
}
@@ -186,7 +168,6 @@ void oled_task_user(void) {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
set_keylog(keycode, record);
- // set_timelog();
}
return true;
}