Files
zsa_qmk_firmware/keyboards/voyager/rgb_matrix_kb.inc
Florian Didron 551d63b98f feat/voyager (#374)
* feat: tentative fix for keyboard crash during esd testing

* feat: adds support for the GD32 voyager

* feat: adds voyager's dfu suffix

* fix: instability issues over i2c

* fix: more robust right side scan

* fix: tentative delay after init

* Revert "fix: tentative delay after init"

This reverts commit b0a6461cf1.

* fix: scan left side in between right scan process

* fix: resets matrix + layer state when reconnecting the right side

* chore: comments and code cleanup

* fix: restore previous control flow

* fix: decouple led driver reinit from io expander reinit

* feat: reinit led drivers independtly

* fix: prevents slamming the led driver over i2c

* Revert "fix: prevents slamming the led driver over i2c"

This reverts commit 48b8c809ea.

* Revert "feat: reinit led drivers independtly"

This reverts commit 6405e6b367.

* fix: reboot on io expander

* fix: wait time after reading the io expander

* chore: code cleanup and some refactors.

* feat: adds led brightness and status led control over hid

* fix: remove stray printf

* fix: compilation error on ergodox

* fix: gd32 eeprom fix

* fix: caps lock crash

* fix: soft reset to bootloader key.

* chore: move the app address define where it should be

* fix: cleanup + debounce default

* feat: tentatively set gd32 clock to 98Mhz

* feat: realign to latest chibios contrib

* chore: points to ZSA's chibios contrib fork

---------

Co-authored-by: Florian Didron <0x6664@hey.com>
2023-09-06 20:45:35 +07:00

33 lines
927 B
C++

#ifdef RGB_MATRIX_ENABLE
RGB_MATRIX_EFFECT(oryx_webhid_effect)
# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
static void oryx_webhid_effect_init(void) {
// Paint it black
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; ++i) {
webhid_leds[i] = (RGB){0, 0, 0};
}
}
static bool oryx_webhid_effect_run(effect_params_t* params) {
RGB_MATRIX_USE_LIMITS(led_min, led_max);
uint8_t val = rgb_matrix_get_val() * 100 / 175;
if(val == 0) {
rgb_matrix_set_color_all(0, 0, 0);
}
else {
for (uint8_t i = led_min; i < led_max; ++i) {
rgb_matrix_set_color(i, webhid_leds[i].r * val / 100, webhid_leds[i].g * val / 100, webhid_leds[i].b * val / 100);
}
}
return rgb_matrix_check_finished_leds(led_max);
}
static bool oryx_webhid_effect(effect_params_t* params) {
if (params->init) oryx_webhid_effect_init();
return oryx_webhid_effect_run(params);
}
# endif
#endif