summaryrefslogtreecommitdiffstats
path: root/quantum/rgblight.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2018-07-16 17:48:31 +0200
committerGitHub <noreply@github.com>2018-07-16 17:48:31 +0200
commitade22f8e2c272044ea2f80ff6fe5ca9576858939 (patch)
tree03c0131fa5982afc10a60e1fdd38a60be750291b /quantum/rgblight.c
parent96cb9f4661faa80e795b1e6731b7a8e8a50bd0cb (diff)
downloadqmk_firmware-ade22f8e2c272044ea2f80ff6fe5ca9576858939.tar.gz
qmk_firmware-ade22f8e2c272044ea2f80ff6fe5ca9576858939.tar.xz
Adds support for Planck Rev 6 (#2666)
* initial files for rev 6 with encoder * music map init, dip scan added * adds ws2812 driver for arm * flesh out dip and encoder support * adds default encoder res * adds default encoder res * start muse implementation * muse working with encoder as control * flip direction * try mouse wheel again * dont break other revs * dont break other revs * conditional autio * pwm ws driver (not working) * update build includes for chibios * update ws2812 driver/config * last commit for glasser code * working example * remove rgb for now * finish up rev6 * working encoder keycodes * add warnings to planck keymaps about the LAYOUT
Diffstat (limited to 'quantum/rgblight.c')
-rw-r--r--quantum/rgblight.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 4e2671d24..2490a1d9f 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -14,9 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <math.h>
-#include <avr/eeprom.h>
-#include <avr/interrupt.h>
-#include <util/delay.h>
+#ifdef __AVR__
+ #include <avr/eeprom.h>
+ #include <avr/interrupt.h>
+#endif
+#include "wait.h"
#include "progmem.h"
#include "timer.h"
#include "rgblight.h"
@@ -113,10 +115,16 @@ void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) {
uint32_t eeconfig_read_rgblight(void) {
- return eeprom_read_dword(EECONFIG_RGBLIGHT);
+ #ifdef __AVR__
+ return eeprom_read_dword(EECONFIG_RGBLIGHT);
+ #else
+ return 0;
+ #endif
}
void eeconfig_update_rgblight(uint32_t val) {
- eeprom_update_dword(EECONFIG_RGBLIGHT, val);
+ #ifdef __AVR__
+ eeprom_update_dword(EECONFIG_RGBLIGHT, val);
+ #endif
}
void eeconfig_update_rgblight_default(void) {
dprintf("eeconfig_update_rgblight_default\n");
@@ -311,7 +319,7 @@ void rgblight_disable(void) {
#ifdef RGBLIGHT_ANIMATIONS
rgblight_timer_disable();
#endif
- _delay_ms(50);
+ wait_ms(50);
rgblight_set();
}