Skip to content

Commit

Permalink
Moving rgb typedefs into a single location (#5978)
Browse files Browse the repository at this point in the history
Because someone named the define poorly

Using full relative path as handwired/promethium has a color.h file
  • Loading branch information
XScorpion2 authored and mechmerlin committed Jun 4, 2019
1 parent 661a915 commit e7711b3
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 57 deletions.
2 changes: 1 addition & 1 deletion drivers/avr/apa102.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <avr/io.h>
#include <avr/interrupt.h>

#include "rgblight_types.h"
#include "color.h"


/* User Interface
Expand Down
2 changes: 1 addition & 1 deletion drivers/avr/ws2812.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//#include "ws2812_config.h"
//#include "i2cmaster.h"

#include "rgblight_types.h"
#include "quantum/color.h"

/* User Interface
*
Expand Down
2 changes: 1 addition & 1 deletion keyboards/cannonkeys/bluepill/ws2812.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "hal.h"
#include "rgblight_types.h"
#include "color.h"


void set_leds_color_rgb(LED_TYPE color);
Expand Down
3 changes: 1 addition & 2 deletions keyboards/cannonkeys/stm32f072/ws2812.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#include "hal.h"
#include "rgblight_types.h"

#include "color.h"

void set_leds_color_rgb(LED_TYPE color);
void set_led_color_rgb(LED_TYPE color, int pos);
Expand Down
2 changes: 1 addition & 1 deletion keyboards/handwired/promethium/rgbsps.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ws2812.h"
#include "rgbsps.h"

struct cRGB led[RGBSPS_NUM];
cRGB led[RGBSPS_NUM];

void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b) {
led[index].r = r;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/mxss/rgblight.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#ifndef RGBLIGHT_CUSTOM_DRIVER
#include "ws2812.h"
#endif
#include "rgblight_types.h"
#include "color.h"
#include "rgblight_list.h"

extern LED_TYPE led[RGBLED_NUM];
Expand Down
22 changes: 20 additions & 2 deletions quantum/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,30 @@
#pragma pack( push, 1 )
#endif

#ifdef RGBW
#define LED_TYPE cRGBW
#else
#define LED_TYPE RGB
#endif

// WS2812 specific layout
typedef struct PACKED
{
uint8_t g;
uint8_t r;
uint8_t b;
} cRGB;

typedef cRGB RGB;

// WS2812 specific layout
typedef struct PACKED
{
uint8_t g;
uint8_t r;
uint8_t b;
} RGB;
uint8_t w;
} cRGBW;

typedef struct PACKED
{
Expand All @@ -50,6 +68,6 @@ typedef struct PACKED
#pragma pack( pop )
#endif

RGB hsv_to_rgb( HSV hsv );
RGB hsv_to_rgb(HSV hsv);

#endif // COLOR_H
2 changes: 1 addition & 1 deletion quantum/rgblight.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ enum RGBLIGHT_EFFECT_MODE {
#ifndef RGBLIGHT_CUSTOM_DRIVER
#include "ws2812.h"
#endif
#include "rgblight_types.h"
#include "color.h"
#include "rgblight_list.h"

#if defined(__AVR__)
Expand Down
47 changes: 0 additions & 47 deletions quantum/rgblight_types.h

This file was deleted.

0 comments on commit e7711b3

Please sign in to comment.