Skip to content

Commit c369313

Browse files
authored
Merge pull request adafruit#2260 from dhalbert/dotstar-brightness
Reduce DotStar status brightness; macros for status colors
2 parents c1f5650 + 99fe905 commit c369313

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

supervisor/shared/rgb_led_colors.h

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
#define BLACK 0x000000
2-
#define GREEN 0x003000
3-
#define BLUE 0x000030
4-
#define CYAN 0x003030
5-
#define RED 0x300000
6-
#define ORANGE 0x302000
7-
#define YELLOW 0x303000
8-
#define PURPLE 0x300030
9-
#define WHITE 0x303030
1+
2+
#define COLOR(r, g, b) (((r) << 16) | ((g) << 8) | (b))
3+
// For brightness == 255 (full). This will be adjusted downward for various different RGB indicators,
4+
// which vary in brightness.
5+
#define INTENSITY (0x30)
6+
7+
#define BLACK COLOR(0, 0, 0)
8+
#define GREEN COLOR(0, INTENSITY, 0)
9+
#define BLUE COLOR(0, 0, INTENSITY)
10+
#define CYAN COLOR(0, INTENSITY, INTENSITY)
11+
#define RED COLOR(INTENSITY, 0, 0)
12+
#define ORANGE COLOR(INTENSITY, INTENSITY*2/3, 0)
13+
#define YELLOW COLOR(INTENSITY, INTENSITY, 0)
14+
#define PURPLE COLOR(INTENSITY, 0, INTENSITY)
15+
#define WHITE COLOR(INTENSITY, INTENSITY, INTENSITY)
1016

1117
#define BOOT_RUNNING BLUE
1218
#define MAIN_RUNNING GREEN

supervisor/shared/rgb_led_status.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static digitalio_digitalinout_obj_t status_neopixel;
3838

3939

4040
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
41-
uint8_t rgb_status_brightness = 255;
41+
uint8_t rgb_status_brightness = 50;
4242

4343
#define APA102_BUFFER_LENGTH 12
4444
static uint8_t status_apa102_color[APA102_BUFFER_LENGTH] = {0, 0, 0, 0, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0xff};

0 commit comments

Comments
 (0)