2019-07-25 11:56:29 -07:00
|
|
|
#include "custom_rgb.h"
|
|
|
|
|
|
|
|
#ifdef RGB_MATRIX_ENABLE
|
|
|
|
void rgb_matrix_increase_flags(void)
|
|
|
|
{
|
|
|
|
switch (rgb_matrix_get_flags()) {
|
|
|
|
case LED_FLAG_ALL: {
|
|
|
|
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
|
|
|
|
rgb_matrix_set_color_all(0, 0, 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
|
2019-09-17 10:28:02 -07:00
|
|
|
rgb_matrix_set_flags(LED_FLAG_NONE);
|
|
|
|
rgb_matrix_disable_noeeprom();
|
2019-07-25 11:56:29 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LED_FLAG_UNDERGLOW: {
|
2019-09-17 10:28:02 -07:00
|
|
|
rgb_matrix_set_flags(LED_FLAG_ALL);
|
|
|
|
rgb_matrix_set_color_all(0, 0, 0);
|
2019-07-25 11:56:29 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default: {
|
2019-09-17 10:28:02 -07:00
|
|
|
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
2019-07-25 11:56:29 -07:00
|
|
|
rgb_matrix_enable_noeeprom();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void rgb_matrix_decrease_flags(void)
|
|
|
|
{
|
|
|
|
switch (rgb_matrix_get_flags()) {
|
|
|
|
case LED_FLAG_ALL: {
|
2019-09-17 10:28:02 -07:00
|
|
|
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
|
|
|
rgb_matrix_set_color_all(0, 0, 0);
|
2019-07-25 11:56:29 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
|
|
|
|
rgb_matrix_set_flags(LED_FLAG_ALL);
|
|
|
|
rgb_matrix_set_color_all(0, 0, 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LED_FLAG_UNDERGLOW: {
|
2019-09-17 10:28:02 -07:00
|
|
|
rgb_matrix_set_flags(LED_FLAG_NONE);
|
|
|
|
rgb_matrix_disable_noeeprom();
|
2019-07-25 11:56:29 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default: {
|
2019-09-17 10:28:02 -07:00
|
|
|
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
|
2019-07-25 11:56:29 -07:00
|
|
|
rgb_matrix_enable_noeeprom();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void rgb_reset(void) {
|
|
|
|
#if defined(RGB_MATRIX_ENABLE)
|
|
|
|
eeconfig_update_rgb_matrix_default();
|
|
|
|
#elif defined(RGBLIGHT_ENABLE)
|
|
|
|
eeconfig_update_rgblight_default();
|
|
|
|
rgblight_enable();
|
|
|
|
#endif
|
|
|
|
}
|