summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-01-24 09:32:28 -0500
committerDan Halbert <halbert@halwitz.org>2020-01-24 09:32:28 -0500
commit6f13979c9bed6f0810cfca9a9fd70cd9a196e6cd (patch)
tree7016ca63f626d5b0570a815305d34088cea0ce45 /supervisor
parent68f9aee992ffcc12ed2e9f143f353b18fa12c1c3 (diff)
pygamer and pybadge boards were not resetting neopixels
Diffstat (limited to 'supervisor')
-rw-r--r--supervisor/shared/board.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/supervisor/shared/board.c b/supervisor/shared/board.c
index 9e0f5a21e..e3eb8fd0d 100644
--- a/supervisor/shared/board.c
+++ b/supervisor/shared/board.c
@@ -31,14 +31,18 @@
#ifdef USER_NEOPIXELS_PIN
+// The maximum number of user neopixels right now is 10, on Circuit Playgrounds.
+// PyBadge and PyGamer have max 5
+#define USER_NEOPIXELS_MAX_COUNT 10
+
void board_reset_user_neopixels(void) {
// Turn off on-board NeoPixel string
- uint8_t empty[30] = { 0 };
+ uint8_t empty[USER_NEOPIXELS_MAX_COUNT * 3] = { 0 };
digitalio_digitalinout_obj_t neopixel_pin;
common_hal_digitalio_digitalinout_construct(&neopixel_pin, USER_NEOPIXELS_PIN);
common_hal_digitalio_digitalinout_switch_to_output(&neopixel_pin, false,
DRIVE_MODE_PUSH_PULL);
- common_hal_neopixel_write(&neopixel_pin, empty, 30);
+ common_hal_neopixel_write(&neopixel_pin, empty, USER_NEOPIXELS_MAX_COUNT * 3);
common_hal_digitalio_digitalinout_deinit(&neopixel_pin);
}