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

is31fl3741: split PWM and scaling buffers #23049

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

fauxpark
Copy link
Member

Description

The 3741 is a little unusual in its PWM and scaling register layouts; it has two of each, which are not symmetrical and oddly organised.

The first page holds the 180 {PWM,scaling} values for SW1, CS1 through SW6, CS30.
The second page holds the 171 values for SW7, CS1 through SW9, CS30, then SW1, CS31 through SW9, CS39.

Currently the code does some modulo magic to map PWM/scaling values into a single buffer for each, and perform the page switching as necessary. I think this is rather obscure so instead, I have split these buffers in two to simplify some of the logic, and adjusted the CSx_SWy values accordingly.
The registers on page 0 are still 0x00-0xB3 as before, but the ones on page 1 are now 0x100-0x1AA, where the top bit marks the page and can simply be masked off to get the "true" register address.

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).

Copy link
Member

@drashna drashna left a comment

Choose a reason for hiding this comment

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

Can confirm that it doesn't break anything, at least.

@drashna drashna requested a review from a team February 12, 2024 00:37
@fauxpark fauxpark merged commit c8c55e3 into qmk:develop Feb 14, 2024
3 checks passed
@fauxpark fauxpark deleted the is31fl3741-buffers-split branch February 14, 2024 00:16
nuess0r pushed a commit to nuess0r/qmk_firmware that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants