Skip to content

Commit

Permalink
Reduce DotStar status brightness; macros for status colors
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed Nov 1, 2019
1 parent 08d1019 commit 99fe905
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions supervisor/shared/rgb_led_colors.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#define BLACK 0x000000
#define GREEN 0x003000
#define BLUE 0x000030
#define CYAN 0x003030
#define RED 0x300000
#define ORANGE 0x302000
#define YELLOW 0x303000
#define PURPLE 0x300030
#define WHITE 0x303030

#define COLOR(r, g, b) (((r) << 16) | ((g) << 8) | (b))
// For brightness == 255 (full). This will be adjusted downward for various different RGB indicators,
// which vary in brightness.
#define INTENSITY (0x30)

#define BLACK COLOR(0, 0, 0)
#define GREEN COLOR(0, INTENSITY, 0)
#define BLUE COLOR(0, 0, INTENSITY)
#define CYAN COLOR(0, INTENSITY, INTENSITY)
#define RED COLOR(INTENSITY, 0, 0)
#define ORANGE COLOR(INTENSITY, INTENSITY*2/3, 0)
#define YELLOW COLOR(INTENSITY, INTENSITY, 0)
#define PURPLE COLOR(INTENSITY, 0, INTENSITY)
#define WHITE COLOR(INTENSITY, INTENSITY, INTENSITY)

#define BOOT_RUNNING BLUE
#define MAIN_RUNNING GREEN
Expand Down
2 changes: 1 addition & 1 deletion supervisor/shared/rgb_led_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static digitalio_digitalinout_obj_t status_neopixel;


#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
uint8_t rgb_status_brightness = 255;
uint8_t rgb_status_brightness = 50;

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

0 comments on commit 99fe905

Please sign in to comment.