summaryrefslogtreecommitdiff
path: root/supervisor/shared
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-08-28 16:09:18 -0400
committerDan Halbert <halbert@halwitz.org>2019-08-28 16:09:18 -0400
commita72bcab0fd2af3c2b92f4d256c6bd5ae58fd225e (patch)
tree745a219e936af91dac0a4d5de2cc0ef5d6c93a6b /supervisor/shared
parent0364f1dc854ff5f30b9ab2a72a406aab684a1d20 (diff)
parent7cbae3d20c0f79511a932bbcb2d66d2620b6bb3a (diff)
Merge remote-tracking branch 'adafruit/master' into bleio-api-revamp
Diffstat (limited to 'supervisor/shared')
-rw-r--r--supervisor/shared/display.c24
-rw-r--r--supervisor/shared/rgb_led_status.c12
-rw-r--r--supervisor/shared/rgb_led_status.h2
3 files changed, 25 insertions, 13 deletions
diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c
index fd51e2c07..586b6f8be 100644
--- a/supervisor/shared/display.c
+++ b/supervisor/shared/display.c
@@ -151,37 +151,49 @@ _displayio_color_t blinka_colors[7] = {
.rgb888 = 0x000000,
.rgb565 = 0x0000,
.luma = 0x00,
+ .chroma = 0,
.transparent = true
},
{
.rgb888 = 0x8428bc,
.rgb565 = 0x7889,
- .luma = 0xff // We cheat the luma here. It is actually 0x60
+ .luma = 0xff, // We cheat the luma here. It is actually 0x60
+ .hue = 184,
+ .chroma = 148
},
{
.rgb888 = 0xff89bc,
.rgb565 = 0xB8FC,
- .luma = 0xb5
+ .luma = 0xb5,
+ .hue = 222,
+ .chroma = 118
},
{
.rgb888 = 0x7beffe,
.rgb565 = 0x9F86,
- .luma = 0xe0
+ .luma = 0xe0,
+ .hue = 124,
+ .chroma = 131
},
{
.rgb888 = 0x51395f,
.rgb565 = 0x0D5A,
- .luma = 0x47
+ .luma = 0x47,
+ .hue = 185,
+ .chroma = 38
},
{
.rgb888 = 0xffffff,
.rgb565 = 0xffff,
- .luma = 0xff
+ .luma = 0xff,
+ .chroma = 0
},
{
.rgb888 = 0x0736a0,
.rgb565 = 0xf501,
- .luma = 0x44
+ .luma = 0x44,
+ .hue = 147,
+ .chroma = 153
},
};
diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c
index 0e69cd2e0..9f233defa 100644
--- a/supervisor/shared/rgb_led_status.c
+++ b/supervisor/shared/rgb_led_status.c
@@ -40,7 +40,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;
static uint8_t status_apa102_color[12] = {0, 0, 0, 0, 0xff, 0, 0, 0};
-#ifdef CIRCUITPY_BITBANG_APA102
+#if CIRCUITPY_BITBANG_APA102
#include "shared-bindings/bitbangio/SPI.h"
#include "shared-module/bitbangio/types.h"
static bitbangio_spi_obj_t status_apa102;
@@ -81,7 +81,7 @@ void rgb_led_status_init() {
common_hal_digitalio_digitalinout_switch_to_output(&status_neopixel, false, DRIVE_MODE_PUSH_PULL);
#endif
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
- #ifdef CIRCUITPY_BITBANG_APA102
+ #if CIRCUITPY_BITBANG_APA102
shared_module_bitbangio_spi_construct(&status_apa102,
MICROPY_HW_APA102_SCK,
MICROPY_HW_APA102_MOSI,
@@ -102,7 +102,7 @@ void rgb_led_status_init() {
// mark them as used.
apa102_mosi_in_use = false;
apa102_sck_in_use = false;
- #ifdef CIRCUITPY_BITBANG_APA102
+ #if CIRCUITPY_BITBANG_APA102
shared_module_bitbangio_spi_try_lock(&status_apa102);
shared_module_bitbangio_spi_configure(&status_apa102, 100000, 0, 1, 8);
#else
@@ -185,7 +185,7 @@ void new_status_color(uint32_t rgb) {
status_apa102_color[6] = (rgb_adjusted >> 8) & 0xff;
status_apa102_color[7] = (rgb_adjusted >> 16) & 0xff;
- #ifdef CIRCUITPY_BITBANG_APA102
+ #if CIRCUITPY_BITBANG_APA102
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, 8);
#else
common_hal_busio_spi_write(&status_apa102, status_apa102_color, 8);
@@ -230,7 +230,7 @@ void temp_status_color(uint32_t rgb) {
return;
}
uint8_t colors[12] = {0, 0, 0, 0, 0xff, rgb_adjusted & 0xff, (rgb_adjusted >> 8) & 0xff, (rgb_adjusted >> 16) & 0xff, 0x0, 0x0, 0x0, 0x0};
- #ifdef CIRCUITPY_BITBANG_APA102
+ #if CIRCUITPY_BITBANG_APA102
shared_module_bitbangio_spi_write(&status_apa102, colors, 12);
#else
common_hal_busio_spi_write(&status_apa102, colors, 12);
@@ -264,7 +264,7 @@ void clear_temp_status() {
common_hal_neopixel_write(&status_neopixel, status_neopixel_color, 3);
#endif
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
- #ifdef CIRCUITPY_BITBANG_APA102
+ #if CIRCUITPY_BITBANG_APA102
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, 8);
#else
common_hal_busio_spi_write(&status_apa102, status_apa102_color, 8);
diff --git a/supervisor/shared/rgb_led_status.h b/supervisor/shared/rgb_led_status.h
index 83f4822d7..e4e1981a2 100644
--- a/supervisor/shared/rgb_led_status.h
+++ b/supervisor/shared/rgb_led_status.h
@@ -44,7 +44,7 @@
// To work with a NeoPixel, one must have MICROPY_HW_NEOPIXEL defined and
// neopixel_write implemented.
-#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) && !defined(CIRCUITPY_BITBANG_APA102)
+#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) && !CIRCUITPY_BITBANG_APA102
#include "common-hal/busio/SPI.h"
extern busio_spi_obj_t status_apa102;
#endif