summaryrefslogtreecommitdiffstats
path: root/quantum/rgblight.c
diff options
context:
space:
mode:
authorJoshua Colbeck <Skrymir@users.noreply.github.com>2016-07-13 06:14:30 +0200
committerGitHub <noreply@github.com>2016-07-13 06:14:30 +0200
commit68ceffe53e299fb504bdd4733b1555a8558b472b (patch)
treeae9cc958d239374478338fee2783c203517d6762 /quantum/rgblight.c
parentac978a50a2f523f2de7f928a6b41ac40469911c2 (diff)
parenta998a48673372e409991066d7d2d9ba282f79d59 (diff)
downloadqmk_firmware-68ceffe53e299fb504bdd4733b1555a8558b472b.tar.gz
qmk_firmware-68ceffe53e299fb504bdd4733b1555a8558b472b.tar.xz
Merge pull request #2 from jackhumbert/master
Pull from upstream
Diffstat (limited to 'quantum/rgblight.c')
-rw-r--r--quantum/rgblight.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index c29ffedc3..b1b0f035d 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -146,7 +146,9 @@ void rgblight_init(void) {
}
eeconfig_debug_rgblight(); // display current eeprom values
- rgblight_timer_init(); // setup the timer
+ #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER)
+ rgblight_timer_init(); // setup the timer
+ #endif
if (rgblight_config.enable) {
rgblight_mode(rgblight_config.mode);
@@ -192,14 +194,19 @@ void rgblight_mode(uint8_t mode) {
eeconfig_update_rgblight(rgblight_config.raw);
xprintf("rgblight mode: %u\n", rgblight_config.mode);
if (rgblight_config.mode == 1) {
- rgblight_timer_disable();
+ #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER)
+ rgblight_timer_disable();
+ #endif
} else if (rgblight_config.mode >=2 && rgblight_config.mode <=23) {
// MODE 2-5, breathing
// MODE 6-8, rainbow mood
// MODE 9-14, rainbow swirl
// MODE 15-20, snake
// MODE 21-23, knight
- rgblight_timer_enable();
+
+ #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER)
+ rgblight_timer_enable();
+ #endif
}
rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
}
@@ -211,7 +218,10 @@ void rgblight_toggle(void) {
if (rgblight_config.enable) {
rgblight_mode(rgblight_config.mode);
} else {
- rgblight_timer_disable();
+
+ #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER)
+ rgblight_timer_disable();
+ #endif
_delay_ms(50);
rgblight_set();
}
@@ -328,6 +338,9 @@ void rgblight_set(void) {
}
}
+
+#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER)
+
// Animation timer -- AVR Timer3
void rgblight_timer_init(void) {
static uint8_t rgblight_timer_is_init = 0;
@@ -503,3 +516,5 @@ void rgblight_effect_knight(uint8_t interval) {
}
}
+
+#endif \ No newline at end of file