mirror of
https://github.com/openstenoproject/qmk
synced 2024-11-22 16:34:38 +00:00
reduces rgblight warnings, integrates completely (#428)
This commit is contained in:
parent
a8375fa15a
commit
80c8705419
6 changed files with 11 additions and 8 deletions
|
@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "led.h"
|
||||
|
||||
|
||||
void led_init_ports() {
|
||||
void led_init_ports(void) {
|
||||
// * Set our LED pins as output
|
||||
DDRB |= (1<<2);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "matrix.h"
|
||||
#include "keymap.h"
|
||||
#include <stddef.h>
|
||||
|
||||
#include "action_util.h"
|
||||
|
||||
/* Clueboard matrix layout
|
||||
* ,-----------------------------------------------------------.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -64,7 +64,6 @@ void rgblight_decrease_val(void);
|
|||
void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val);
|
||||
void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
#define EECONFIG_RGBLIGHT (uint8_t *)7
|
||||
uint32_t eeconfig_read_rgblight(void);
|
||||
void eeconfig_update_rgblight(uint32_t val);
|
||||
void eeconfig_update_rgblight_default(void);
|
||||
|
|
|
@ -14,7 +14,10 @@ void eeconfig_init(void)
|
|||
eeprom_update_byte(EECONFIG_BACKLIGHT, 0);
|
||||
#endif
|
||||
#ifdef AUDIO_ENABLE
|
||||
eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default
|
||||
eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default
|
||||
#endif
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
eeprom_update_dword(EECONFIG_RGBLIGHT, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5
|
||||
#define EECONFIG_BACKLIGHT (uint8_t *)6
|
||||
#define EECONFIG_AUDIO (uint8_t *)7
|
||||
#define EECONFIG_RGBLIGHT (uint32_t *)8
|
||||
|
||||
|
||||
/* debug bit */
|
||||
|
|
Loading…
Reference in a new issue