X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Frgblight.c;h=2490a1d9f3fa4e60490a5101cadeb1974cd5cd1a;hb=ade22f8e2c272044ea2f80ff6fe5ca9576858939;hp=8b2a3cd9f85d30f4764e21f30c8ba68517c07961;hpb=5229734647706054066c277ea348a6d25cc38095;p=qmk_firmware.git
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 8b2a3cd9f..2490a1d9f 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -14,9 +14,11 @@
* along with this program. If not, see .
*/
#include
-#include
-#include
-#include
+#ifdef __AVR__
+ #include
+ #include
+#endif
+#include "wait.h"
#include "progmem.h"
#include "timer.h"
#include "rgblight.h"
@@ -48,7 +50,6 @@ const uint16_t RGBLED_RGBTEST_INTERVALS[] PROGMEM = {1024};
rgblight_config_t rgblight_config;
LED_TYPE led[RGBLED_NUM];
-uint8_t rgblight_inited = 0;
bool rgblight_timer_enabled = false;
void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) {
@@ -114,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");
@@ -142,7 +149,6 @@ void eeconfig_debug_rgblight(void) {
void rgblight_init(void) {
debug_enable = 1; // Debug ON!
dprintf("rgblight_init called.\n");
- rgblight_inited = 1;
dprintf("rgblight_init start!\n");
if (!eeconfig_is_enabled()) {
dprintf("rgblight_init eeconfig is not enabled.\n");
@@ -313,7 +319,7 @@ void rgblight_disable(void) {
#ifdef RGBLIGHT_ANIMATIONS
rgblight_timer_disable();
#endif
- _delay_ms(50);
+ wait_ms(50);
rgblight_set();
}