8000 Handle inverted neopixel power · domdfcoding/circuitpython@499a438 · GitHub
[go: up one dir, main page]

Skip to content

Commit 499a438

Browse files
committed
Handle inverted neopixel power
1 parent b78e9fc commit 499a438

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#define MICROPY_HW_NEOPIXEL (&pin_GPIO1)
3333
#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO21)
34+
#define CIRCUITPY_STATUS_LED_POWER_INVERTED (1)
3435

3536
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
3637

ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
4444
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },
4545
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) },
4646

47+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER_INVERTED), MP_ROM_PTR(&pin_GPIO21) },
4748
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) },
4849

4950
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO1) },

py/circuitpy_mpconfig.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,10 @@ void supervisor_run_background_tasks_if_tick(void);
991991
#define CIRCUITPY_PROCESSOR_COUNT (1)
992992
#endif
993993

994+
#ifndef CIRCUITPY_STATUS_LED_POWER_INVERTED
995+
#define CIRCUITPY_STATUS_LED_POWER_INVERTED (0)
996+
#endif
997+
994998
#define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt"
995999

9961000
#define CIRCUITPY_VERBOSE_BLE 0

supervisor/shared/status_leds.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ void status_led_init() {
124124

125125
#ifdef CIRCUITPY_STATUS_LED_POWER
126126
common_hal_digitalio_digitalinout_construct(&_status_power, CIRCUITPY_STATUS_LED_POWER);
127-
common_hal_digitalio_digitalinout_switch_to_output(&_status_power, true, DRIVE_MODE_PUSH_PULL);
127+
common_hal_digitalio_digitalinout_switch_to_output(&_status_power,
128+
CIRCUITPY_STATUS_LED_POWER_INVERTED == 0, DRIVE_MODE_PUSH_PULL);
128129
#endif
129130

130131
#ifdef MICROPY_HW_NEOPIXEL

0 commit comments

Comments
 (0)
0