diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-02-19 17:22:42 +0100 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-02-19 17:22:42 +0100 |
| commit | f0b62a2b0eef5d6a825d6ca19a8c50f019e2628f (patch) | |
| tree | c15ce4b0fa684efe999d698b9569de5c5266559f /shared-bindings/neopixel_write | |
| parent | 710b5d8aff2de490c5531e5cbc9092d51fb39958 (diff) | |
Save space by only supporting 800khz neopixels.
Diffstat (limited to 'shared-bindings/neopixel_write')
| -rw-r--r-- | shared-bindings/neopixel_write/__init__.c | 10 | ||||
| -rw-r--r-- | shared-bindings/neopixel_write/__init__.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index 73fd803c5..8a75e7419 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -40,7 +40,7 @@ //| :platform: SAMD21 //| //| The `neopixel_write` module contains a helper method to write out bytes in -//| the neopixel protocol. +//| the 800khz neopixel protocol. //| .. method:: neopixel_write.neopixel_write(digitalinout, buf, is800KHz) //| @@ -48,19 +48,17 @@ //| //| :param ~nativeio.DigitalInOut gpio: the DigitalInOut to output with //| :param bytearray buf: The bytes to clock out. No assumption is made about color order -//| :param bool is800KHz: True if the pixels are 800KHz, otherwise 400KHz is assumed. //| -STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf, mp_obj_t is800k) { +STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf) { // Convert parameters into expected types. const nativeio_digitalinout_obj_t *digitalinout = MP_OBJ_TO_PTR(digitalinout_obj); mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf, &bufinfo, MP_BUFFER_READ); // Call platform's neopixel write function with provided buffer and options. - common_hal_neopixel_write(digitalinout, (uint8_t*)bufinfo.buf, bufinfo.len, - mp_obj_is_true(is800k)); + common_hal_neopixel_write(digitalinout, (uint8_t*)bufinfo.buf, bufinfo.len); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_3(neopixel_write_neopixel_write_obj, neopixel_write_neopixel_write_); +STATIC MP_DEFINE_CONST_FUN_OBJ_2(neopixel_write_neopixel_write_obj, neopixel_write_neopixel_write_); STATIC const mp_rom_map_elem_t neopixel_write_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write) }, diff --git a/shared-bindings/neopixel_write/__init__.h b/shared-bindings/neopixel_write/__init__.h index fdf3c38f6..87f85ee01 100644 --- a/shared-bindings/neopixel_write/__init__.h +++ b/shared-bindings/neopixel_write/__init__.h @@ -32,6 +32,6 @@ #include "common-hal/nativeio/types.h" -extern void common_hal_neopixel_write(const nativeio_digitalinout_obj_t* gpio, uint8_t *pixels, uint32_t numBytes, bool is800KHz); +extern void common_hal_neopixel_write(const nativeio_digitalinout_obj_t* gpio, uint8_t *pixels, uint32_t numBytes); #endif |
