@@ -46,10 +46,18 @@ static uint8_t status_apa102_color[APA102_BUFFER_LENGTH] = {0, 0, 0, 0, 0xff, 0,
4646#if CIRCUITPY_BITBANG_APA102
4747#include "shared-bindings/bitbangio/SPI.h"
4848#include "shared-module/bitbangio/types.h"
49- static bitbangio_spi_obj_t status_apa102 ;
49+ static bitbangio_spi_obj_t status_apa102 = {
50+ .base = {
51+ .type = & bitbangio_spi_type ,
52+ },
53+ };
5054#else
5155#include "shared-bindings/busio/SPI.h"
52- busio_spi_obj_t status_apa102 ;
56+ busio_spi_obj_t status_apa102 = {
57+ .base = {
58+ .type = & busio_spi_type ,
59+ },
60+ };
5361#endif
5462#endif
5563
@@ -59,9 +67,21 @@ busio_spi_obj_t status_apa102;
5967#include "shared-bindings/pulseio/PWMOut.h"
6068#include "shared-bindings/microcontroller/Pin.h"
6169
62- pulseio_pwmout_obj_t rgb_status_r ;
63- pulseio_pwmout_obj_t rgb_status_g ;
64- pulseio_pwmout_obj_t rgb_status_b ;
70+ pulseio_pwmout_obj_t rgb_status_r = {
71+ .base = {
72+ .type = & pulseio_pwmout_type ,
73+ },
74+ };
75+ pulseio_pwmout_obj_t rgb_status_g = {
76+ .base = {
77+ .type = & pulseio_pwmout_type ,
78+ },
79+ };
80+ pulseio_pwmout_obj_t rgb_status_b = {
81+ .base = {
82+ .type = & pulseio_pwmout_type ,
83+ },
84+ };
6585
6686uint8_t rgb_status_brightness = 0xFF ;
6787
@@ -105,6 +125,7 @@ void rgb_led_status_init() {
105125 MICROPY_HW_APA102_SCK ,
106126 MICROPY_HW_APA102_MOSI ,
107127 mp_const_none );
128+ common_hal_busio_spi_never_reset (& status_apa102 );
108129 #endif
109130 // Pretend we aren't using the pins. bitbangio.SPI will
110131 // mark them as used.
0 commit comments