diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-06-21 12:53:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-21 12:53:21 -0400 |
commit | 80c87054193b9243670aeb85adefbe1aa6c0fda0 (patch) | |
tree | 9ee304b9ca913328f1ea45500b34410f0d53ccfe | |
parent | a8375fa15a6ca9285eb15ae89bcda898349e06f8 (diff) | |
download | qmk_firmware-80c87054193b9243670aeb85adefbe1aa6c0fda0.tar.gz qmk_firmware-80c87054193b9243670aeb85adefbe1aa6c0fda0.zip |
reduces rgblight warnings, integrates completely (#428)
-rw-r--r-- | keyboard/satan/led.c | 2 | ||||
-rw-r--r-- | keyboard/satan/satan.h | 2 | ||||
-rw-r--r-- | quantum/rgblight.c | 8 | ||||
-rw-r--r-- | quantum/rgblight.h | 1 | ||||
-rw-r--r-- | tmk_core/common/avr/eeconfig.c | 5 | ||||
-rw-r--r-- | tmk_core/common/eeconfig.h | 1 |
6 files changed, 11 insertions, 8 deletions
diff --git a/keyboard/satan/led.c b/keyboard/satan/led.c index 5a9f2af67..94606e895 100644 --- a/keyboard/satan/led.c +++ b/keyboard/satan/led.c | |||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
20 | #include "led.h" | 20 | #include "led.h" |
21 | 21 | ||
22 | 22 | ||
23 | void led_init_ports() { | 23 | void led_init_ports(void) { |
24 | // * Set our LED pins as output | 24 | // * Set our LED pins as output |
25 | DDRB |= (1<<2); | 25 | DDRB |= (1<<2); |
26 | } | 26 | } |
diff --git a/keyboard/satan/satan.h b/keyboard/satan/satan.h index 12dec26a1..464289fdb 100644 --- a/keyboard/satan/satan.h +++ b/keyboard/satan/satan.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include "matrix.h" | 4 | #include "matrix.h" |
5 | #include "keymap.h" | 5 | #include "keymap.h" |
6 | #include <stddef.h> | 6 | #include <stddef.h> |
7 | 7 | #include "action_util.h" | |
8 | 8 | ||
9 | /* Clueboard matrix layout | 9 | /* Clueboard matrix layout |
10 | * ,-----------------------------------------------------------. | 10 | * ,-----------------------------------------------------------. |
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 | ||
156 | void rgblight_increase(void) { | 156 | void 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 | ||
164 | void rgblight_decrease(void) { | 164 | void 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 | ||
172 | void rgblight_step(void) { | 172 | void 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); | |||
64 | void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); | 64 | void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); |
65 | void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); | 65 | void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); |
66 | 66 | ||
67 | #define EECONFIG_RGBLIGHT (uint8_t *)7 | ||
68 | uint32_t eeconfig_read_rgblight(void); | 67 | uint32_t eeconfig_read_rgblight(void); |
69 | void eeconfig_update_rgblight(uint32_t val); | 68 | void eeconfig_update_rgblight(uint32_t val); |
70 | void eeconfig_update_rgblight_default(void); | 69 | void eeconfig_update_rgblight_default(void); |
diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c index c5391f5cf..656938fb3 100644 --- a/tmk_core/common/avr/eeconfig.c +++ b/tmk_core/common/avr/eeconfig.c | |||
@@ -14,7 +14,10 @@ void eeconfig_init(void) | |||
14 | eeprom_update_byte(EECONFIG_BACKLIGHT, 0); | 14 | eeprom_update_byte(EECONFIG_BACKLIGHT, 0); |
15 | #endif | 15 | #endif |
16 | #ifdef AUDIO_ENABLE | 16 | #ifdef AUDIO_ENABLE |
17 | eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default | 17 | eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default |
18 | #endif | ||
19 | #ifdef RGBLIGHT_ENABLE | ||
20 | eeprom_update_dword(EECONFIG_RGBLIGHT, 0); | ||
18 | #endif | 21 | #endif |
19 | } | 22 | } |
20 | 23 | ||
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index ca47e0d2f..d8caa346f 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h | |||
@@ -32,6 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
32 | #define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 | 32 | #define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 |
33 | #define EECONFIG_BACKLIGHT (uint8_t *)6 | 33 | #define EECONFIG_BACKLIGHT (uint8_t *)6 |
34 | #define EECONFIG_AUDIO (uint8_t *)7 | 34 | #define EECONFIG_AUDIO (uint8_t *)7 |
35 | #define EECONFIG_RGBLIGHT (uint32_t *)8 | ||
35 | 36 | ||
36 | 37 | ||
37 | /* debug bit */ | 38 | /* debug bit */ |