]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Keymaps: correct error in mtdjr userspace for layer_state_set_user (#3521)
authormtdjr <mtdjr@users.noreply.github.com>
Mon, 30 Jul 2018 04:45:09 +0000 (00:45 -0400)
committerDrashna Jaelre <drashna@live.com>
Mon, 30 Jul 2018 04:45:09 +0000 (21:45 -0700)
* holefully correct error in mtdjr userspace for layer_state_set_user

* return state and wrap rgb actions in their own conditional

users/mtdjr/mtdjr.c

index ac5c5911ff60a5397270371cc634830f4d804d3a..d8d6871a17408c10c1132909d9aa4e1cf74c059f 100644 (file)
@@ -137,21 +137,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 };
 
 uint32_t layer_state_set_user(uint32_t state) {
-#ifdef RGBLIGHT_ENABLE
   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;
-#endif
 }