Merge pull request #4991 from kattni/rainbowio

Rename rainbow to rainbowio
This commit is contained in:
Scott Shawcroft 2021-07-12 13:14:14 -07:00 committed by GitHub
commit 4b371a8182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 24 deletions

View File

@ -229,8 +229,8 @@ endif
ifeq ($(CIRCUITPY_PIXELBUF),1) ifeq ($(CIRCUITPY_PIXELBUF),1)
SRC_PATTERNS += _pixelbuf/% SRC_PATTERNS += _pixelbuf/%
endif endif
ifeq ($(CIRCUITPY_RAINBOW),1) ifeq ($(CIRCUITPY_RAINBOWIO),1)
SRC_PATTERNS += rainbow/% SRC_PATTERNS += rainbowio/%
endif endif
ifeq ($(CIRCUITPY_RGBMATRIX),1) ifeq ($(CIRCUITPY_RGBMATRIX),1)
SRC_PATTERNS += rgbmatrix/% SRC_PATTERNS += rgbmatrix/%
@ -536,7 +536,7 @@ SRC_SHARED_MODULE_ALL = \
network/__init__.c \ network/__init__.c \
msgpack/__init__.c \ msgpack/__init__.c \
os/__init__.c \ os/__init__.c \
rainbow/__init__.c \ rainbowio/__init__.c \
random/__init__.c \ random/__init__.c \
rgbmatrix/RGBMatrix.c \ rgbmatrix/RGBMatrix.c \
rgbmatrix/__init__.c \ rgbmatrix/__init__.c \

View File

@ -644,11 +644,11 @@ extern const struct _mp_obj_module_t pwmio_module;
#define PWMIO_MODULE #define PWMIO_MODULE
#endif #endif
#if CIRCUITPY_RAINBOW #if CIRCUITPY_RAINBOWIO
extern const struct _mp_obj_module_t rainbow_module; extern const struct _mp_obj_module_t rainbowio_module;
#define RAINBOW_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rainbow), (mp_obj_t)&rainbow_module }, #define RAINBOWIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rainbowio), (mp_obj_t)&rainbowio_module },
#else #else
#define RAINBOW_MODULE #define RAINBOWIO_MODULE
#endif #endif
#if CIRCUITPY_RANDOM #if CIRCUITPY_RANDOM
@ -925,7 +925,7 @@ extern const struct _mp_obj_module_t msgpack_module;
PS2IO_MODULE \ PS2IO_MODULE \
PULSEIO_MODULE \ PULSEIO_MODULE \
PWMIO_MODULE \ PWMIO_MODULE \
RAINBOW_MODULE \ RAINBOWIO_MODULE \
RANDOM_MODULE \ RANDOM_MODULE \
RE_MODULE \ RE_MODULE \
RGBMATRIX_MODULE \ RGBMATRIX_MODULE \

View File

@ -246,8 +246,8 @@ CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO)
CIRCUITPY_PWMIO ?= 1 CIRCUITPY_PWMIO ?= 1
CFLAGS += -DCIRCUITPY_PWMIO=$(CIRCUITPY_PWMIO) CFLAGS += -DCIRCUITPY_PWMIO=$(CIRCUITPY_PWMIO)
CIRCUITPY_RAINBOW ?= 1 CIRCUITPY_RAINBOWIO ?= 1
CFLAGS += -DCIRCUITPY_RAINBOW=$(CIRCUITPY_RAINBOW) CFLAGS += -DCIRCUITPY_RAINBOWIO=$(CIRCUITPY_RAINBOWIO)
CIRCUITPY_RANDOM ?= 1 CIRCUITPY_RANDOM ?= 1
CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM) CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM)

View File

@ -24,10 +24,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "shared-bindings/rainbow/__init__.h" #include "shared-bindings/rainbowio/__init__.h"
#include "py/mpconfig.h" #include "py/mpconfig.h"
#include "py/obj.h" #include "py/obj.h"
//| """`rainbow` module. //| """`rainbowio` module.
//| //|
//| Provides the `colorwheel()` function.""" //| Provides the `colorwheel()` function."""
//| //|
@ -36,19 +36,19 @@
//| Returns the colorwheel RGB value as an integer value for n (usable in neopixel and dotstar).""" //| 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))); 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[] = { STATIC const mp_rom_map_elem_t rainbowio_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_rainbow) }, { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_rainbowio) },
{ MP_ROM_QSTR(MP_QSTR_colorwheel), MP_ROM_PTR(&rainbow_colorwheel_obj) }, { 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 }, .base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&rainbow_module_globals, .globals = (mp_obj_dict_t *)&rainbowio_module_globals,
}; };

View File

@ -24,10 +24,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#ifndef CP_SHARED_BINDINGS_RAINBOW_INIT_H #ifndef CP_SHARED_BINDINGS_RAINBOWIO_INIT_H
#define CP_SHARED_BINDINGS_RAINBOW_INIT_H #define CP_SHARED_BINDINGS_RAINBOWIO_INIT_H
#include <stdint.h> #include <stdint.h>
const int32_t colorwheel(float pos); const int32_t colorwheel(float pos);
#endif // CP_SHARED_BINDINGS_RAINBOW_INIT_H #endif // CP_SHARED_BINDINGS_RAINBOWIO_INIT_H

View File

@ -24,7 +24,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "shared-bindings/rainbow/__init__.h" #include "shared-bindings/rainbowio/__init__.h"
const int32_t colorwheel(float pos) { const int32_t colorwheel(float pos) {
if (pos > 255) { if (pos > 255) {