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: Fix broken build for users/curry (#16492) --- 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 ++++++++++-- 7 files changed, 56 insertions(+), 9 deletions(-) (limited to 'users/curry') 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++) { -- cgit v1.2.3