瀏覽代碼

Merge pull request #972 from mechkeys/rgb_compat

Add extern for 'led' global, set 'weak' attribute for rgblight_set()
Jack Humbert 8 年之前
父節點
當前提交
8a76075ca7
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 1 0
      quantum/rgblight.c
  2. 2 0
      quantum/rgblight.h

+ 1 - 0
quantum/rgblight.c

@@ -370,6 +370,7 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) {
   rgblight_set();
 }
 
+__attribute__ ((weak))
 void rgblight_set(void) {
   if (rgblight_config.enable) {
     #ifdef RGBW

+ 2 - 0
quantum/rgblight.h

@@ -40,6 +40,8 @@
 #include "eeconfig.h"
 #include "light_ws2812.h"
 
+extern LED_TYPE led[RGBLED_NUM];
+
 extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM;
 extern const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[3] PROGMEM;
 extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM;