Skip to content

Commit bb008cd

Browse files
mrmcwethytannewt
authored andcommitted
First attempt to move py/modmath.c to shared-bindings/math
1 parent 536bcb4 commit bb008cd

File tree

6 files changed

+457
-3
lines changed

6 files changed

+457
-3
lines changed

atmel-samd/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ SRC_BINDINGS_ENUMS = \
275275
digitalio/DriveMode.c \
276276
digitalio/Pull.c \
277277
help.c \
278+
math/__init__.c \
278279
util.c
279280

280281
SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \

atmel-samd/mpconfigport.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#define MICROPY_PY_ATTRTUPLE (1)
5252
#define MICROPY_PY_COLLECTIONS (1)
5353
#define MICROPY_PY_DESCRIPTORS (1)
54-
#define MICROPY_PY_MATH (1)
54+
#define MICROPY_PY_MATH (0)
5555
#define MICROPY_PY_CMATH (0)
5656
#define MICROPY_PY_IO (0)
5757
#define MICROPY_PY_URANDOM (0)
@@ -158,6 +158,7 @@ extern const struct _mp_obj_module_t digitalio_module;
158158
extern const struct _mp_obj_module_t pulseio_module;
159159
extern const struct _mp_obj_module_t busio_module;
160160
extern const struct _mp_obj_module_t board_module;
161+
extern const struct _mp_obj_module_t math_module;
161162
extern const struct _mp_obj_module_t os_module;
162163
extern const struct _mp_obj_module_t random_module;
163164
extern const struct _mp_obj_module_t storage_module;
@@ -225,6 +226,7 @@ extern const struct _mp_obj_module_t usb_hid_module;
225226
{ MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&os_module }, \
226227
{ MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, \
227228
{ MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&struct_module }, \
229+
{ MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&math_module }, \
228230
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module },
229231
EXTRA_BUILTIN_MODULES
230232

esp8266/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ SRC_BINDINGS_ENUMS = \
128128
digitalio/Direction.c \
129129
digitalio/DriveMode.c \
130130
digitalio/Pull.c \
131+
math/__init__.c \
131132
util.c
132133

133134
SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
@@ -144,7 +145,7 @@ SRC_SHARED_MODULE = \
144145
os/__init__.c \
145146
random/__init__.c \
146147
storage/__init__.c \
147-
struct/__init__.c
148+
struct/__init__.c
148149

149150
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
150151
$(addprefix shared-module/, $(SRC_SHARED_MODULE))

esp8266/mpconfigport.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
5252
#define MICROPY_PY_COLLECTIONS (1)
5353
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
54-
#define MICROPY_PY_MATH (1)
54+
#define MICROPY_PY_MATH (0)
5555
#define MICROPY_PY_CMATH (0)
5656
#define MICROPY_PY_IO (1)
5757
#define MICROPY_PY_IO_FILEIO (1)
@@ -165,6 +165,7 @@ extern const struct _mp_obj_module_t mp_module_machine;
165165
extern const struct _mp_obj_module_t mp_module_onewire;
166166
extern const struct _mp_obj_module_t microcontroller_module;
167167
extern const struct _mp_obj_module_t board_module;
168+
extern const struct _mp_obj_module_t math_module;
168169
extern const struct _mp_obj_module_t analogio_module;
169170
extern const struct _mp_obj_module_t digitalio_module;
170171
extern const struct _mp_obj_module_t pulseio_module;
@@ -191,6 +192,7 @@ extern const struct _mp_obj_module_t multiterminal_module;
191192
{ MP_OBJ_NEW_QSTR(MP_QSTR_storage), (mp_obj_t)&storage_module }, \
192193
{ MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, \
193194
{ MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&struct_module }, \
195+
{ MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&math_module }, \
194196
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \
195197
{ MP_OBJ_NEW_QSTR(MP_QSTR_multiterminal), (mp_obj_t)&multiterminal_module }, \
196198

shared-bindings/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Module / Port SAMD21 SAMD21 Express ESP8266
2222
`busio` **Yes** **Yes** **Yes**
2323
`digitalio` **Yes** **Yes** **Yes**
2424
`gamepad` No **Yes** No
25+
`math` **Yes** **Yes** **Yes**
2526
`microcontroller` **Yes** **Yes** **Yes**
2627
`multiterminal` No No **Yes**
2728
`neopixel_write` **Yes** **Yes** **Yes**

0 commit comments

Comments
 (0)