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

[Core] Allow customizing PWM frequency #21717

Merged
merged 2 commits into from
Sep 3, 2023
Merged

Conversation

JohnAZoidberg
Copy link
Contributor

Description

Some frequencies can cause audible noise. Changing the frequency eliminates that.

Types of Changes

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

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

Tested on Framework 16 keyboard (not upstreamed yet).

Some frequencies can cause audible noise. Changing the frequency
eliminates that.

Signed-off-by: Daniel Schaefer <[email protected]>
@github-actions github-actions bot added the core label Aug 9, 2023
@zvecr zvecr changed the base branch from master to develop August 9, 2023 03:05
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

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

LGTM!

@getreuer
Copy link
Contributor

getreuer commented Aug 9, 2023

Nice addition! To round this out, I suggest to update the QMK documentation so that people are aware of this new option. How to do that:

  1. Edit docs/feature_backlight.md.
  2. Use qmk docs to locally preview the updated documentation.

@KarlK90 KarlK90 merged commit dd887ea into qmk:develop Sep 3, 2023
@@ -73,6 +73,7 @@ To configure the backlighting, `#define` these in your `config.h`:
|`BACKLIGHT_LIMIT_VAL` |`255` |The maximum duty cycle of the backlight -- `255` allows for full brightness, any lower will decrease the maximum.|
|`BACKLIGHT_DEFAULT_LEVEL` |`BACKLIGHT_LEVELS`|The default backlight level to use upon clearing the EEPROM |
|`BACKLIGHT_DEFAULT_BREATHING`|*Not defined* |Whether to enable backlight breathing upon clearing the EEPROM |
|`BACKLIGHT_PWM_PERIOD` |2048Hz |Defaults to `BACKLIGHT_PWM_COUNTER_FREQUENCY / 2048`, which results in a PWM frequency of 2048Hz. |
Copy link
Member

Choose a reason for hiding this comment

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

Default here is incorrect for the majority of ChibiOS supported boards, and only correct for RP2040.

mechlovin pushed a commit to mechlovin/qmk_firmware that referenced this pull request Oct 25, 2023
* [Core] Allow customizing PWM frequency

Some frequencies can cause audible noise. Changing the frequency
eliminates that.

Signed-off-by: Daniel Schaefer <[email protected]>

* docs/feature-backlight: Mention PWM frequency

Signed-off-by: Daniel Schaefer <[email protected]>

---------

Signed-off-by: Daniel Schaefer <[email protected]>
zgagnon pushed a commit to zgagnon/qmk_firmware_waterfowl that referenced this pull request Dec 15, 2023
* [Core] Allow customizing PWM frequency

Some frequencies can cause audible noise. Changing the frequency
eliminates that.

Signed-off-by: Daniel Schaefer <[email protected]>

* docs/feature-backlight: Mention PWM frequency

Signed-off-by: Daniel Schaefer <[email protected]>

---------

Signed-off-by: Daniel Schaefer <[email protected]>
future-figs pushed a commit to future-figs/qmk_firmware that referenced this pull request Dec 27, 2023
* [Core] Allow customizing PWM frequency

Some frequencies can cause audible noise. Changing the frequency
eliminates that.

Signed-off-by: Daniel Schaefer <[email protected]>

* docs/feature-backlight: Mention PWM frequency

Signed-off-by: Daniel Schaefer <[email protected]>

---------

Signed-off-by: Daniel Schaefer <[email protected]>
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.

6 participants