Skip to content

Commit 02e11a9

Browse files
committed
fix compilation issues; remove more uctypes mentions
1 parent 84cf30f commit 02e11a9

File tree

6 files changed

+12
-19
lines changed

6 files changed

+12
-19
lines changed

ports/unix/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
// CIRCUITPY-CHANGE
4242
#define CIRCUITPY_MICROPYTHON_ADVANCED (1)
4343
#define MICROPY_PY_ASYNC_AWAIT (1)
44+
#define MICROPY_PY_UCTYPES (0)
4445

4546
#ifndef MICROPY_CONFIG_ROM_LEVEL
4647
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES)

py/binary.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ size_t mp_binary_get_size(char struct_type, char val_type, size_t *palign) {
7979
size = sizeof(void *);
8080
break;
8181
#endif
82-
// CIRCUITPY-CHANGE: half-float can be turned off
83-
#if MICROPY_PY_BUILTINS_FLOAT && MICROPY_FLOAT_USE_NATIVE_FLT16
8482
case 'e':
8583
size = 2;
8684
break;
87-
#endif
8885
case 'f':
8986
// CIRCUITPY-CHANGE: compiler determines size
9087
size = sizeof(float);
@@ -140,13 +137,10 @@ size_t mp_binary_get_size(char struct_type, char val_type, size_t *palign) {
140137
size = sizeof(void *);
141138
break;
142139
#endif
143-
// CIRCUITPY-CHANGE: half-float can be turned off
144-
#if MICROPY_PY_BUILTINS_FLOAT && MICROPY_FLOAT_USE_NATIVE_FLT16
145140
case 'e':
146141
align = 2;
147142
size = 2;
148143
break;
149-
#endif
150144
case 'f':
151145
align = alignof(float);
152146
size = sizeof(float);
@@ -189,8 +183,6 @@ static inline uint16_t mp_encode_half_float(float x) {
189183

190184
#elif MICROPY_PY_BUILTINS_FLOAT
191185

192-
// CIRCUITPY-CHANGE: avoid warnings about unused functions
193-
#if defined(MICROPY_PY_FLOAT_USE_NATIVE_FLT16) && MICROPY_PY_FLOAT_USE_NATIVE_FLT16
194186
static float mp_decode_half_float(uint16_t hf) {
195187
union {
196188
uint32_t i;
@@ -261,7 +253,6 @@ static uint16_t mp_encode_half_float(float x) {
261253
uint16_t bits = ((fpu.i >> 16) & 0x8000) | (e << 10) | m;
262254
return bits;
263255
}
264-
#endif // defined(MICROPY_PY_FLOAT_USE_NATIVE_FLT16) && MICROPY_PY_FLOAT_USE_NATIVE_FLT16
265256

266257
#endif
267258

@@ -367,12 +358,9 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte *p_base, byte *
367358
const char *s_val = (const char *)(uintptr_t)(mp_uint_t)val;
368359
return mp_obj_new_str(s_val, strlen(s_val));
369360
#endif
370-
#if MICROPY_PY_BUILTINS_FLOAT
371-
// CIRCUITPY-CHANGE: half-float can be turned off
372-
#if MICROPY_PY_BUILTINS_FLOAT && MICROPY_FLOAT_USE_NATIVE_FLT16
361+
#if MICROPY_PY_BUILTINS_FLOAT
373362
} else if (val_type == 'e') {
374363
return mp_obj_new_float_from_f(mp_decode_half_float(val));
375-
#endif
376364
} else if (val_type == 'f') {
377365
union {
378366
uint32_t i;
@@ -385,7 +373,7 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte *p_base, byte *
385373
double f;
386374
} fpu = {val};
387375
return mp_obj_new_float_from_d(fpu.f);
388-
#endif
376+
#endif
389377
} else if (is_signed(val_type)) {
390378
if ((long long)MP_SMALL_INT_MIN <= val && val <= (long long)MP_SMALL_INT_MAX) {
391379
return mp_obj_new_int((mp_int_t)val);
@@ -445,12 +433,9 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte *p
445433
break;
446434
#endif
447435
#if MICROPY_PY_BUILTINS_FLOAT
448-
// CIRCUITPY-CHANGE: half-float can be turned off
449-
#if MICROPY_PY_BUILTINS_FLOAT && MICROPY_FLOAT_USE_NATIVE_FLT16
450436
case 'e':
451437
val = mp_encode_half_float(mp_obj_get_float_to_f(val_in));
452438
break;
453-
#endif
454439
case 'f': {
455440
union {
456441
uint32_t i;

py/circuitpy_mpconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ extern void common_hal_mcu_enable_interrupts(void);
143143
#define MICROPY_PY_SYS (CIRCUITPY_SYS)
144144
#define MICROPY_PY_SYS_MAXSIZE (1)
145145
#define MICROPY_PY_SYS_STDFILES (1)
146+
#define MICROPY_PY_UCTYPES (0)
146147
#define MICROPY_PY___FILE__ (1)
147148

148149
#define MICROPY_QSTR_BYTES_IN_HASH (1)

py/nativeglue.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ typedef struct _mp_fun_table_t {
160160
const mp_stream_p_t *(*get_stream_raise)(mp_obj_t self_in, int flags);
161161
// CIRCUITPY-CHANGE
162162
void (*assert_native_inited)(mp_obj_t native_object);
163+
void (*arg_parse_all)(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals);
164+
void (*arg_parse_all_kw_array)(size_t n_pos, size_t n_kw, const mp_obj_t *args, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals);
165+
size_t (*binary_get_size)(char struct_type, char val_type, size_t *palign);
166+
mp_obj_t (*binary_get_val_array)(char typecode, void *p, size_t index);
167+
void (*binary_set_val_array)(char typecode, void *p, size_t index, mp_obj_t val_in);
163168
const mp_print_t *plat_print;
164169
// The following entries start at index 73 and are referenced by tools-mpy_ld.py,
165170
// see constant MP_FUN_TABLE_MP_TYPE_TYPE_OFFSET.

shared-bindings/socketpool/SocketPool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
static mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
3737
mp_arg_check_num(n_args, n_kw, 1, 1, false);
3838

39-
socketpool_socketpool_obj_t *s = mp_obj_malloc_with_finaliser(socketpool_socketpool_obj_t, &socketpool_socketpool_type)
40-
mp_obj_t radio = args[0];
39+
socketpool_socketpool_obj_t *s = mp_obj_malloc_with_finaliser(socketpool_socketpool_obj_t, &socketpool_socketpool_type);
40+
mp_obj_t radio = args[0];
4141

4242
common_hal_socketpool_socketpool_construct(s, radio);
4343

tests/run-tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import platform
77
import argparse
88
import inspect
9+
import json
910
import re
1011
from glob import glob
1112
import multiprocessing

0 commit comments

Comments
 (0)