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

RGB Matrix Lighting implementation for Novelkeys NK87 #19422

Closed
wants to merge 17 commits into from

Conversation

makirill
Copy link

@makirill makirill commented Dec 24, 2022

Description

This PR adds RGB Matrix Lighting effects for Novelkeys NK87 keyboard.

Summary:

  • RGB_MATRIX_ENABLE is enabled by default and used by the default and via keymap
  • RGB Matrix Lighting can be completely disabled at keymap level by setting RGB_MATRIX_ENABLE = no at the rules.mk file
  • The default keymap has new key codes at FN layer to change RGB Matrix Lightning settings
  • Tests was done to make sure all RGB Matrix Lightning effects are working as expected, including heatmap and reactive effects where configuration of the LEDs physical positions is important.
  • Tests was done for via keymap to make sure that everything is working VIA configurator including lightning effects

Tagging @yiancar as the original creator of the NK87 keyboard.

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

The RGB Matrix Lighting can't be configured with VIA, so VIA keymap  has
RGB Matrix Lighting disabled and uses RGB Backlight.

Default keymap has RGB Matrix Lighting enabled.
The g_led_config should have correct map of led's physical position in
so effects like heat map will work properly. The backspace led position
in matrix on the right from enter key (like in iso) but physically on
the top from enter (like ansi).
@github-actions github-actions bot added keyboard keymap via Adds via keymap and/or updates keyboard for via support labels Dec 24, 2022
keyboards/novelkeys/nk87/config_led.c Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/config_led.h Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/config.h Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/default/readme.md Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/via/keymap.c Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/via/keymap.c Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/rules.mk Outdated Show resolved Hide resolved
Code from the config_led.* files should be moved to nk87.c or config.h
files.
Minor update to make layer_state_set_user function more readable
Switching to the rgb_matrix_indicators_kb() since no parameters of the
rgb_matrix_indicators_advanced_kb() are not used.
Making preprocessor directives indentation style compliant with the
qmk coding conventions.
@drashna drashna requested a review from a team January 1, 2023 21:48
keyboards/novelkeys/nk87/nk87.h Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/nk87.h Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/info.json Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/rules.mk Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/via/rules.mk Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/via/keymap.c Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/via/keymap.c Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/keymaps/via/rules.mk Outdated Show resolved Hide resolved
The SRC build option from the via keymap to keyboard level post_rules.mk
file to avoid potential duplication.
keyboards/novelkeys/nk87/keymaps/via/rules.mk Outdated Show resolved Hide resolved
keyboards/novelkeys/nk87/post_rules.mk Outdated Show resolved Hide resolved
@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Feb 18, 2023
@github-actions github-actions bot removed the stale Issues or pull requests that have become inactive without resolution. label Feb 19, 2023
@makirill makirill requested review from zvecr, fauxpark and waffle87 and removed request for zvecr, fauxpark and waffle87 February 19, 2023 20:54
@github-actions
Copy link

github-actions bot commented Apr 6, 2023

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Apr 6, 2023
ifeq ($(strip $(RGB_BACKLIGHT)),yes)

# Disable RGB Matrix
RGB_MATRIX_ENABLE = no
Copy link
Member

Choose a reason for hiding this comment

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

Honestly, I'd opt for this:

Suggested change
RGB_MATRIX_ENABLE = no
RGB_MATRIX_SUPPORTED = no

This actually disables the feature, even when enabling the feature from command line. It prevents it from being used at all. Which is more appropriate for what this is trying to do.

Copy link
Author

Choose a reason for hiding this comment

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

@drashna, I don't follow it. Is it about to introduce introduce different detective (RGB_MATRIX_SUPPORTED) that will control what RGB should be used (RGB_MATRIX or RGB_BACKLIGHT)?

I am thinking to implement something like:

ifeq ($(filter $(strip $(RGBLED_OPTION_TYPE))x, nonex backlightx matrixx x),)
   $(error unknown RGBLED_OPTION_TYPE value "$(RGBLED_OPTION_TYPE)")
endif

ifeq ($(strip $(RGBLED_OPTION_TYPE)),backlight)
RGB_MATRIX_ENABLE = no
RGB_BACKLIGHT = yes

.......

endif
ifeq ($(strip $(RGBLED_OPTION_TYPE)),matrix)
RGB_BACKLIGHT = no
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = IS31FL3733

..........

endif

So, both RGB options can be supported and configured at keymap level by setting the RGBLED_OPTION_TYPE.

Copy link
Contributor

Choose a reason for hiding this comment

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

RGB_MATRIX_SUPPORTED = no

This actually won't work, because disable_features.mk is included before any of the post_rules.mk files.

@drashna drashna self-assigned this Apr 12, 2023
@github-actions github-actions bot removed the stale Issues or pull requests that have become inactive without resolution. label Apr 13, 2023

Default layer is normal ANSI TKL

This keymap uses [RGB Matrix Lighting](https://docs.qmk.fm/#/feature_rgb_matrix)
by default. VIA is not supporting configuration of RGB Matrix Lighting effects but there are still options to do the effects configurations:
Copy link
Contributor

Choose a reason for hiding this comment

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

This statement is obsolete — VIA V3 (#18222) has support for RGB Matrix configuration (the builtin support is limited to setting mode/HSV/speed though, and you may need to customize the list of effects in the VIA JSON if you are not enabling all existing effects in the firmware for some reason).

@makirill
Copy link
Author

Looks like it's too complicated to have two different variants for RGB lighting (RGB Matrix for the default keymap and RGB Backlight for via), code become too messy and complex.

So, I think it will be better to unify everything and use RGB Matrix everywhere, which was implemented with commit f4c561c. I've tested VIA using Design Tab and novelkeys_nk87.json file.

PR description was updated as well.

@makirill makirill requested a review from drashna April 29, 2023 18:40
@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Jun 14, 2023
@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically closed because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, or re-open when it's ready.
// [stale-action-closed]

@github-actions github-actions bot closed this Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keyboard keymap stale Issues or pull requests that have become inactive without resolution. via Adds via keymap and/or updates keyboard for via support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants