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

hopefully correct error in mtdjr userspace for layer_state_set_user #3521

Merged
merged 2 commits into from
Jul 30, 2018
Merged

hopefully correct error in mtdjr userspace for layer_state_set_user #3521

merged 2 commits into from
Jul 30, 2018

Conversation

mtdjr
Copy link
Contributor

@mtdjr mtdjr commented Jul 29, 2018

@drashna hopefully this fixes the issue in my user space for layer_state_set_user. don't really understand what's wrong.

@drashna
Copy link
Member

drashna commented Jul 29, 2018

Well, the problem was that you were excluding the "return". So ... it wasn't returning anything, and therefore erroring out.

This would probably work better:

uint32_t layer_state_set_user(uint32_t state) {
  switch (biton32(state)) {
    case _RAISE:
#ifdef RGBLIGHT_ENABLE
      rgblight_sethsv_noeeprom (240, 255, 255);
#endif
      break;
    case _LOWER:
#ifdef RGBLIGHT_ENABLE
      rgblight_sethsv_noeeprom (0, 255, 255);
#endif
      break;
    case _ADJUST:
#ifdef RGBLIGHT_ENABLE
      rgblight_sethsv_noeeprom (0, 0, 255);
#endif
      break;
    default:
#ifdef RGBLIGHT_ENABLE
      rgblight_sethsv_noeeprom (RGB_HUE, 255, 255);
#endif
      break;
    }
  return state;
}

As this would allow you to add other code, and still work.

@drashna
Copy link
Member

drashna commented Jul 30, 2018

Awesome, thanks!

@drashna drashna added the keymap label Jul 30, 2018
@drashna drashna merged commit 07ab5be into qmk:master Jul 30, 2018
mattfluder pushed a commit to mattfluder/qmk_firmware that referenced this pull request Jul 30, 2018
…mk#3521)

* holefully correct error in mtdjr userspace for layer_state_set_user

* return state and wrap rgb actions in their own conditional
alexey-danilov pushed a commit to alexey-danilov/qmk_firmware that referenced this pull request Aug 3, 2018
…mk#3521)

* holefully correct error in mtdjr userspace for layer_state_set_user

* return state and wrap rgb actions in their own conditional
ChrissiQ pushed a commit to ChrissiQ/qmk_firmware that referenced this pull request Sep 25, 2018
…mk#3521)

* holefully correct error in mtdjr userspace for layer_state_set_user

* return state and wrap rgb actions in their own conditional
yamad pushed a commit to yamad/qmk_firmware that referenced this pull request Apr 10, 2019
…mk#3521)

* holefully correct error in mtdjr userspace for layer_state_set_user

* return state and wrap rgb actions in their own conditional
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.

2 participants