aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-06-21 12:53:21 -0400
committerGitHub <noreply@github.com>2016-06-21 12:53:21 -0400
commit80c87054193b9243670aeb85adefbe1aa6c0fda0 (patch)
tree9ee304b9ca913328f1ea45500b34410f0d53ccfe /quantum
parenta8375fa15a6ca9285eb15ae89bcda898349e06f8 (diff)
downloadqmk_firmware-80c87054193b9243670aeb85adefbe1aa6c0fda0.tar.gz
qmk_firmware-80c87054193b9243670aeb85adefbe1aa6c0fda0.zip
reduces rgblight warnings, integrates completely (#428)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgblight.c8
-rw-r--r--quantum/rgblight.h1
2 files changed, 4 insertions, 5 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) {
42 The DIM_CURVE is used only on brightness/value and on saturation (inverted). 42 The DIM_CURVE is used only on brightness/value and on saturation (inverted).
43 This looks the most natural. 43 This looks the most natural.
44 */ 44 */
45 uint8_t r, g, b; 45 uint8_t r = 0, g = 0, b = 0;
46 46
47 val = pgm_read_byte(&DIM_CURVE[val]); 47 val = pgm_read_byte(&DIM_CURVE[val]);
48 sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); 48 sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]);
@@ -154,7 +154,7 @@ void rgblight_init(void) {
154} 154}
155 155
156void rgblight_increase(void) { 156void rgblight_increase(void) {
157 uint8_t mode; 157 uint8_t mode = 0;
158 if (rgblight_config.mode < RGBLIGHT_MODES) { 158 if (rgblight_config.mode < RGBLIGHT_MODES) {
159 mode = rgblight_config.mode + 1; 159 mode = rgblight_config.mode + 1;
160 } 160 }
@@ -162,7 +162,7 @@ void rgblight_increase(void) {
162} 162}
163 163
164void rgblight_decrease(void) { 164void rgblight_decrease(void) {
165 uint8_t mode; 165 uint8_t mode = 0;
166 if (rgblight_config.mode > 1) { //mode will never < 1, if mode is less than 1, eeprom need to be initialized. 166 if (rgblight_config.mode > 1) { //mode will never < 1, if mode is less than 1, eeprom need to be initialized.
167 mode = rgblight_config.mode-1; 167 mode = rgblight_config.mode-1;
168 } 168 }
@@ -170,7 +170,7 @@ void rgblight_decrease(void) {
170} 170}
171 171
172void rgblight_step(void) { 172void rgblight_step(void) {
173 uint8_t mode; 173 uint8_t mode = 0;
174 mode = rgblight_config.mode + 1; 174 mode = rgblight_config.mode + 1;
175 if (mode > RGBLIGHT_MODES) { 175 if (mode > RGBLIGHT_MODES) {
176 mode = 1; 176 mode = 1;
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index 37e207578..64f92523e 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -64,7 +64,6 @@ void rgblight_decrease_val(void);
64void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); 64void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val);
65void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); 65void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
66 66
67#define EECONFIG_RGBLIGHT (uint8_t *)7
68uint32_t eeconfig_read_rgblight(void); 67uint32_t eeconfig_read_rgblight(void);
69void eeconfig_update_rgblight(uint32_t val); 68void eeconfig_update_rgblight(uint32_t val);
70void eeconfig_update_rgblight_default(void); 69void eeconfig_update_rgblight_default(void);