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

[Bug] rgb matrix Digital rain ignores RGB_MATRIX_MAXIMUM_BRIGHTNESS #16705

Closed
KoenGoe opened this issue Mar 21, 2022 · 2 comments
Closed

[Bug] rgb matrix Digital rain ignores RGB_MATRIX_MAXIMUM_BRIGHTNESS #16705

KoenGoe opened this issue Mar 21, 2022 · 2 comments

Comments

@KoenGoe
Copy link

KoenGoe commented Mar 21, 2022

The digital rain rgb matrix animation has its own hardcoded constants for maximum brightness, instead of using RGB_MATRIX_MAXIMUM_BRIGHTNESS, nor is checked it in rgb_matrix_set_color that it calls.
So it is checked nowhere, and leds are just set at brightnesses over the maximum set by RGB_MATRIX_MAXIMUM_BRIGHTNESS, which is potentially dangerous as it can lead to too much current drawn from the USB port.

qmk doctor output:

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.0.0
Ψ QMK home: D:/koeng/Documents/keyboard/qmk
Ψ Detected Windows 10 (10.0.19044).
Ψ Git branch: master
Ψ Repo version: 0.15.23
⚠ Git has unstashed/uncommitted changes.
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 10.1.0
Ψ Found avr-gcc version 8.4.0
Ψ Found avrdude version 6.3
Ψ Found dfu-util version 0.11
Ψ Found dfu-programmer version 0.7.2
Ψ Submodules are up to date.
Ψ QMK is ready to go, but minor problems were found
@drashna
Copy link
Member

drashna commented Mar 21, 2022

Can confirm. Not sure there is an easy way to fix this, but this line may be what needs to be modified:

const uint8_t max_intensity = 0xff;

setting that to the current val instead of 0xFF may work, but the other colors may not be correct. In fact, they may need to be calculated at run time.

@KoenGoe
Copy link
Author

KoenGoe commented Mar 22, 2022

Yeah I tried these settings:

    const uint8_t pure_green_intensity = RGB_MATRIX_MAXIMUM_BRIGHTNESS*3/4;
    const uint8_t max_brightness_boost = RGB_MATRIX_MAXIMUM_BRIGHTNESS*3/4;
    const uint8_t max_intensity        = RGB_MATRIX_MAXIMUM_BRIGHTNESS;

So that the constants have about the same ratio as originally.
While this kept the brightness under RGB_MATRIX_MAXIMUM_BRIGHTNESS is still has two issues:

  • it's ignoring the current val. At least it's an electrically safe setting now, but of course it would be better if the effect brightness followed the val as well
  • The decay rate is 1 (--) per update and should be slowed down inversely proportional to max_intensity.

@KoenGoe KoenGoe closed this as completed Mar 24, 2022
tzarc pushed a commit that referenced this issue Apr 19, 2022
0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this issue Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants