Rename rainbow to rainbowio
This commit is contained in:
parent
0c6dc6f0a4
commit
4579bf9b12
|
@ -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 \
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
};
|
|
@ -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 <stdint.h>
|
||||
|
||||
const int32_t colorwheel(float pos);
|
||||
|
||||
#endif // CP_SHARED_BINDINGS_RAINBOW_INIT_H
|
||||
#endif // CP_SHARED_BINDINGS_RAINBOWIO_INIT_H
|
|
@ -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) {
|
Loading…
Reference in New Issue