Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keyboard] Revert "Fix id67 RGB Matrix (#16916)" - on IDOBAO ID67 kb #16917

Merged
merged 10 commits into from
May 12, 2022
Merged
56 changes: 23 additions & 33 deletions keyboards/idobao/id67/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/* USB Device descriptor parameter */
#define VENDOR_ID 0x6964 /* "id" */
#define PRODUCT_ID 0x0067
#define DEVICE_VER 0x0001
#define DEVICE_VER 0x0002
#define MANUFACTURER IDOBAO
#define PRODUCT ID67

Expand All @@ -46,37 +46,19 @@
#define DIODE_DIRECTION COL2ROW
#define RGB_DI_PIN F0

// RGB Light config
#if defined(RGBLIGHT_ENABLE)
#define RGBLED_NUM 77
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LIMIT_VAL 150 /* The maximum brightness level */
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
/*== all animations enable ==*/
#define RGBLIGHT_ANIMATIONS
// /*== or choose animations ==*/
// #define RGBLIGHT_EFFECT_BREATHING
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
// #define RGBLIGHT_EFFECT_SNAKE
// #define RGBLIGHT_EFFECT_KNIGHT
// #define RGBLIGHT_EFFECT_CHRISTMAS
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
// #define RGBLIGHT_EFFECT_RGB_TEST
// #define RGBLIGHT_EFFECT_ALTERNATING
#endif

// RGB Matrix config
#if defined(RGB_MATRIX_ENABLE)
#define DRIVER_LED_TOTAL 77
#define DRIVER_LED_UNDERGLOW 10
#ifndef ID67_DISABLE_UNDERGLOW
#define DRIVER_LED_TOTAL 77
#else
#define DRIVER_LED_TOTAL 67
#endif

#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to x out of 255. If not defined maximum brightness is set to 255

#define RGB_MATRIX_KEYPRESSES

#define ENABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom, speed controls how much gradient changes
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT // Static gradient left to right, speed controls how much gradient changes
Expand All @@ -92,18 +74,26 @@
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradent Chevron shapped scrolling left to right
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradient Chevron shaped scrolling left to right
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard
#define ENABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard
#define ENABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation
#define ENABLE_RGB_MATRIX_HUE_BREATHING // Hue shifts up a slight ammount at the same time, then shifts back
#define ENABLE_RGB_MATRIX_HUE_PENDULUM // Hue shifts up a slight ammount in a wave to the right, then back to the left
#define ENABLE_RGB_MATRIX_HUE_WAVE // Hue shifts up a slight ammount and then back down in a wave to the right
#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
#define ENABLE_RGB_MATRIX_HUE_BREATHING // Hue shifts up a slight amount at the same time, then shifts back
#define ENABLE_RGB_MATRIX_HUE_PENDULUM // Hue shifts up a slight amount in a wave to the right, then back to the left
#define ENABLE_RGB_MATRIX_HUE_WAVE // Hue shifts up a slight amount and then back down in a wave to the right

// don't need `#if`, animation modes themselves check defines
// #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
// #define ENABLE_RGB_MATRIX_TYPING_HEATMAP
// #define ENABLE_RGB_MATRIX_DIGITAL_RAIN
// #endif // #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)

// don't need `#if`, animation modes themselves check defines
// #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE// Pulses keys hit to hue & value then fades value out
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
Expand All @@ -116,5 +106,5 @@
#define ENABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out
#define ENABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out
#endif // #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
// #endif // #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
#endif // #if defined(RGB_MATRIX_ENABLE)
43 changes: 39 additions & 4 deletions keyboards/idobao/id67/id67.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

#define __ NO_LED

// Indices are reveresed on the physical board, top left is bottom right.
#if defined(RGB_MATRIX_ENABLE)

