Skip to content

Commit

Permalink
Add RGBLIGHT_DEFAULT_ON macro configuration option (qmk#20857)
Browse files Browse the repository at this point in the history
* ADD RGB_DEFAULT_DISABLED option and updated documentation

* Formatting

* Add  as by fauxpark's suggestion

Co-authored by: fauxpark

* Formatting

* Use boolean values instead of numerical

Co-authored-by: Ryan <[email protected]>

* Edit documentation formatting

Co-authored-by: Ryan <[email protected]>

* Remove comment

Co-authored-by: Ryan <[email protected]>

* Set RGB mode to DEFAULT macro at init

Co-authored-by: Ryan <[email protected]>

---------

Co-authored-by: Ryan <[email protected]>
Co-authored-by: zvecr <[email protected]>
  • Loading branch information
3 people authored Sep 29, 2023
1 parent 67f5293 commit 2eed1f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/feature_rgblight.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Your RGB lighting can be configured by placing these `#define`s in your `config.
|`RGBLIGHT_DEFAULT_SAT` |`UINT8_MAX` (255) |The default saturation to use upon clearing the EEPROM |
|`RGBLIGHT_DEFAULT_VAL` |`RGBLIGHT_LIMIT_VAL` |The default value (brightness) to use upon clearing the EEPROM |
|`RGBLIGHT_DEFAULT_SPD` |`0` |The default speed to use upon clearing the EEPROM |
|`RGBLIGHT_DEFAULT_ON` |`true` |Enable RGB lighting upon clearing the EEPROM |

## Effects and Animations

Expand Down
6 changes: 5 additions & 1 deletion quantum/rgblight/rgblight.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ static uint8_t mode_base_table[] = {
# define RGBLIGHT_DEFAULT_SPD 0
#endif

#if !defined(RGBLIGHT_DEFAULT_ON)
# define RGBLIGHT_DEFAULT_ON true
#endif

static inline int is_static_effect(uint8_t mode) {
return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL;
}
Expand Down Expand Up @@ -195,7 +199,7 @@ void eeconfig_update_rgblight_current(void) {
}

void eeconfig_update_rgblight_default(void) {
rgblight_config.enable = 1;
rgblight_config.enable = RGBLIGHT_DEFAULT_ON;
rgblight_config.velocikey = 0;
rgblight_config.mode = RGBLIGHT_DEFAULT_MODE;
rgblight_config.hue = RGBLIGHT_DEFAULT_HUE;
Expand Down

0 comments on commit 2eed1f5

Please sign in to comment.