aboutsummaryrefslogtreecommitdiff
path: root/esp8266
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-02-22 12:59:04 +0100
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-02-22 12:59:04 +0100
commitfc718d943794d294a5f80d1a041f13f1522a81ab (patch)
tree8e62291480369436c128525328a0865bf3fe0ed3 /esp8266
parent44e5d3608691870f9642c8ccb3bc6626acc00764 (diff)
ESP8266: Stop supporting 400khz neopixels through old esp module API.0.9.0
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.
Diffstat (limited to 'esp8266')
-rw-r--r--esp8266/modesp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/esp8266/modesp.c b/esp8266/modesp.c
index b7ce122b1..f13d94b32 100644
--- a/esp8266/modesp.c
+++ b/esp8266/modesp.c
@@ -672,8 +672,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_check_fw_obj, esp_check_fw);
STATIC mp_obj_t esp_neopixel_write_(mp_obj_t pin, mp_obj_t buf, mp_obj_t is800k) {
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf, &bufinfo, MP_BUFFER_READ);
+ if (!mp_obj_is_true(is800k)) {
+ nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Only 800khz neopixels are supported."));
+ }
esp_neopixel_write(mp_obj_get_pin_obj(pin)->phys_port,
- (uint8_t*)bufinfo.buf, bufinfo.len, mp_obj_is_true(is800k));
+ (uint8_t*)bufinfo.buf, bufinfo.len);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_3(esp_neopixel_write_obj, esp_neopixel_write_);