/* NB!!: Indices are reversed on the physical board, top left is bottom right.
* These "LED Index to *" arrays are in that reversed order!
* i.e., Space row on top, listed right to left */
led_config_t g_led_config = { {
// Key Matrix to LED Index
{66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52},
Expand Down Expand Up @@ -47,15 +51,46 @@ led_config_t g_led_config = { {
1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, // third row
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, // fourth row
1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 // fifth row
// underglow leds
// underglow LEDs
#ifndef ID67_DISABLE_UNDERGLOW
, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
#endif
} };

__attribute__ ((weak))
#endif // #ifdef RGB_MATRIX_ENABLE


/* Use `#define ID67_CAPS_LOCK_KEY_INDEX 36` in `keymaps/yourkeymap/config.h`
* if you want to enable Caps-Lock LED mode */
#if defined(RGB_MATRIX_ENABLE) && defined(ID67_CAPS_LOCK_KEY_INDEX)

#define ID67_CAPS_LOCK_MAX_BRIGHTNESS 0xFF
#ifdef RGB_MATRIX_MAXIMUM_BRIGHTNESS
#undef ID67_CAPS_LOCK_MAX_BRIGHTNESS
#define ID67_CAPS_LOCK_MAX_BRIGHTNESS RGB_MATRIX_MAXIMUM_BRIGHTNESS
#endif

#define ID67_CAPS_LOCK_VAL_STEP 8
#ifdef RGB_MATRIX_VAL_STEP
#undef ID67_CAPS_LOCK_VAL_STEP
#define ID67_CAPS_LOCK_VAL_STEP RGB_MATRIX_VAL_STEP
#endif

/* This function is defined as weak, so if you create your own in keymap then
* that will compile, not this */
__attribute__((weak))
void rgb_matrix_indicators_user(void) {
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(23, 0xFF, 0xFF, 0xFF);
uint8_t b = rgb_matrix_get_val();
if (b < ID67_CAPS_LOCK_VAL_STEP) {
b = ID67_CAPS_LOCK_VAL_STEP;
} else if (b < (ID67_CAPS_LOCK_MAX_BRIGHTNESS - ID67_CAPS_LOCK_VAL_STEP)) {
b += ID67_CAPS_LOCK_VAL_STEP; // one step more than current brightness
} else {
b = ID67_CAPS_LOCK_MAX_BRIGHTNESS;
}
rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, b, b, b); // white, with the adjusted brightness
}
}

#endif // #ifdef ID67_CAPS_LOCK_KEY_INDEX
6 changes: 3 additions & 3 deletions keyboards/idobao/id67/info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"keyboard_name": "ID67 RGB Matrix variant",
"url": "",
"maintainer": "qmk",
"keyboard_name": "ID67",
"url": "https://idobao.net",
"maintainer": "thewerther",
"layout_aliases": {
"LAYOUT": "LAYOUT_65_ansi_blocker"
},
Expand Down
26 changes: 0 additions & 26 deletions keyboards/idobao/id67/keymaps/default_nug/config.h

This file was deleted.

41 changes: 0 additions & 41 deletions keyboards/idobao/id67/keymaps/default_nug/keymap.c

This file was deleted.

7 changes: 3 additions & 4 deletions keyboards/idobao/id67/keymaps/thewerther/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
#define TAPPING_TERM 500

#if defined(RGB_MATRIX_ENABLE)
#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255

// change saturation and hue step size
#undef RGBLIGHT_HUE_STEP
Expand Down Expand Up @@ -85,11 +84,11 @@
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN

#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
// #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE// Pulses keys hit to hue & value then fades value out
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out
#endif // # if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
// #endif // # if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
#endif // # if defined(RGB_MATRIX_ENABLE)

22 changes: 0 additions & 22 deletions keyboards/idobao/id67/keymaps/via/config.h

This file was deleted.

27 changes: 0 additions & 27 deletions keyboards/idobao/id67/keymaps/via_nug/config.h

This file was deleted.

53 changes: 0 additions & 53 deletions keyboards/idobao/id67/keymaps/via_nug/keymap.c

This file was deleted.

2 changes: 0 additions & 2 deletions keyboards/idobao/id67/keymaps/via_nug/rules.mk

This file was deleted.

Loading