From 583cde398a28e429485b440de38a2ed9ec528830 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 22 Mar 2024 17:04:13 +1100 Subject: Un-`extern` RGBLight `led[]` array (#23322) --- quantum/rgblight/rgblight.c | 18 +++++++++--------- quantum/rgblight/rgblight.h | 7 ------- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'quantum') diff --git a/quantum/rgblight/rgblight.c b/quantum/rgblight/rgblight.c index 28b58feea6..b17a501eef 100644 --- a/quantum/rgblight/rgblight.c +++ b/quantum/rgblight/rgblight.c @@ -145,6 +145,15 @@ __attribute__((weak)) RGB rgblight_hsv_to_rgb(HSV hsv) { return hsv_to_rgb(hsv); } +void setrgb(uint8_t r, uint8_t g, uint8_t b, rgb_led_t *led1) { + led1->r = r; + led1->g = g; + led1->b = b; +#ifdef RGBW + led1->w = 0; +#endif +} + void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, rgb_led_t *led1) { HSV hsv = {hue, sat, val}; RGB rgb = rgblight_hsv_to_rgb(hsv); @@ -155,15 +164,6 @@ void sethsv(uint8_t hue, uint8_t sat, uint8_t val, rgb_led_t *led1) { sethsv_raw(hue, sat, val > RGBLIGHT_LIMIT_VAL ? RGBLIGHT_LIMIT_VAL : val, led1); } -void setrgb(uint8_t r, uint8_t g, uint8_t b, rgb_led_t *led1) { - led1->r = r; - led1->g = g; - led1->b = b; -#ifdef RGBW - led1->w = 0; -#endif -} - void rgblight_check_config(void) { /* Add some out of bound checks for RGB light config */ diff --git a/quantum/rgblight/rgblight.h b/quantum/rgblight/rgblight.h index 9e2b073776..0ed67ff6e3 100644 --- a/quantum/rgblight/rgblight.h +++ b/quantum/rgblight/rgblight.h @@ -240,8 +240,6 @@ void rgblight_unblink_all_but_layer(uint8_t layer); #endif -extern rgb_led_t led[RGBLIGHT_LED_COUNT]; - 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; @@ -290,11 +288,6 @@ typedef struct _rgblight_ranges_t { extern rgblight_ranges_t rgblight_ranges; -/* === Utility Functions ===*/ -void sethsv(uint8_t hue, uint8_t sat, uint8_t val, rgb_led_t *led1); -void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, rgb_led_t *led1); // without RGBLIGHT_LIMIT_VAL check -void setrgb(uint8_t r, uint8_t g, uint8_t b, rgb_led_t *led1); - /* === Low level Functions === */ void rgblight_set(void); void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds); -- cgit v1.2.3