From 9ead40db0cde5568b4be4b199615cc284ed4e7a8 Mon Sep 17 00:00:00 2001 From: Allen Choi <37539914+Thunderbird2086@users.noreply.github.com> Date: Tue, 19 Apr 2022 20:00:01 +0900 Subject: [PATCH] Fix broken build for users/curry (#16492) --- keyboards/crkbd/keymaps/curry/config.h | 6 ++++++ keyboards/crkbd/keymaps/curry/keymap.c | 8 +++++++ keyboards/lily58/keymaps/curry/config.h | 5 +++++ keyboards/lily58/keymaps/curry/keymap.c | 6 ++++++ .../rebound/rev1/keymaps/curry/config.h | 7 +++++++ .../rebound/rev1/keymaps/curry/keymap.c | 8 +++++++ users/curry/config.h | 4 ++-- users/curry/curry.c | 2 ++ users/curry/curry.h | 10 ++++++++- users/curry/oled.c | 10 ++++++++- users/curry/process_records.h | 21 ++++++++++++++++--- users/curry/rgb_lighting_user.c | 6 ++++++ users/curry/rgb_matrix_user.c | 12 +++++++++-- 13 files changed, 96 insertions(+), 9 deletions(-) create mode 100644 keyboards/montsinger/rebound/rev1/keymaps/curry/config.h diff --git a/keyboards/crkbd/keymaps/curry/config.h b/keyboards/crkbd/keymaps/curry/config.h index a7c4ed7403..ba9c69ed26 100644 --- a/keyboards/crkbd/keymaps/curry/config.h +++ b/keyboards/crkbd/keymaps/curry/config.h @@ -13,3 +13,9 @@ # define RGB_MATRIX_VAL_STEP 5 # define RGB_MATRIX_SPD_STEP 10 #endif + +// comment out unnecessary layouts +#define ENABLE_QWERTY +#define ENABLE_COLEMAK +#define ENABLE_DVORAK +#define ENABLE_WORKMAN diff --git a/keyboards/crkbd/keymaps/curry/keymap.c b/keyboards/crkbd/keymaps/curry/keymap.c index e56f77ebeb..43a3147619 100644 --- a/keyboards/crkbd/keymaps/curry/keymap.c +++ b/keyboards/crkbd/keymaps/curry/keymap.c @@ -14,29 +14,37 @@ #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +#if defined(ENABLE_QWERTY) [_QWERTY] = LAYOUT_crkbd_base_wrapper( _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ ), +#endif +#if defined(ENABLE_COLEMAK) [_COLEMAK] = LAYOUT_crkbd_base_wrapper( _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ ), +#endif +#if defined(ENABLE_DVORAK) [_DVORAK] = LAYOUT_crkbd_base_wrapper( _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ ), +#endif +#if defined(ENABLE_WORKMAN) [_WORKMAN] = LAYOUT_crkbd_base_wrapper( _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ ), +#endif [_MODS] = LAYOUT_wrapper( _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, diff --git a/keyboards/lily58/keymaps/curry/config.h b/keyboards/lily58/keymaps/curry/config.h index a4c697df42..b3e82389d8 100644 --- a/keyboards/lily58/keymaps/curry/config.h +++ b/keyboards/lily58/keymaps/curry/config.h @@ -15,3 +15,8 @@ # define RGBLIGHT_VAL_STEP 5 # define RGBLIGHT_LIMIT_VAL 120 #endif + +// comment out unnecessary layouts +#define ENABLE_QWERTY +#define ENABLE_COLEMAK +#define ENABLE_DVORAK diff --git a/keyboards/lily58/keymaps/curry/keymap.c b/keyboards/lily58/keymaps/curry/keymap.c index bc779305a2..12dde22578 100644 --- a/keyboards/lily58/keymaps/curry/keymap.c +++ b/keyboards/lily58/keymaps/curry/keymap.c @@ -16,26 +16,32 @@ #define LAYOUT_lily58_base_wrapper(...) LAYOUT_lily58_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +#if defined(ENABLE_QWERTY) [_QWERTY] = LAYOUT_lily58_base_wrapper( ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ ), +#endif +#if defined(ENABLE_COLEMAK) [_COLEMAK] = LAYOUT_lily58_base_wrapper( ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ ), +#endif +#if defined(ENABLE_DVORAK) [_DVORAK] = LAYOUT_lily58_base_wrapper( ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ ), +#endif [_MODS] = LAYOUT_wrapper( _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, diff --git a/keyboards/montsinger/rebound/rev1/keymaps/curry/config.h b/keyboards/montsinger/rebound/rev1/keymaps/curry/config.h new file mode 100644 index 0000000000..2c9f97d587 --- /dev/null +++ b/keyboards/montsinger/rebound/rev1/keymaps/curry/config.h @@ -0,0 +1,7 @@ +#pragma once + +// comment out unnecessary layouts +#define ENABLE_QWERTY +#define ENABLE_COLEMAK +#define ENABLE_DVORAK +#define ENABLE_WORKMAN diff --git a/keyboards/montsinger/rebound/rev1/keymaps/curry/keymap.c b/keyboards/montsinger/rebound/rev1/keymaps/curry/keymap.c index 1b8f4f4ac9..49b328271d 100644 --- a/keyboards/montsinger/rebound/rev1/keymaps/curry/keymap.c +++ b/keyboards/montsinger/rebound/rev1/keymaps/curry/keymap.c @@ -14,29 +14,37 @@ #define LAYOUT_rebound_base_wrapper(...) LAYOUT_rebound_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +#if defined(ENABLE_QWERTY) [_QWERTY] = LAYOUT_rebound_base_wrapper( _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ ), +#endif +#if defined(ENABLE_COLEMAK) [_COLEMAK] = LAYOUT_rebound_base_wrapper( _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ ), +#endif +#if defined(ENABLE_DVORAK) [_DVORAK] = LAYOUT_rebound_base_wrapper( _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ ), +#endif +#if defined(ENABLE_WORKMAN) [_WORKMAN] = LAYOUT_rebound_base_wrapper( _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ ), +#endif [_LOWER] = LAYOUT_ortho_4x12_wrapper( KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F12, diff --git a/users/curry/config.h b/users/curry/config.h index 31baea6257..3301ebe533 100644 --- a/users/curry/config.h +++ b/users/curry/config.h @@ -32,7 +32,7 @@ # undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT # undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN # undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN -// # undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL # undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON # undef ENABLE_RGB_MATRIX_DUAL_BEACON # undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL @@ -41,7 +41,7 @@ # undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS # undef ENABLE_RGB_MATRIX_RAINDROPS # undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -// # undef ENABLE_RGB_MATRIX_TYPING_HEATMAP +# define ENABLE_RGB_MATRIX_TYPING_HEATMAP # undef ENABLE_RGB_MATRIX_DIGITAL_RAIN # undef ENABLE_RGB_MATRIX_SOLID_REACTIVE # undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE diff --git a/users/curry/curry.c b/users/curry/curry.c index 0353553591..a9f9f79870 100644 --- a/users/curry/curry.c +++ b/users/curry/curry.c @@ -14,9 +14,11 @@ void bootmagic_lite(void) { wait_ms(30); #endif matrix_scan(); +#if defined(BOOTMAGIC_ENABLE) if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { bootloader_jump(); } +#endif } __attribute__((weak)) void keyboard_pre_init_keymap(void) {} diff --git a/users/curry/curry.h b/users/curry/curry.h index ee4a736835..7a9e6c9eb6 100644 --- a/users/curry/curry.h +++ b/users/curry/curry.h @@ -25,10 +25,18 @@ /* Define layer names */ enum userspace_layers { - _QWERTY = 0, +#if defined(ENABLE_QWERTY) + _QWERTY, +#endif +#if defined(ENABLE_COLEMAK) _COLEMAK, +#endif +#if defined(ENABLE_DVORAK) _DVORAK, +#endif +#if defined(ENABLE_WORKMAN) _WORKMAN, +#endif _MODS, _LOWER, _RAISE, diff --git a/users/curry/oled.c b/users/curry/oled.c index 27f6072ff1..5a8f0de61d 100644 --- a/users/curry/oled.c +++ b/users/curry/oled.c @@ -56,18 +56,26 @@ void render_keylogger_status(void) { void render_default_layer_state(void) { oled_write_P(PSTR("Lyout"), false); switch (get_highest_layer(default_layer_state)) { +#if defined(ENABLE_QWERTY) case _QWERTY: oled_write_P(PSTR(" QRTY"), false); break; +#endif +#if defined(ENABLE_COLEMAK) case _COLEMAK: oled_write_P(PSTR(" COLE"), false); break; +#endif +#if defined(ENABLE_DVORAK) case _DVORAK: oled_write_P(PSTR(" DVRK"), false); break; +#endif +#if defined(ENABLE_WORKMAN) case _WORKMAN: oled_write_P(PSTR(" WRKM"), false); break; +#endif } } @@ -140,7 +148,7 @@ void render_status_secondary(void) { bool oled_task_user(void) { if (timer_elapsed32(oled_timer) > 30000) { oled_off(); - return; + return false; } #if !defined(SPLIT_KEYBOARD) else { diff --git a/users/curry/process_records.h b/users/curry/process_records.h index 0aa873648b..605abdfae2 100644 --- a/users/curry/process_records.h +++ b/users/curry/process_records.h @@ -43,9 +43,24 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #define KC_SEC5 KC_SECRET_5 #define QWERTY KC_QWERTY -#define DVORAK KC_DVORAK -#define COLEMAK KC_COLEMAK -#define WORKMAN KC_WORKMAN +#define DVORAK KC_NO +#define COLEMAK KC_NO +#define WORKMAN KC_NO + +#if defined(ENABLE_DVORAK) +# undef DVORAK +# define DVORAK KC_DVORAK +#endif + +#if defined(ENABLE_COLEMAK) +# undef COLEMAK +# define COLEMAK KC_COLEMAK +#endif + +#if defined(ENABLE_WORKMAN) +# undef WORKMAN +# define WORKMAN KC_WORKMAN +#endif #define KC_RST RESET diff --git a/users/curry/rgb_lighting_user.c b/users/curry/rgb_lighting_user.c index 25e1ce0104..b8d519feca 100644 --- a/users/curry/rgb_lighting_user.c +++ b/users/curry/rgb_lighting_user.c @@ -304,15 +304,21 @@ layer_state_t layer_state_set_rgb(layer_state_t state) { { uint8_t mode = get_highest_layer(state) == _MODS ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT; switch (get_highest_layer(default_layer_state)) { +#if defined(ENABLE_COLEMAK) case _COLEMAK: rgblight_set_hsv_and_mode(HSV_MAGENTA, mode); break; +#endif +#if defined(ENABLE_DVORAK) case _DVORAK: rgblight_set_hsv_and_mode(HSV_SPRINGGREEN, mode); break; +#endif +#if defined(ENABLE_WORKMAN) case _WORKMAN: rgblight_set_hsv_and_mode(HSV_GOLDENROD, mode); break; +#endif default: rgblight_set_hsv_and_mode(HSV_CYAN, mode); break; diff --git a/users/curry/rgb_matrix_user.c b/users/curry/rgb_matrix_user.c index d1698b087c..96f1f1d4f3 100644 --- a/users/curry/rgb_matrix_user.c +++ b/users/curry/rgb_matrix_user.c @@ -13,23 +13,31 @@ void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } void check_default_layer(uint8_t mode, uint8_t type) { switch (get_highest_layer(default_layer_state)) { +#if defined(ENABLE_QWERTY) case _QWERTY: rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type); break; +#endif +#if defined(ENABLE_COLEMAK) case _COLEMAK: rgb_matrix_layer_helper(HSV_MAGENTA, mode, rgb_matrix_config.speed, type); break; +#endif +#if defined(ENABLE_DVORAK) case _DVORAK: rgb_matrix_layer_helper(HSV_SPRINGGREEN, mode, rgb_matrix_config.speed, type); break; +#endif +#if defined(ENABLE_WORKMAN) case _WORKMAN: rgb_matrix_layer_helper(HSV_GOLDENROD, mode, rgb_matrix_config.speed, type); break; +#endif } } void rgb_matrix_indicators_user(void) { - if (userspace_config.rgb_layer_change && !g_suspend_state && rgb_matrix_config.enable) { + if (userspace_config.rgb_layer_change && rgb_matrix_config.enable) { switch (get_highest_layer(layer_state)) { case _RAISE: rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); @@ -120,7 +128,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode switch (mode) { case 1: // breathing { - uint16_t time = scale16by8(g_rgb_counters.tick, speed / 8); + uint16_t time = scale16by8(RGBLED_NUM, speed / 8); hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); RGB rgb = hsv_to_rgb(hsv); for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {