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

23775 rgblight.h compile time bug #23777

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rynfox13
Copy link

@rynfox13 rynfox13 commented May 22, 2024

Description

Patching the bug where defining a specific number of addressable RGB LEDs causes RGBLIGHT_LED_COUNT to be redefined.

When specifying the number of RGB LEDs in the keymap's config.h (as below), there's a compile error redefining RGBLIGHT_LED_COUNT. This fixes that compile time error.

I'm not sure how to add a test other than compiling this.

This is the relevant sections of my keymap's config.h (my specific keymap is not included.)

// keyboards/handwired/dactyl_manuform/5x6/keymaps/kaze/config.h

//#define RGB_DI_PIN F4
#undef WS2812_DI_PIN
#define WS2812_DI_PIN F4
#undef RGBLED_NUM
#define RGBLED_NUM 10
#define RGBLIGHT_ANIMATIONS

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

Patching the bug where defining a specific number of addressable RGB
LEDs causes RGBLIGHT_LED_COUNT to be redefined.
@github-actions github-actions bot added the core label May 22, 2024
@lesshonor
Copy link
Contributor

lesshonor commented May 22, 2024

Your keymap uses outdated macros (#defines), and you should probably run qmk lint on it to ferret out other problems. #define RGB_ANIMATIONS doesn't include all RGB effects anymore either. Reviewing the documentation (breaking changes) might help.

The line of code you've added is in a block with the comment // DEPRECATED DEFINES - DO NOT USE above it, so I am doubtful changes will be made there.

@rynfox13
Copy link
Author

I understand it's deprecated (I actually missed that in the documentation and code... Gotta love hyper-focus on the fix not what's around it) but I figure it's still a bug worthy of being fixed.

That said, qmk lint didn't say anything (please don't judge my bad soldering... I got the columns backward on half of my keyboard):

❯ git status
On branch 23775-rgblights-compile-error
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	keyboards/handwired/dactyl_manuform/5x6/keymaps/kaze/

nothing added to commit but untracked files present (use "git add" to track)
❯ cat keyboards/handwired/dactyl_manuform/5x6/keymaps/kaze/config.h
/*
Copyright 2012 Jun Wako <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#pragma once


#define USE_SERIAL
#undef SOFT_SERIAL_PIN
#define SOFT_SERIAL_PIN D2

//#define MASTER_LEFT
// #define MASTER_RIGHT
#define EE_HANDS

#define SPLIT_USB_DETECT
#define SPLIT_USB_TIMEOUT 2000

// Rows are doubled-up

// This sets the display to the 128x32 displays I'm using.
//define OLED_DISPLAY_128X32


// wiring of each half
#undef MATRIX_COL_PINS
// Left
//# define MATRIX_COL_PINS { B7, B5, B4, E6, D7, C6 }
// Right
# define MATRIX_COL_PINS { C6, D7, E6, B4, B5, B7 }

#undef MATRIX_ROW_PINS
#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7, F6 }

//#define RGB_DI_PIN F4
#undef WS2812_DI_PIN
#define WS2812_DI_PIN F4
#undef RGBLED_NUM
#define RGBLED_NUM 10
#define RGBLIGHT_ANIMATIONS
❯ qmk lint
Ψ Lint check passed!

@rynfox13
Copy link
Author

rynfox13 commented May 22, 2024

(I am by no means an "expert with QMK." This is only my second keyboard... and the first one that is actually working well.)
image

Copy link

github-actions bot commented Jul 7, 2024

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 Jul 7, 2024
Comment on lines 20 to +21
#if defined(RGBLED_NUM)
# undef RGBLIGHT_LED_COUNT
Copy link
Member

Choose a reason for hiding this comment

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

If anything, this should be:

Suggested change
#if defined(RGBLED_NUM)
# undef RGBLIGHT_LED_COUNT
#if defined(RGBLED_NUM) && !defined(RGBLIGHT_LED_COUNT)

@github-actions github-actions bot removed the stale Issues or pull requests that have become inactive without resolution. label Jul 12, 2024
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.

None yet

3 participants