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

Fix rgblight layers when animations aren't enabled #20097

Merged
merged 1 commit into from
Mar 26, 2023

Conversation

elipsitz
Copy link
Contributor

Description

PR #18338 introduced a change that deferred rgblight_set after a call to rgblight_set_layer_state to the next invocation of rgblight_task.

However, rgblight_task is a no-op unless RGBLIGHT_USE_TIMER is set, which only happens automatically if an RGB animation is enabled, or if RGBLIGHT_LAYER_BLINK is enabled.

If neither of these are enabled, rgblight_set is never called automatically after rgblight_set_layer_state, so the LED state is never actually set.

This commit fixes this issue by ensuring that RGBLIGHT_USER_TIMER is set if rgblight layers are enabled.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

PR qmk#18338 introduced a change that deferred rgblight_set after a call to
rgblight_set_layer_state to the next invocation of rgblight_task.

However, rgblight_task is a no-op unless RGBLIGHT_USE_TIMER is set,
which only happens automatically if an RGB animation is enabled, or if
RGBLIGHT_LAYER_BLINK is enabled.

If neither of these are enabled, rgblight_set is never called
automatically after rgblight_set_layer_state, so the LED state is never
actually set.

This commit fixes this issue by ensuring that RGBLIGHT_USER_TIMER is set
if rgblight layers are enabled.
@github-actions github-actions bot added the core label Mar 12, 2023
Copy link
Contributor

@sigprof sigprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproduced the bug on idobao/id80/v2/ansi and tested that the fix actually works. (I tested the original PR, but did not test a configuration without any animations enabled, and did not notice that rgblight_task() is not always present).

Copy link
Member

@daskygit daskygit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed on a split board as well, merging to develop rather master due to the potential for oversize firmware.

@daskygit daskygit merged commit 7e54def into qmk:develop Mar 26, 2023
nicsuzor pushed a commit to nicsuzor/qmk_firmware that referenced this pull request Mar 28, 2023
mgor pushed a commit to mgor/qmk_firmware that referenced this pull request Apr 15, 2023
coquizen pushed a commit to coquizen/qmk_firmware that referenced this pull request Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants