Skip to content

Commit fc718d9

Browse files
committed
ESP8266: Stop supporting 400khz neopixels through old esp module API.
It still accepts the parameter for backwards compatibility and to provide a good error when it can't work. Using the `neopixel_write` module instead is recommended because its available on all CircuitPython supported ports.
1 parent 44e5d36 commit fc718d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

esp8266/modesp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_check_fw_obj, esp_check_fw);
672672
STATIC mp_obj_t esp_neopixel_write_(mp_obj_t pin, mp_obj_t buf, mp_obj_t is800k) {
673673
mp_buffer_info_t bufinfo;
674674
mp_get_buffer_raise(buf, &bufinfo, MP_BUFFER_READ);
675+
if (!mp_obj_is_true(is800k)) {
676+
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Only 800khz neopixels are supported."));
677+
}
675678
esp_neopixel_write(mp_obj_get_pin_obj(pin)->phys_port,
676-
(uint8_t*)bufinfo.buf, bufinfo.len, mp_obj_is_true(is800k));
679+
(uint8_t*)bufinfo.buf, bufinfo.len);
677680
return mp_const_none;
678681
}
679682
STATIC MP_DEFINE_CONST_FUN_OBJ_3(esp_neopixel_write_obj, esp_neopixel_write_);

0 commit comments

Comments
 (0)