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 startup color #1975

Merged
merged 2 commits into from
Nov 6, 2017
Merged

Fix RGBLIGHT startup color #1975

merged 2 commits into from
Nov 6, 2017

Conversation

drashna
Copy link
Member

@drashna drashna commented Nov 6, 2017

While it's awesome to see the layer indicating code in here (no really!), and the general rule is to not alter the default keymap/code....

The problem with the layer_state_set_kb call handling this, is that the code doesn't seem to be called at startup. So the default layer color won't ever get set on startup. It needs to be called in the init function to be properly set.

I've played with this a lot, and if you check my keymaps, that is precisely why I have the setrgb/sethsv in the init function.

While it's awesome to see the layer indicating code in here (no really!), and the general rule is to not alter the default keymap/code....

The problem with the layer_state_set_kb call handling this, is that the code doesn't seem to be called at startup.  So the default layer color won't ever get set on startup.  It needs to be called in the init function to be properly set. 

I've played with this extensively, and if you check my keymaps, that is precisely why I have the setrgb/sethsv in the init function.
@jackhumbert jackhumbert requested a review from ezuk November 6, 2017 16:08
@ezuk
Copy link
Contributor

ezuk commented Nov 6, 2017

@drashna this is awesome! Thank you for the fix!

@@ -194,7 +194,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {

#ifdef RGBLIGHT_COLOR_|LAYER_0
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you have an extra | here :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops! Fixed

@jackhumbert
Copy link
Member

Perfect! Thanks :)

@jackhumbert jackhumbert merged commit 2c703b1 into qmk:master Nov 6, 2017
@drashna drashna deleted the patch-3 branch November 7, 2017 04:44
kgwong pushed a commit to kgwong/qmk_firmware that referenced this pull request Nov 26, 2017
* Fix RGBLIGHT startup color

While it's awesome to see the layer indicating code in here (no really!), and the general rule is to not alter the default keymap/code....

The problem with the layer_state_set_kb call handling this, is that the code doesn't seem to be called at startup.  So the default layer color won't ever get set on startup.  It needs to be called in the init function to be properly set. 

I've played with this extensively, and if you check my keymaps, that is precisely why I have the setrgb/sethsv in the init function.

* Removed typo (pipe)
akatrevorjay added a commit to akatrevorjay/qmk_firmware that referenced this pull request Apr 3, 2018
* 'master' of git://github.com/qmk/qmk_firmware: (291 commits)
  More "oscillope" keymap fixes. (qmk#1982)
  Improved README of yuuki and added RGB commands (qmk#1983)
  restructure converters (qmk#1825)
  qwerty_code_friendly: configurable left thumb
  Migrated most code from keymaps to userspace  (qmk#1980)
  Small ergodox config fix and update.
  Update and move around drashna keymaps (qmk#1976)
  make it easy to customize logo image
  add pgm_read_dword for Infinity ErgoDox
  333fred layout update (qmk#1971)
  Pete's 40th XD64 Layout
  Ergodox EZ and Atreus 42 key dvorak layout updates (qmk#1964)
  Correct the rules.mk documentation for auto shift.
  Fix RGBLIGHT startup color (qmk#1975)
  adds indication up to layer 7
  restore default mode/color if no 0 color
  adds per-layer rgb color option to ez
  update gh60 info
  add gh60 info.json
  several improvements for mitosis:datagrok (qmk#1960)
  ...
LovesTha pushed a commit to LovesTha/qmk_firmware that referenced this pull request Jul 24, 2018
* Fix RGBLIGHT startup color

While it's awesome to see the layer indicating code in here (no really!), and the general rule is to not alter the default keymap/code....

The problem with the layer_state_set_kb call handling this, is that the code doesn't seem to be called at startup.  So the default layer color won't ever get set on startup.  It needs to be called in the init function to be properly set. 

I've played with this extensively, and if you check my keymaps, that is precisely why I have the setrgb/sethsv in the init function.

* Removed typo (pipe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants