diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index c42e2c38f8..5b6cd66f9a 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -229,8 +229,8 @@ endif ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += _pixelbuf/% endif -ifeq ($(CIRCUITPY_RAINBOW),1) -SRC_PATTERNS += rainbow/% +ifeq ($(CIRCUITPY_RAINBOWIO),1) +SRC_PATTERNS += rainbowio/% endif ifeq ($(CIRCUITPY_RGBMATRIX),1) SRC_PATTERNS += rgbmatrix/% @@ -536,7 +536,7 @@ SRC_SHARED_MODULE_ALL = \ network/__init__.c \ msgpack/__init__.c \ os/__init__.c \ - rainbow/__init__.c \ + rainbowio/__init__.c \ random/__init__.c \ rgbmatrix/RGBMatrix.c \ rgbmatrix/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 67feef436f..e63186a325 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -644,11 +644,11 @@ extern const struct _mp_obj_module_t pwmio_module; #define PWMIO_MODULE #endif -#if CIRCUITPY_RAINBOW -extern const struct _mp_obj_module_t rainbow_module; -#define RAINBOW_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rainbow), (mp_obj_t)&rainbow_module }, +#if CIRCUITPY_RAINBOWIO +extern const struct _mp_obj_module_t rainbowio_module; +#define RAINBOWIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rainbowio), (mp_obj_t)&rainbowio_module }, #else -#define RAINBOW_MODULE +#define RAINBOWIO_MODULE #endif #if CIRCUITPY_RANDOM @@ -925,7 +925,7 @@ extern const struct _mp_obj_module_t msgpack_module; PS2IO_MODULE \ PULSEIO_MODULE \ PWMIO_MODULE \ - RAINBOW_MODULE \ + RAINBOWIO_MODULE \ RANDOM_MODULE \ RE_MODULE \ RGBMATRIX_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index d601d7df41..6e708b0860 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -246,8 +246,8 @@ CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) CIRCUITPY_PWMIO ?= 1 CFLAGS += -DCIRCUITPY_PWMIO=$(CIRCUITPY_PWMIO) -CIRCUITPY_RAINBOW ?= 1 -CFLAGS += -DCIRCUITPY_RAINBOW=$(CIRCUITPY_RAINBOW) +CIRCUITPY_RAINBOWIO ?= 1 +CFLAGS += -DCIRCUITPY_RAINBOWIO=$(CIRCUITPY_RAINBOWIO) CIRCUITPY_RANDOM ?= 1 CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM) diff --git a/shared-bindings/rainbow/__init__.c b/shared-bindings/rainbowio/__init__.c similarity index 76% rename from shared-bindings/rainbow/__init__.c rename to shared-bindings/rainbowio/__init__.c index 26c9f2d905..41a86deb60 100644 --- a/shared-bindings/rainbow/__init__.c +++ b/shared-bindings/rainbowio/__init__.c @@ -24,10 +24,10 @@ * THE SOFTWARE. */ -#include "shared-bindings/rainbow/__init__.h" +#include "shared-bindings/rainbowio/__init__.h" #include "py/mpconfig.h" #include "py/obj.h" -//| """`rainbow` module. +//| """`rainbowio` module. //| //| Provides the `colorwheel()` function.""" //| @@ -36,19 +36,19 @@ //| Returns the colorwheel RGB value as an integer value for n (usable in neopixel and dotstar).""" //| ... //| -STATIC mp_obj_t rainbow_colorwheel(mp_obj_t n) { +STATIC mp_obj_t rainbowio_colorwheel(mp_obj_t n) { return MP_OBJ_NEW_SMALL_INT(colorwheel(mp_obj_is_small_int(n) ? MP_OBJ_SMALL_INT_VALUE(n) : mp_obj_get_float(n))); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(rainbow_colorwheel_obj, rainbow_colorwheel); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(rainbowio_colorwheel_obj, rainbowio_colorwheel); -STATIC const mp_rom_map_elem_t rainbow_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_rainbow) }, - { MP_ROM_QSTR(MP_QSTR_colorwheel), MP_ROM_PTR(&rainbow_colorwheel_obj) }, +STATIC const mp_rom_map_elem_t rainbowio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_rainbowio) }, + { MP_ROM_QSTR(MP_QSTR_colorwheel), MP_ROM_PTR(&rainbowio_colorwheel_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(rainbow_module_globals, rainbow_module_globals_table); +STATIC MP_DEFINE_CONST_DICT(rainbowio_module_globals, rainbowio_module_globals_table); -const mp_obj_module_t rainbow_module = { +const mp_obj_module_t rainbowio_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&rainbow_module_globals, + .globals = (mp_obj_dict_t *)&rainbowio_module_globals, }; diff --git a/shared-bindings/rainbow/__init__.h b/shared-bindings/rainbowio/__init__.h similarity index 90% rename from shared-bindings/rainbow/__init__.h rename to shared-bindings/rainbowio/__init__.h index 5e1f3f2acb..216687518c 100644 --- a/shared-bindings/rainbow/__init__.h +++ b/shared-bindings/rainbowio/__init__.h @@ -24,10 +24,10 @@ * THE SOFTWARE. */ -#ifndef CP_SHARED_BINDINGS_RAINBOW_INIT_H -#define CP_SHARED_BINDINGS_RAINBOW_INIT_H +#ifndef CP_SHARED_BINDINGS_RAINBOWIO_INIT_H +#define CP_SHARED_BINDINGS_RAINBOWIO_INIT_H #include const int32_t colorwheel(float pos); -#endif // CP_SHARED_BINDINGS_RAINBOW_INIT_H +#endif // CP_SHARED_BINDINGS_RAINBOWIO_INIT_H diff --git a/shared-module/rainbow/__init__.c b/shared-module/rainbowio/__init__.c similarity index 97% rename from shared-module/rainbow/__init__.c rename to shared-module/rainbowio/__init__.c index a371992fe3..ded0c313f7 100644 --- a/shared-module/rainbow/__init__.c +++ b/shared-module/rainbowio/__init__.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/rainbow/__init__.h" +#include "shared-bindings/rainbowio/__init__.h" const int32_t colorwheel(float pos) { if (pos > 255) {