Skip to content

Commit

Permalink
Configuration values for starting HSV and speed (qmk#7740)
Browse files Browse the repository at this point in the history
* Define default HSV and speed for RGB matrix.

* Documentation for configuration values RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT and RGB_MATRIX_STARTUP_VAL.

* Document RGB_MATRIX_STARTUP_SPD.

* Preserve the ordering.
  • Loading branch information
robhaswell authored and drashna committed Feb 12, 2020
1 parent 47bae30 commit 19f8896
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions quantum/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ const point_t k_rgb_matrix_center = RGB_MATRIX_CENTER;
# endif
#endif

#if !defined(RGB_MATRIX_STARTUP_HUE)
# define RGB_MATRIX_STARTUP_HUE 0
#endif

#if !defined(RGB_MATRIX_STARTUP_SAT)
# define RGB_MATRIX_STARTUP_SAT UINT8_MAX
#endif

#if !defined(RGB_MATRIX_STARTUP_VAL)
# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
#endif

#if !defined(RGB_MATRIX_STARTUP_SPD)
# define RGB_MATRIX_STARTUP_SPD UINT8_MAX / 2
#endif


bool g_suspend_state = false;

rgb_config_t rgb_matrix_config;
Expand All @@ -119,8 +136,8 @@ void eeconfig_update_rgb_matrix_default(void) {
dprintf("eeconfig_update_rgb_matrix_default\n");
rgb_matrix_config.enable = 1;
rgb_matrix_config.mode = RGB_MATRIX_STARTUP_MODE;
rgb_matrix_config.hsv = (HSV){0, UINT8_MAX, RGB_MATRIX_MAXIMUM_BRIGHTNESS};
rgb_matrix_config.speed = UINT8_MAX / 2;
rgb_matrix_config.hsv = (HSV){RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT, RGB_MATRIX_STARTUP_VAL};
rgb_matrix_config.speed = RGB_MATRIX_STARTUP_SPD;
eeconfig_update_rgb_matrix();
}

Expand Down

0 comments on commit 19f8896

Please sign in to comment.