Fix up xd002 rgb keymaps (#13685)

master
Joel Challis 2021-07-24 15:50:32 +01:00 committed by GitHub
parent 567da49ed0
commit e562238309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 13 deletions

View File

@ -158,10 +158,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record)
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case _FUNC: case _FUNC:
rgblight_setrgb_red(); rgblite_setrgb(RGB_RED);
break; break;
default: // for any other layers, or the default layer default: // for any other layers, or the default layer
rgblight_setrgb_green(); rgblite_setrgb(RGB_GREEN);
break; break;
} }
return state; return state;
@ -169,5 +169,5 @@ layer_state_t layer_state_set_user(layer_state_t state) {
// default color // default color
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
rgblight_setrgb_green(); rgblite_setrgb(RGB_GREEN);
} }

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include "ws2812.h" #include "ws2812.h"
#include "rgblight_list.h" #include "color.h"
static inline void rgblight_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) { static inline void rgblite_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) {
LED_TYPE leds[RGBLED_NUM] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}}; LED_TYPE leds[RGBLED_NUM] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}};
ws2812_setleds(leds, RGBLED_NUM); ws2812_setleds(leds, RGBLED_NUM);
} }

View File

@ -16,7 +16,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
switch (keycode) { switch (keycode) {
case RGB_HUI: case RGB_HUI:
rgblight_increase_hue(); rgblite_increase_hue();
break; break;
case QMKURL: case QMKURL:
SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
@ -27,5 +27,5 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
rgblight_increase_hue(); rgblite_increase_hue();
} }

View File

@ -1,26 +1,26 @@
#pragma once #pragma once
#include "ws2812.h" #include "ws2812.h"
#include "rgblight_list.h" #include "color.h"
static inline void rgblight_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) { static inline void rgblite_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) {
LED_TYPE leds[RGBLED_NUM] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}}; LED_TYPE leds[RGBLED_NUM] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}};
ws2812_setleds(leds, RGBLED_NUM); ws2812_setleds(leds, RGBLED_NUM);
} }
static void rgblight_increase_hue(void) { static void rgblite_increase_hue(void) {
static uint8_t state = 0; static uint8_t state = 0;
state = (state + 1) % 3; state = (state + 1) % 3;
switch (state) { switch (state) {
case 1: case 1:
rgblight_setrgb_red(); rgblite_setrgb(RGB_RED);
break; break;
case 2: case 2:
rgblight_setrgb_blue(); rgblite_setrgb(RGB_BLUE);
break; break;
default: default:
rgblight_setrgb_green(); rgblite_setrgb(RGB_GREEN);
break; break;
} }
} }