Fixup RGBLIGHT support for clueboard2

pull/286/head
skullY 9 years ago
parent dc451b505b
commit 97f8f37876

@ -1,6 +1,6 @@
#include "clueboard2.h" #include "clueboard2.h"
#ifdef ENABLE_RGBLIGHT #ifdef RGBLIGHT_ENABLE
#include "rgblight.h" #include "rgblight.h"
#endif #endif
@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `----------------------------------------------------------------------------------' * `----------------------------------------------------------------------------------'
*/ */
[_RS] = KEYMAP( [_RS] = KEYMAP(
#ifdef ENABLE_RGBLIGHT #ifdef RGBLIGHT_ENABLE
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), F(7), \ KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), F(7), \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(8), \ KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(8), \
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
enum function_id { enum function_id {
SHIFT_ESC, SHIFT_ESC,
#ifdef ENABLE_RGBLIGHT #ifdef RGBLIGHT_ENABLE
RGBLED_TOGGLE, RGBLED_TOGGLE,
RGBLED_STEP_MODE, RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE, RGBLED_INCREASE_HUE,
@ -101,7 +101,7 @@ enum function_id {
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC), [0] = ACTION_FUNCTION(SHIFT_ESC),
#ifdef ENABLE_RGBLIGHT #ifdef RGBLIGHT_ENABLE
[1] = ACTION_FUNCTION(RGBLED_TOGGLE), [1] = ACTION_FUNCTION(RGBLED_TOGGLE),
[2] = ACTION_FUNCTION(RGBLED_STEP_MODE), [2] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
@ -137,12 +137,11 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
} }
break; break;
//led operations //led operations
#ifdef ENABLE_RGBLIGHT #ifdef RGBLIGHT_ENABLE
case RGBLED_TOGGLE: case RGBLED_TOGGLE:
if (record->event.pressed) { if (record->event.pressed) {
rgblight_toggle(); rgblight_toggle();
} }
break; break;
case RGBLED_INCREASE_HUE: case RGBLED_INCREASE_HUE:
if (record->event.pressed) { if (record->event.pressed) {

@ -190,7 +190,7 @@ void rgblight_mode(uint8_t mode) {
rgblight_config.mode = mode; rgblight_config.mode = mode;
} }
eeconfig_write_rgblight(rgblight_config.raw); eeconfig_write_rgblight(rgblight_config.raw);
dprintf("rgblight mode: %u\n", rgblight_config.mode); xprintf("rgblight mode: %u\n", rgblight_config.mode);
if (rgblight_config.mode == 1) { if (rgblight_config.mode == 1) {
rgblight_timer_disable(); rgblight_timer_disable();
} else if (rgblight_config.mode >=2 && rgblight_config.mode <=23) { } else if (rgblight_config.mode >=2 && rgblight_config.mode <=23) {
@ -207,7 +207,7 @@ void rgblight_mode(uint8_t mode) {
void rgblight_toggle(void) { void rgblight_toggle(void) {
rgblight_config.enable ^= 1; rgblight_config.enable ^= 1;
eeconfig_write_rgblight(rgblight_config.raw); eeconfig_write_rgblight(rgblight_config.raw);
dprintf("rgblight toggle: rgblight_config.enable = %u\n", rgblight_config.enable); xprintf("rgblight toggle: rgblight_config.enable = %u\n", rgblight_config.enable);
if (rgblight_config.enable) { if (rgblight_config.enable) {
rgblight_mode(rgblight_config.mode); rgblight_mode(rgblight_config.mode);
} else { } else {
@ -300,7 +300,7 @@ void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val){
rgblight_config.sat = sat; rgblight_config.sat = sat;
rgblight_config.val = val; rgblight_config.val = val;
eeconfig_write_rgblight(rgblight_config.raw); eeconfig_write_rgblight(rgblight_config.raw);
dprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); xprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
} }
} }

Loading…
Cancel
Save