Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@
[submodule "frozen/Adafruit_CircuitPython_Register"]
path = frozen/Adafruit_CircuitPython_Register
url = https://github.com/adafruit/Adafruit_CircuitPython_Register.git
[submodule "extmod/ulab"]
path = extmod/ulab
url = https://github.com/adafruit/circuitpython-ulab
[submodule "frozen/Adafruit_CircuitPython_ESP32SPI"]
path = frozen/Adafruit_CircuitPython_ESP32SPI
url = https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI
[submodule "frozen/Adafruit_CircuitPython_Requests"]
path = frozen/Adafruit_CircuitPython_Requests
url = https://github.com/adafruit/Adafruit_CircuitPython_Requests
url = https://github.com/adafruit/Adafruit_CircuitPython_Requests
1 change: 1 addition & 0 deletions extmod/ulab
Submodule ulab added at 42d831
1 change: 1 addition & 0 deletions lib/libm/erf_lgamma.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

#include "fdlibm.h"
#pragma GCC diagnostic ignored "-Wfloat-equal"

#define __ieee754_logf logf

Expand Down
2 changes: 2 additions & 0 deletions lib/libm/log1pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "libm.h"

#pragma GCC diagnostic ignored "-Wfloat-equal"

static const float
ln2_hi = 6.9313812256e-01, /* 0x3f317180 */
ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */
Expand Down
3 changes: 3 additions & 0 deletions lib/libm/math.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ float copysignf(float x, float y) {

static const float _M_LN10 = 2.30258509299404; // 0x40135d8e
float log10f(float x) { return logf(x) / (float)_M_LN10; }
#undef _M_LN2
static const float _M_LN2 = 0.6931472;
float log2f(float x) { return logf(x) / (float)_M_LN2; }

float tanhf(float x) {
if (isinf(x)) {
Expand Down
2 changes: 1 addition & 1 deletion locale/ID.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: Pascal Deneaux\n"
"Language-Team: Sebastian Plamauer, Pascal Deneaux\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/en_US.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
2 changes: 1 addition & 1 deletion locale/en_x_pirate.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: @sommersoft, @MrCertainly\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-08-24 22:56-0500\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
2 changes: 1 addition & 1 deletion locale/fil.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-12-20 22:15-0800\n"
"Last-Translator: Timothy <me@timothygarcia.ca>\n"
"Language-Team: fil\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2019-04-14 20:05+0100\n"
"Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n"
"Language-Team: fr\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/it_IT.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
"Language-Team: \n"
Expand Down
2 changes: 1 addition & 1 deletion locale/ko.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2019-05-06 14:22-0700\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/pl.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2019-03-19 18:37-0700\n"
"Last-Translator: Radomir Dopieralski <circuitpython@sheep.art.pl>\n"
"Language-Team: pl\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-10-02 21:14-0000\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
2 changes: 1 addition & 1 deletion locale/zh_Latn_pinyin.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: circuitpython-cn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-02 11:20-0500\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2019-04-13 10:10-0700\n"
"Last-Translator: hexthat\n"
"Language-Team: Chinese Hanyu Pinyin\n"
Expand Down
2 changes: 2 additions & 0 deletions ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_NETWORK = 0
CIRCUITPY_PS2IO = 0
CIRCUITPY_AUDIOMP3 = 0

MICROPY_PY_ULAB = 0
6 changes: 6 additions & 0 deletions ports/atmel-samd/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ ifndef CIRCUITPY_SAMD
CIRCUITPY_SAMD = 1
endif

ifndef MICROPY_PY_ULAB
ifneq ($(CIRCUITPY_SMALL_BUILD),1)
MICROPY_PY_ULAB = 1
endif
endif

endif # samd51

INTERNAL_LIBM = 1
Expand Down
1 change: 1 addition & 0 deletions ports/nrf/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
# Defined here because system_nrf52840.c doesn't #include any of our own include files.
CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS

MICROPY_PY_ULAB = 1
endif
3 changes: 3 additions & 0 deletions ports/unix/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,6 @@ void mp_unix_mark_exec(void);
// For debugging purposes, make printf() available to any source file.
#include <stdio.h>
#endif

#define MICROPY_PY_BUILTINS_HELP (1)
#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
2 changes: 2 additions & 0 deletions ports/unix/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ MICROPY_PY_JNI = 0
# Avoid using system libraries, use copies bundled with MicroPython
# as submodules (currently affects only libffi).
MICROPY_STANDALONE = 0

MICROPY_PY_ULAB = 1
7 changes: 7 additions & 0 deletions py/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ extern const mp_obj_module_t mp_module_websocket;
extern const mp_obj_module_t mp_module_webrepl;
extern const mp_obj_module_t mp_module_framebuf;
extern const mp_obj_module_t mp_module_btree;
extern const mp_obj_module_t ulab_user_cmodule;
extern mp_obj_module_t ulab_fft_module;
extern mp_obj_module_t ulab_filter_module;
extern mp_obj_module_t ulab_linalg_module;
extern mp_obj_module_t ulab_numerical_module;
extern mp_obj_module_t ulab_poly_module;


extern const char MICROPY_PY_BUILTINS_HELP_TEXT[];

Expand Down
13 changes: 13 additions & 0 deletions py/circuitpy_defns.mk
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,19 @@ $(addprefix lib/,\
libm/atanf.c \
libm/atan2f.c \
)
ifeq ($(MICROPY_PY_ULAB),1)
SRC_LIBM += \
$(addprefix lib/,\
libm/acoshf.c \
libm/asinhf.c \
libm/atanhf.c \
libm/erf_lgamma.c \
libm/log1pf.c \
libm/sf_erf.c \
libm/wf_lgamma.c \
libm/wf_tgamma.c \
)
endif
endif

ifdef LD_TEMPLATE_FILE
Expand Down
6 changes: 6 additions & 0 deletions py/circuitpy_mpconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@ extern const struct _mp_obj_module_t ustack_module;
#define JSON_MODULE
#endif

#if defined(MICROPY_PY_ULAB) && MICROPY_PY_ULAB
#define ULAB_MODULE \
{ MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) },
#else
#define ULAB_MODULE
#endif
#if MICROPY_PY_URE
#define RE_MODULE { MP_ROM_QSTR(MP_QSTR_re), MP_ROM_PTR(&mp_module_ure) },
#else
Expand Down
4 changes: 4 additions & 0 deletions py/mpconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,10 @@ typedef double mp_float_t;
#define MICROPY_PY_UJSON (0)
#endif

#ifndef MICROPY_PY_ULAB
#define MICROPY_PY_ULAB (0)
#endif

#ifndef MICROPY_PY_URE
#define MICROPY_PY_URE (0)
#endif
Expand Down
8 changes: 8 additions & 0 deletions py/objmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
{ MP_ROM_QSTR(MP_QSTR_ujson), MP_ROM_PTR(&mp_module_ujson) },
#endif
#endif
#if MICROPY_PY_ULAB
#if CIRCUITPY
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
// TODO: move to shared-bindings/
#else
{ MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) },
#endif
#endif
#if MICROPY_PY_URE
#if CIRCUITPY
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
Expand Down
16 changes: 16 additions & 0 deletions py/py.mk
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,22 @@ $(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare
$(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS)
endif

ifeq ($(MICROPY_PY_ULAB),1)
SRC_MOD += $(addprefix extmod/ulab/code/, \
create.c \
fft.c \
filter.c \
linalg.c \
ndarray.c \
numerical.c \
poly.c \
ulab.c \
vectorise.c \
)
CFLAGS_MOD += -DMICROPY_PY_ULAB=1 -DMODULE_ULAB_ENABLED=1
$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-sign-compare -Wno-missing-prototypes -Wno-unused-parameter -Wno-missing-declarations -Wno-error -Wno-shadow -Wno-maybe-uninitialized -DCIRCUITPY
endif

# External modules written in C.
ifneq ($(USER_C_MODULES),)
# pre-define USERMOD variables as expanded so that variables are immediate
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/audiocore/RawSample.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
//| first sample will be for channel 1, the second sample will be for channel two, the third for
//| channel 1 and so on.
//|
//| :param array buffer: An `array.array` with samples
//| :param array.array buffer: An `array.array` with samples
//| :param int channel_count: The number of channels in the buffer
//| :param int sample_rate: The desired playback sample rate
//|
Expand Down
Loading