8000 check for None spi when initializing FourWire · fraziern/circuitpython@d3317b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit d3317b0

Browse files
committed
check for None spi when initializing FourWire
1 parent f13db0d commit d3317b0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

locale/circuitpython.pot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,10 @@ msgstr ""
20622062
msgid "SPI Re-initialization error"
20632063
msgstr ""
2064 B621 2064

2065+
#: shared-bindings/displayio/FourWire.c
2066+
msgid "SPI cannot be None"
2067+
msgstr ""
2068+
20652069
#: ports/espressif/common-hal/busio/SPI.c
20662070
msgid "SPI configuration failed"
20672071
msgstr ""

shared-bindings/displayio/FourWire.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_
7979
mcu_pin_obj_t *reset = validate_obj_is_free_pin_or_none(args[ARG_reset].u_obj);
8080

8181
mp_obj_t spi = args[ARG_spi_bus].u_obj;
82+
if (spi == mp_const_none) {
83+
mp_raise_ValueError(translate("SPI cannot be None"));
84+
}
8285
displayio_fourwire_obj_t *self = &allocate_display_bus_or_raise()->fourwire_bus;
8386
self->base.type = &displayio_fourwire_type;
8487

0 commit comments

Comments
 (0)
0