summaryrefslogtreecommitdiffstats
path: root/quantum/rgblight.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-06-21 18:53:21 +0200
committerGitHub <noreply@github.com>2016-06-21 18:53:21 +0200
commit80c87054193b9243670aeb85adefbe1aa6c0fda0 (patch)
tree9ee304b9ca913328f1ea45500b34410f0d53ccfe /quantum/rgblight.c
parenta8375fa15a6ca9285eb15ae89bcda898349e06f8 (diff)
downloadqmk_firmware-80c87054193b9243670aeb85adefbe1aa6c0fda0.tar.gz
qmk_firmware-80c87054193b9243670aeb85adefbe1aa6c0fda0.tar.xz
reduces rgblight warnings, integrates completely (#428)
Diffstat (limited to 'quantum/rgblight.c')
-rw-r--r--quantum/rgblight.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 8c9ad7736..c29ffedc3 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -42,7 +42,7 @@ void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) {
The DIM_CURVE is used only on brightness/value and on saturation (inverted).
This looks the most natural.
*/
- uint8_t r, g, b;
+ uint8_t r = 0, g = 0, b = 0;
val = pgm_read_byte(&DIM_CURVE[val]);
sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]);
@@ -154,7 +154,7 @@ void rgblight_init(void) {
}
void rgblight_increase(void) {
- uint8_t mode;
+ uint8_t mode = 0;
if (rgblight_config.mode < RGBLIGHT_MODES) {
mode = rgblight_config.mode + 1;
}
@@ -162,7 +162,7 @@ void rgblight_increase(void) {
}
void rgblight_decrease(void) {
- uint8_t mode;
+ uint8_t mode = 0;
if (rgblight_config.mode > 1) { //mode will never < 1, if mode is less than 1, eeprom need to be initialized.
mode = rgblight_config.mode-1;
}
@@ -170,7 +170,7 @@ void rgblight_decrease(void) {
}
void rgblight_step(void) {
- uint8_t mode;
+ uint8_t mode = 0;
mode = rgblight_config.mode + 1;
if (mode > RGBLIGHT_MODES) {
mode = 1;