Fix board builds and use MP_ERROR_TEXT in py and extmod
This commit is contained in:
parent
7f2f8e2d58
commit
3fda0c0a1b
|
@ -13,7 +13,7 @@
|
|||
static void check_not_unicode(const mp_obj_t arg) {
|
||||
#if MICROPY_CPYTHON_COMPAT
|
||||
if (mp_obj_is_str(arg)) {
|
||||
mp_raise_TypeError(translate("a bytes-like object is required"));
|
||||
mp_raise_TypeError(MP_ERROR_TEXT("a bytes-like object is required"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ STATIC mp_obj_t uhashlib_sha256_digest(mp_obj_t self_in) {
|
|||
static void check_not_unicode(const mp_obj_t arg) {
|
||||
#if MICROPY_CPYTHON_COMPAT
|
||||
if (mp_obj_is_str(arg)) {
|
||||
mp_raise_TypeError(translate("a bytes-like object is required"));
|
||||
mp_raise_TypeError(MP_ERROR_TEXT("a bytes-like object is required"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -430,7 +430,7 @@ STATIC mp_obj_t vfs_fat_setlabel(mp_obj_t self_in, mp_obj_t label_in) {
|
|||
FRESULT res = f_setlabel(&self->fatfs, label_str);
|
||||
if (res != FR_OK) {
|
||||
if (res == FR_WRITE_PROTECTED) {
|
||||
mp_raise_msg(&mp_type_OSError, translate("Read-only filesystem"));
|
||||
mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Read-only filesystem"));
|
||||
}
|
||||
mp_raise_OSError(fresult_to_errno_table[res]);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "extmod/vfs_posix.h"
|
||||
#include "supervisor/shared/translate.h"
|
||||
|
||||
#if defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX || MICROPY_VFS_POSIX_FILE
|
||||
#if (defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX) || (defined(MICROPY_VFS_POSIX_FILE) && MICROPY_VFS_POSIX_FILE)
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -35,15 +35,6 @@ void mp_hal_set_interrupt_char(int c) {
|
|||
mp_interrupt_char = c;
|
||||
}
|
||||
|
||||
void mp_keyboard_interrupt(void) {
|
||||
MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
|
||||
#if MICROPY_ENABLE_SCHEDULER
|
||||
if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) {
|
||||
MP_STATE_VM(sched_state) = MP_SCHED_PENDING;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Check to see if we've been CTRL-C'ed by autoreload or the user.
|
||||
bool mp_hal_is_interrupted(void) {
|
||||
return MP_STATE_VM(mp_pending_exception) != NULL;
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
extern int mp_interrupt_char;
|
||||
void mp_hal_set_interrupt_char(int c);
|
||||
void mp_keyboard_interrupt(void);
|
||||
bool mp_hal_is_interrupted(void);
|
||||
|
||||
#endif // MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H
|
||||
|
|
|
@ -56,8 +56,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_enabled_obj, samd_clock_get_enabled);
|
|||
const mp_obj_property_t samd_clock_enabled_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&samd_clock_get_enabled_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE,},
|
||||
};
|
||||
|
||||
//| parent: Union[Clock, None]
|
||||
|
@ -85,8 +85,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_parent_obj, samd_clock_get_parent);
|
|||
const mp_obj_property_t samd_clock_parent_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&samd_clock_get_parent_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE,},
|
||||
};
|
||||
|
||||
//| frequency: int
|
||||
|
@ -102,8 +102,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_frequency_obj, samd_clock_get_frequency
|
|||
const mp_obj_property_t samd_clock_frequency_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&samd_clock_get_frequency_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE,},
|
||||
};
|
||||
|
||||
//| calibration: int
|
||||
|
@ -134,7 +134,7 @@ const mp_obj_property_t samd_clock_calibration_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&samd_clock_get_calibration_obj,
|
||||
(mp_obj_t)&samd_clock_set_calibration_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,},
|
||||
MP_ROM_NONE,},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t samd_clock_locals_dict_table[] = {
|
||||
|
|
|
@ -532,7 +532,7 @@ const mp_obj_property_t rp2pio_statemachine_frequency_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rp2pio_statemachine_get_frequency_obj,
|
||||
(mp_obj_t)&rp2pio_statemachine_set_frequency_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| rxstall: bool
|
||||
|
@ -550,8 +550,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_rxstall_obj, rp2pio_statemachi
|
|||
const mp_obj_property_t rp2pio_statemachine_rxstall_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rp2pio_statemachine_get_rxstall_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| in_waiting: int
|
||||
|
@ -568,8 +568,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_in_waiting_obj, rp2pio_statema
|
|||
const mp_obj_property_t rp2pio_statemachine_in_waiting_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rp2pio_statemachine_get_in_waiting_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = {
|
||||
|
|
|
@ -2,7 +2,6 @@ PROG ?= micropython-dev
|
|||
|
||||
FROZEN_MANIFEST ?= $(VARIANT_DIR)/manifest.py
|
||||
|
||||
MICROPY_ROM_TEXT_COMPRESSION = 1
|
||||
MICROPY_VFS_FAT = 1
|
||||
MICROPY_VFS_LFS1 = 1
|
||||
MICROPY_VFS_LFS2 = 1
|
||||
|
|
|
@ -3,7 +3,6 @@ PROG = micropython-minimal
|
|||
|
||||
FROZEN_MANIFEST =
|
||||
|
||||
MICROPY_ROM_TEXT_COMPRESSION = 1
|
||||
MICROPY_PY_BTREE = 0
|
||||
MICROPY_PY_FFI = 0
|
||||
MICROPY_PY_SOCKET = 0
|
||||
|
|
4
py/bc.c
4
py/bc.c
|
@ -204,9 +204,9 @@ void mp_setup_code_state(mp_code_state_t *code_state, size_t n_args, size_t n_kw
|
|||
mp_obj_t wanted_arg_name = kwargs[2 * i];
|
||||
if (MP_UNLIKELY(!mp_obj_is_qstr(wanted_arg_name))) {
|
||||
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
|
||||
mp_raise_TypeError(translate("unexpected keyword argument"));
|
||||
mp_raise_TypeError(MP_ERROR_TEXT("unexpected keyword argument"));
|
||||
#else
|
||||
mp_raise_TypeError(translate("keywords must be strings"));
|
||||
mp_raise_TypeError(MP_ERROR_TEXT("keywords must be strings"));
|
||||
#endif
|
||||
}
|
||||
for (size_t j = 0; j < n_pos_args + n_kwonly_args; j++) {
|
||||
|
|
|
@ -422,10 +422,10 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {
|
|||
} else {
|
||||
// couldn't find the file, so fail
|
||||
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
|
||||
mp_raise_ImportError(translate("module not found"));
|
||||
mp_raise_ImportError(MP_ERROR_TEXT("module not found"));
|
||||
#else
|
||||
mp_raise_msg_varg(&mp_type_ImportError,
|
||||
translate("no module named '%q'"), mod_name);
|
||||
MP_ERROR_TEXT("no module named '%q'"), mod_name);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1801,7 +1801,7 @@ STATIC bool compile_require_async_context(compiler_t *comp, mp_parse_node_struct
|
|||
return true;
|
||||
}
|
||||
compile_syntax_error(comp, (mp_parse_node_t)pns,
|
||||
translate("'await', 'async for' or 'async with' outside async function"));
|
||||
MP_ERROR_TEXT("'await', 'async for' or 'async with' outside async function"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ mp_obj_t cp_enum_find(const mp_obj_type_t *type, int value) {
|
|||
|
||||
int cp_enum_value(const mp_obj_type_t *type, mp_obj_t *obj) {
|
||||
if (!mp_obj_is_type(obj, type)) {
|
||||
mp_raise_TypeError_varg(translate("Expected a %q"), type->name);
|
||||
mp_raise_TypeError_varg(MP_ERROR_TEXT("Expected a %q"), type->name);
|
||||
}
|
||||
return ((cp_enum_obj_t *)MP_OBJ_TO_PTR(obj))->value;
|
||||
}
|
||||
|
|
46
py/misc.h
46
py/misc.h
|
@ -275,50 +275,4 @@ typedef union _mp_float_union_t {
|
|||
|
||||
#endif // MICROPY_PY_BUILTINS_FLOAT
|
||||
|
||||
/** ROM string compression *************/
|
||||
|
||||
#if MICROPY_ROM_TEXT_COMPRESSION
|
||||
|
||||
#ifdef NO_QSTR
|
||||
|
||||
// Compression enabled but doing QSTR extraction.
|
||||
// So leave MP_COMPRESSED_ROM_TEXT in place for makeqstrdefs.py / makecompresseddata.py to find them.
|
||||
|
||||
#else
|
||||
|
||||
// Compression enabled and doing a regular build.
|
||||
// Map MP_COMPRESSED_ROM_TEXT to the compressed strings.
|
||||
|
||||
// Force usage of the MP_ERROR_TEXT macro by requiring an opaque type.
|
||||
typedef struct {} *mp_rom_error_text_t;
|
||||
|
||||
#include <string.h>
|
||||
|
||||
inline __attribute__((always_inline)) const char *MP_COMPRESSED_ROM_TEXT(const char *msg) {
|
||||
// "genhdr/compressed.data.h" contains an invocation of the MP_MATCH_COMPRESSED macro for each compressed string.
|
||||
// The giant if(strcmp) tree is optimized by the compiler, which turns this into a direct return of the compressed data.
|
||||
#define MP_MATCH_COMPRESSED(a, b) if (strcmp(msg, a) == 0) { return b; } else
|
||||
|
||||
// It also contains a single invocation of the MP_COMPRESSED_DATA macro, we don't need that here.
|
||||
#define MP_COMPRESSED_DATA(x)
|
||||
|
||||
#include "genhdr/compressed.data.h"
|
||||
|
||||
#undef MP_COMPRESSED_DATA
|
||||
#undef MP_MATCH_COMPRESSED
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
// Compression not enabled, just make it a no-op.
|
||||
|
||||
typedef const char *mp_rom_error_text_t;
|
||||
#define MP_COMPRESSED_ROM_TEXT(x) x
|
||||
|
||||
#endif // MICROPY_ROM_TEXT_COMPRESSION
|
||||
|
||||
#endif // MICROPY_INCLUDED_PY_MISC_H
|
||||
|
|
|
@ -190,7 +190,7 @@ STATIC void struct_pack_into_internal(mp_obj_t fmt_in, byte *p, size_t n_args, c
|
|||
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
|
||||
mp_raise_ValueError(NULL);
|
||||
#else
|
||||
mp_raise_ValueError_varg(translate("pack expected %d items for packing (got %d)"), count, n_args);
|
||||
mp_raise_ValueError_varg(MP_ERROR_TEXT("pack expected %d items for packing (got %d)"), count, n_args);
|
||||
#endif
|
||||
}
|
||||
const char *fmt = mp_obj_str_get_str(fmt_in);
|
||||
|
|
|
@ -145,7 +145,7 @@ typedef struct _mp_fun_table_t {
|
|||
#if defined(__GNUC__)
|
||||
NORETURN // Only certain compilers support no-return attributes in function pointer declarations
|
||||
#endif
|
||||
void (*raise_msg)(const mp_obj_type_t *exc_type, mp_rom_error_text_t msg);
|
||||
void (*raise_msg_str)(const mp_obj_type_t *exc_type, const char *msg);
|
||||
const mp_obj_type_t *(*obj_get_type)(mp_const_obj_t o_in);
|
||||
mp_obj_t (*obj_new_str)(const char *data, size_t len);
|
||||
mp_obj_t (*obj_new_bytes)(const byte *data, size_t len);
|
||||
|
|
8
py/obj.c
8
py/obj.c
|
@ -144,17 +144,17 @@ void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc) {
|
|||
if (n > 0) {
|
||||
assert(n % 3 == 0);
|
||||
// Decompress the format strings
|
||||
const compressed_string_t *traceback = translate("Traceback (most recent call last):\n");
|
||||
const compressed_string_t *traceback = MP_ERROR_TEXT("Traceback (most recent call last):\n");
|
||||
char decompressed[decompress_length(traceback)];
|
||||
decompress(traceback, decompressed);
|
||||
#if MICROPY_ENABLE_SOURCE_LINE
|
||||
const compressed_string_t *frame = translate(" File \"%q\", line %d");
|
||||
const compressed_string_t *frame = MP_ERROR_TEXT(" File \"%q\", line %d");
|
||||
#else
|
||||
const compressed_string_t *frame = translate(" File \"%q\"");
|
||||
const compressed_string_t *frame = MP_ERROR_TEXT(" File \"%q\"");
|
||||
#endif
|
||||
char decompressed_frame[decompress_length(frame)];
|
||||
decompress(frame, decompressed_frame);
|
||||
const compressed_string_t *block_fmt = translate(", in %q\n");
|
||||
const compressed_string_t *block_fmt = MP_ERROR_TEXT(", in %q\n");
|
||||
char decompressed_block[decompress_length(block_fmt)];
|
||||
decompress(block_fmt, decompressed_block);
|
||||
|
||||
|
|
4
py/obj.h
4
py/obj.h
|
@ -358,8 +358,8 @@ typedef struct _mp_rom_obj_t { mp_const_obj_t o; } mp_rom_obj_t;
|
|||
const mp_obj_property_t obj_name = { \
|
||||
.base.type = &mp_type_property, \
|
||||
.proxy = {(mp_obj_t)&fun_name##_obj, \
|
||||
(mp_obj_t)&mp_const_none_obj, \
|
||||
(mp_obj_t)&mp_const_none_obj}, }
|
||||
MP_ROM_NONE, \
|
||||
MP_ROM_NONE}, }
|
||||
|
||||
// These macros are used to define constant or mutable map/dict objects
|
||||
// You can put "static" in front of the definition to make it local
|
||||
|
|
|
@ -101,7 +101,7 @@ STATIC void array_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t
|
|||
#if MICROPY_PY_BUILTINS_BYTEARRAY || MICROPY_PY_ARRAY
|
||||
STATIC mp_obj_array_t *array_new(char typecode, size_t n) {
|
||||
if (typecode == 'x') {
|
||||
mp_raise_ValueError(translate("bad typecode"));
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("bad typecode"));
|
||||
}
|
||||
int typecode_size = mp_binary_get_size('@', typecode, NULL);
|
||||
mp_obj_array_t *o = m_new_obj(mp_obj_array_t);
|
||||
|
@ -134,7 +134,7 @@ STATIC mp_obj_t array_construct(char typecode, mp_obj_t initializer) {
|
|||
// construct array from raw bytes
|
||||
size_t sz = mp_binary_get_size('@', typecode, NULL);
|
||||
if (bufinfo.len % sz) {
|
||||
mp_raise_ValueError(translate("bytes length not a multiple of item size"));
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("bytes length not a multiple of item size"));
|
||||
}
|
||||
size_t len = bufinfo.len / sz;
|
||||
mp_obj_array_t *o = array_new(typecode, len);
|
||||
|
@ -249,7 +249,7 @@ STATIC mp_obj_t memoryview_cast(const mp_obj_t self_in, const mp_obj_t typecode_
|
|||
size_t element_size = mp_binary_get_size('@', typecode[0], NULL);
|
||||
size_t bytelen = self->len * mp_binary_get_size('@', self->typecode & ~MP_OBJ_ARRAY_TYPECODE_FLAG_RW, NULL);
|
||||
if (bytelen % element_size != 0) {
|
||||
mp_raise_TypeError(translate("memoryview: length is not a multiple of itemsize"));
|
||||
mp_raise_TypeError(MP_ERROR_TEXT("memoryview: length is not a multiple of itemsize"));
|
||||
}
|
||||
mp_obj_array_t *result = MP_OBJ_TO_PTR(mp_obj_new_memoryview(*typecode, bytelen / element_size, self->items));
|
||||
|
||||
|
@ -458,7 +458,7 @@ STATIC mp_obj_t buffer_finder(size_t n_args, const mp_obj_t *args, int direction
|
|||
mp_get_buffer_raise(args[1], &needle_bufinfo, MP_BUFFER_READ);
|
||||
|
||||
if (mp_binary_get_size('@', needle_bufinfo.typecode, NULL) != 1) {
|
||||
mp_raise_TypeError(translate("a bytes-like object is required"));
|
||||
mp_raise_TypeError(MP_ERROR_TEXT("a bytes-like object is required"));
|
||||
}
|
||||
|
||||
const byte *start = haystack_bufinfo.buf;
|
||||
|
@ -477,7 +477,7 @@ STATIC mp_obj_t buffer_finder(size_t n_args, const mp_obj_t *args, int direction
|
|||
|
||||
if (p == NULL) {
|
||||
if (is_index) {
|
||||
mp_raise_ValueError(translate("substring not found"));
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("substring not found"));
|
||||
} else {
|
||||
return MP_OBJ_NEW_SMALL_INT(-1);
|
||||
}
|
||||
|
|
|
@ -465,11 +465,7 @@ mp_obj_t mp_obj_new_exception_msg_vlist(const mp_obj_type_t *exc_type, const com
|
|||
|
||||
// Create the string object and call mp_obj_exception_make_new to create the exception
|
||||
o_str->base.type = &mp_type_str;
|
||||
#if MICROPY_ROM_TEXT_COMPRESSION
|
||||
o_str->hash = 0; // will be computed only if string object is accessed
|
||||
#else
|
||||
o_str->hash = qstr_compute_hash(o_str->data, o_str->len);
|
||||
#endif
|
||||
mp_obj_t arg = MP_OBJ_FROM_PTR(o_str);
|
||||
return mp_obj_exception_make_new(exc_type, 1, &arg, NULL);
|
||||
}
|
||||
|
|
|
@ -326,8 +326,7 @@ STATIC mp_obj_t gen_instance_await(mp_obj_t self_in) {
|
|||
if (!self->coroutine_generator) {
|
||||
// Pretend like a generator does not have this coroutine behavior.
|
||||
// Pay no attention to the dir() behind the curtain
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError,
|
||||
translate("type object 'generator' has no attribute '__await__'")));
|
||||
mp_raise_AttributeError(MP_ERROR_TEXT("type object 'generator' has no attribute '__await__'"));
|
||||
}
|
||||
// You can directly call send on a coroutine generator or you can __await__ then send on the return of that.
|
||||
return self;
|
||||
|
|
|
@ -142,9 +142,9 @@ mp_obj_t mp_obj_new_int_from_float(mp_float_t val) {
|
|||
if (u.p.exp == ((1 << MP_FLOAT_EXP_BITS) - 1)) {
|
||||
// ...then number is Inf (positive or negative) if fraction is 0, else NaN.
|
||||
if (u.p.frc == 0) {
|
||||
mp_raise_OverflowError_varg(translate("can't convert %q to %q"), MP_QSTR_inf, MP_QSTR_int);
|
||||
mp_raise_OverflowError_varg(MP_ERROR_TEXT("can't convert %q to %q"), MP_QSTR_inf, MP_QSTR_int);
|
||||
} else {
|
||||
mp_raise_ValueError_varg(translate("can't convert %q to %q"), MP_QSTR_NaN, MP_QSTR_int);
|
||||
mp_raise_ValueError_varg(MP_ERROR_TEXT("can't convert %q to %q"), MP_QSTR_NaN, MP_QSTR_int);
|
||||
}
|
||||
} else {
|
||||
mp_fp_as_int_class_t icl = mp_classify_fp_as_int(val);
|
||||
|
@ -332,7 +332,7 @@ void mp_obj_int_buffer_overflow_check(mp_obj_t self_in, size_t nbytes, bool is_s
|
|||
}
|
||||
}
|
||||
|
||||
mp_raise_OverflowError_varg(translate("value must fit in %d byte(s)"), nbytes);
|
||||
mp_raise_OverflowError_varg(MP_ERROR_TEXT("value must fit in %d byte(s)"), nbytes);
|
||||
}
|
||||
|
||||
#endif // MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE
|
||||
|
@ -368,7 +368,7 @@ void mp_small_int_buffer_overflow_check(mp_int_t val, size_t nbytes, bool is_sig
|
|||
// Fall through to failure.
|
||||
}
|
||||
|
||||
mp_raise_OverflowError_varg(translate("value must fit in %d byte(s)"), nbytes);
|
||||
mp_raise_OverflowError_varg(MP_ERROR_TEXT("value must fit in %d byte(s)"), nbytes);
|
||||
}
|
||||
|
||||
#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_NONE
|
||||
|
|
|
@ -364,7 +364,7 @@ mp_obj_t mp_obj_int_pow3(mp_obj_t base, mp_obj_t exponent, mp_obj_t modulus) {
|
|||
mpz_t *mod = mp_mpz_for_int(modulus, &m_temp);
|
||||
|
||||
if (mpz_is_zero(mod)) {
|
||||
mp_raise_msg(&mp_type_ValueError, translate("pow() 3rd argument cannot be 0"));
|
||||
mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("pow() 3rd argument cannot be 0"));
|
||||
}
|
||||
|
||||
mpz_pow3_inpl(&(res_p->mpz), lhs, rhs, mod);
|
||||
|
|
|
@ -92,7 +92,7 @@ STATIC void slice_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
|
|||
STATIC mp_obj_t slice_make_new(const mp_obj_type_t *type,
|
||||
size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
|
||||
if (type != &mp_type_slice) {
|
||||
mp_raise_NotImplementedError(translate("Cannot subclass slice"));
|
||||
mp_raise_NotImplementedError(MP_ERROR_TEXT("Cannot subclass slice"));
|
||||
}
|
||||
// check number of arguments
|
||||
mp_arg_check_num(n_args, kw_args, 1, 3, false);
|
||||
|
@ -126,7 +126,7 @@ const mp_obj_type_t mp_type_slice = {
|
|||
{ &mp_type_type },
|
||||
.name = MP_QSTR_slice,
|
||||
.print = slice_print,
|
||||
#if MICROPY_PY_BUILTINS_SLICE_INDICES
|
||||
#if MICROPY_PY_BUILTINS_SLICE_INDICES || MICROPY_PY_BUILTINS_SLICE_ATTRS
|
||||
.make_new = slice_make_new,
|
||||
#endif
|
||||
#if MICROPY_PY_BUILTINS_SLICE_ATTRS
|
||||
|
|
|
@ -431,7 +431,7 @@ mp_obj_t mp_obj_str_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i
|
|||
size_t str_offset_to_index(const mp_obj_type_t *type, const byte *self_data, size_t self_len,
|
||||
size_t offset) {
|
||||
if (offset > self_len) {
|
||||
mp_raise_ValueError(translate("offset out of bounds"));
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("offset out of bounds"));
|
||||
}
|
||||
|
||||
return offset;
|
||||
|
|
|
@ -115,7 +115,7 @@ STATIC mp_obj_t uni_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
|||
size_t str_offset_to_index(const mp_obj_type_t *type, const byte *self_data, size_t self_len,
|
||||
size_t offset) {
|
||||
if (offset > self_len) {
|
||||
mp_raise_ValueError(translate("offset out of bounds"));
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("offset out of bounds"));
|
||||
}
|
||||
|
||||
if (type == &mp_type_bytes) {
|
||||
|
|
|
@ -121,7 +121,7 @@ mp_obj_instance_t *mp_obj_new_instance(const mp_obj_type_t *class, const mp_obj_
|
|||
// valid.
|
||||
void mp_obj_assert_native_inited(mp_obj_t native_object) {
|
||||
if (native_object == MP_OBJ_FROM_PTR(&native_base_init_wrapper_obj)) {
|
||||
mp_raise_NotImplementedError(translate("Call super().__init__() before accessing native object."));
|
||||
mp_raise_NotImplementedError(MP_ERROR_TEXT("Call super().__init__() before accessing native object."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1358,7 +1358,7 @@ STATIC void super_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
|
|||
if (mp_obj_is_type(member, &mp_type_property)) {
|
||||
const mp_obj_t *proxy = mp_obj_property_get(member);
|
||||
if (proxy[0] == mp_const_none) {
|
||||
mp_raise_AttributeError(translate("unreadable attribute"));
|
||||
mp_raise_AttributeError(MP_ERROR_TEXT("unreadable attribute"));
|
||||
} else {
|
||||
dest[0] = mp_call_function_n_kw(proxy[0], 1, 0, &self_in);
|
||||
}
|
||||
|
|
|
@ -869,7 +869,7 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) {
|
|||
}
|
||||
}
|
||||
if (parser.rule_stack == NULL || parser.result_stack == NULL) {
|
||||
mp_raise_msg(&mp_type_MemoryError, translate("Unable to init parser"));
|
||||
mp_raise_msg(&mp_type_MemoryError, MP_ERROR_TEXT("Unable to init parser"));
|
||||
}
|
||||
|
||||
parser.lexer = lex;
|
||||
|
|
|
@ -150,7 +150,7 @@ STATIC byte *extract_prelude(const byte **ip, bytecode_prelude_t *prelude) {
|
|||
#include "py/parsenum.h"
|
||||
|
||||
STATIC void raise_corrupt_mpy(void) {
|
||||
mp_raise_RuntimeError(translate("Corrupt .mpy file"));
|
||||
mp_raise_RuntimeError(MP_ERROR_TEXT("Corrupt .mpy file"));
|
||||
}
|
||||
|
||||
STATIC int read_byte(mp_reader_t *reader);
|
||||
|
|
|
@ -47,6 +47,6 @@ const void *mp_proto_get_or_throw(uint16_t name, mp_const_obj_t obj) {
|
|||
if (proto) {
|
||||
return proto;
|
||||
}
|
||||
mp_raise_TypeError_varg(translate("'%q' object does not support '%q'"),
|
||||
mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object does not support '%q'"),
|
||||
mp_obj_get_type_qstr(obj), name);
|
||||
}
|
||||
|
|
75
py/qstr.c
75
py/qstr.c
|
@ -318,78 +318,3 @@ void qstr_dump_data(void) {
|
|||
QSTR_EXIT();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MICROPY_ROM_TEXT_COMPRESSION
|
||||
|
||||
#ifdef NO_QSTR
|
||||
|
||||
// If NO_QSTR is set, it means we're doing QSTR extraction.
|
||||
// So we won't yet have "genhdr/compressed.data.h"
|
||||
|
||||
#else
|
||||
|
||||
// Emit the compressed_string_data string.
|
||||
#define MP_COMPRESSED_DATA(x) STATIC const char *compressed_string_data = x;
|
||||
#define MP_MATCH_COMPRESSED(a, b)
|
||||
#include "genhdr/compressed.data.h"
|
||||
#undef MP_COMPRESSED_DATA
|
||||
#undef MP_MATCH_COMPRESSED
|
||||
|
||||
#endif // NO_QSTR
|
||||
|
||||
// This implements the "common word" compression scheme (see makecompresseddata.py) where the most
|
||||
// common 128 words in error messages are replaced by their index into the list of common words.
|
||||
|
||||
// The compressed string data is delimited by setting high bit in the final char of each word.
|
||||
// e.g. aaaa<0x80|a>bbbbbb<0x80|b>....
|
||||
// This method finds the n'th string.
|
||||
STATIC const byte *find_uncompressed_string(uint8_t n) {
|
||||
const byte *c = (byte *)compressed_string_data;
|
||||
while (n > 0) {
|
||||
while ((*c & 0x80) == 0) {
|
||||
++c;
|
||||
}
|
||||
++c;
|
||||
--n;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
// Given a compressed string in src, decompresses it into dst.
|
||||
// dst must be large enough (use MP_MAX_UNCOMPRESSED_TEXT_LEN+1).
|
||||
void mp_decompress_rom_string(byte *dst, const mp_rom_error_text_t src_chr) {
|
||||
// Skip past the 0xff marker.
|
||||
const byte *src = (byte *)src_chr + 1;
|
||||
// Need to add spaces around compressed words, except for the first (i.e. transition from 1<->2).
|
||||
// 0 = start, 1 = compressed, 2 = regular.
|
||||
int state = 0;
|
||||
while (*src) {
|
||||
if ((byte) * src >= 128) {
|
||||
if (state != 0) {
|
||||
*dst++ = ' ';
|
||||
}
|
||||
state = 1;
|
||||
|
||||
// High bit set, replace with common word.
|
||||
const byte *word = find_uncompressed_string(*src & 0x7f);
|
||||
// The word is terminated by the final char having its high bit set.
|
||||
while ((*word & 0x80) == 0) {
|
||||
*dst++ = *word++;
|
||||
}
|
||||
*dst++ = (*word & 0x7f);
|
||||
} else {
|
||||
// Otherwise just copy one char.
|
||||
if (state == 1) {
|
||||
*dst++ = ' ';
|
||||
}
|
||||
state = 2;
|
||||
|
||||
*dst++ = *src;
|
||||
}
|
||||
++src;
|
||||
}
|
||||
// Add null-terminator.
|
||||
*dst = 0;
|
||||
}
|
||||
|
||||
#endif // MICROPY_ROM_TEXT_COMPRESSION
|
||||
|
|
|
@ -92,9 +92,4 @@ const byte *qstr_data(qstr q, size_t *len);
|
|||
void qstr_pool_info(size_t *n_pool, size_t *n_qstr, size_t *n_str_data_bytes, size_t *n_total_bytes);
|
||||
void qstr_dump_data(void);
|
||||
|
||||
#if MICROPY_ROM_TEXT_COMPRESSION
|
||||
void mp_decompress_rom_string(byte *dst, mp_rom_error_text_t src);
|
||||
#define MP_IS_COMPRESSED_ROM_STRING(s) (*(byte *)(s) == 0xff)
|
||||
#endif
|
||||
|
||||
#endif // MICROPY_INCLUDED_PY_QSTR_H
|
||||
|
|
12
py/runtime.c
12
py/runtime.c
|
@ -1074,7 +1074,7 @@ void mp_convert_member_lookup(mp_obj_t self, const mp_obj_type_t *type, mp_obj_t
|
|||
// the code.
|
||||
const mp_obj_t *proxy = mp_obj_property_get(member);
|
||||
if (proxy[0] == mp_const_none) {
|
||||
mp_raise_AttributeError(translate("unreadable attribute"));
|
||||
mp_raise_AttributeError(MP_ERROR_TEXT("unreadable attribute"));
|
||||
} else {
|
||||
dest[0] = mp_call_function_n_kw(proxy[0], 1, 0, &self);
|
||||
}
|
||||
|
@ -1137,7 +1137,7 @@ void mp_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest) {
|
|||
if (dest[0] == MP_OBJ_NULL) {
|
||||
// no attribute/method called attr
|
||||
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
|
||||
mp_raise_msg(&mp_type_AttributeError, MP_ERROR_TEXT("no such attribute"));
|
||||
mp_raise_AttributeError(MP_ERROR_TEXT("no such attribute"));
|
||||
#else
|
||||
// following CPython, we give a more detailed error message for type objects
|
||||
if (mp_obj_is_type(base, &mp_type_type)) {
|
||||
|
@ -1211,7 +1211,7 @@ void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) {
|
|||
#endif
|
||||
}
|
||||
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
|
||||
mp_raise_msg(&mp_type_AttributeError, MP_ERROR_TEXT("no such attribute"));
|
||||
mp_raise_AttributeError(MP_ERROR_TEXT("no such attribute"));
|
||||
#else
|
||||
mp_raise_msg_varg(&mp_type_AttributeError,
|
||||
MP_ERROR_TEXT("'%s' object has no attribute '%q'"),
|
||||
|
@ -1462,7 +1462,7 @@ mp_obj_t mp_import_from(mp_obj_t module, qstr name) {
|
|||
|
||||
// See if it's a package, then can try FS import
|
||||
if (!mp_obj_is_package(module)) {
|
||||
mp_raise_msg_varg(&mp_type_ImportError, translate("cannot import name %q"), name);
|
||||
mp_raise_msg_varg(&mp_type_ImportError, MP_ERROR_TEXT("cannot import name %q"), name);
|
||||
}
|
||||
|
||||
mp_load_method_maybe(module, MP_QSTR___name__, dest);
|
||||
|
@ -1483,7 +1483,7 @@ mp_obj_t mp_import_from(mp_obj_t module, qstr name) {
|
|||
#else
|
||||
|
||||
// Package import not supported with external imports disabled
|
||||
mp_raise_msg_varg(&mp_type_ImportError, translate("cannot import name %q"), name);
|
||||
mp_raise_msg_varg(&mp_type_ImportError, MP_ERROR_TEXT("cannot import name %q"), name);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
@ -1691,6 +1691,6 @@ NORETURN void mp_raise_MpyError(const compressed_string_t *msg) {
|
|||
|
||||
#if MICROPY_STACK_CHECK || MICROPY_ENABLE_PYSTACK
|
||||
NORETURN void mp_raise_recursion_depth(void) {
|
||||
mp_raise_RuntimeError(translate("maximum recursion depth exceeded"));
|
||||
mp_raise_RuntimeError(MP_ERROR_TEXT("maximum recursion depth exceeded"));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
size_t mp_seq_multiply_len(size_t item_sz, size_t len) {
|
||||
size_t new_len;
|
||||
if (__builtin_mul_overflow(item_sz, len, &new_len)) {
|
||||
mp_raise_msg(&mp_type_OverflowError, translate("small int overflow"));
|
||||
mp_raise_msg(&mp_type_OverflowError, MP_ERROR_TEXT("small int overflow"));
|
||||
}
|
||||
return new_len;
|
||||
}
|
||||
|
|
11
py/stream.c
11
py/stream.c
|
@ -85,6 +85,10 @@ mp_uint_t mp_stream_rw(mp_obj_t stream, void *buf_, mp_uint_t size, int *errcode
|
|||
return done;
|
||||
}
|
||||
|
||||
const mp_stream_p_t *mp_get_stream(mp_const_obj_t self) {
|
||||
return mp_proto_get(MP_QSTR_protocol_stream, self);
|
||||
}
|
||||
|
||||
const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags) {
|
||||
const mp_stream_p_t *stream_p = mp_proto_get(MP_QSTR_protocol_stream, self_in);
|
||||
if (stream_p == NULL
|
||||
|
@ -258,7 +262,7 @@ STATIC mp_obj_t stream_write_method(size_t n_args, const mp_obj_t *args) {
|
|||
mp_buffer_info_t bufinfo;
|
||||
mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_READ);
|
||||
if (!mp_get_stream(args[0])->is_text && mp_obj_is_str(args[1])) {
|
||||
mp_raise_ValueError(translate("string not supported; use bytes or bytearray"));
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("string not supported; use bytes or bytearray"));
|
||||
}
|
||||
size_t max_len = (size_t)-1;
|
||||
size_t off = 0;
|
||||
|
@ -293,7 +297,7 @@ STATIC mp_obj_t stream_readinto(size_t n_args, const mp_obj_t *args) {
|
|||
mp_uint_t len = bufinfo.len;
|
||||
if (n_args > 2) {
|
||||
if (mp_get_stream(args[0])->pyserial_readinto_compatibility) {
|
||||
mp_raise_ValueError(translate("length argument not allowed for this type"));
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("length argument not allowed for this type"));
|
||||
}
|
||||
len = mp_obj_get_int(args[2]);
|
||||
if (len > bufinfo.len) {
|
||||
|
@ -576,7 +580,4 @@ int mp_stream_posix_fsync(mp_obj_t stream) {
|
|||
return res;
|
||||
}
|
||||
|
||||
const mp_stream_p_t *mp_get_stream(mp_const_obj_t self) {
|
||||
return mp_proto_get(MP_QSTR_protocol_stream, self);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
// *FORMAT-OFF*
|
||||
|
||||
#if __clang__
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Winitializer-overrides"
|
||||
#endif // __clang__
|
||||
|
|
|
@ -139,7 +139,7 @@ const mp_obj_property_t bleio_adapter_enabled_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_adapter_get_enabled_obj,
|
||||
(mp_obj_t)&bleio_adapter_set_enabled_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| address: Address
|
||||
|
@ -163,7 +163,7 @@ const mp_obj_property_t bleio_adapter_address_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_adapter_get_address_obj,
|
||||
(mp_obj_t)&bleio_adapter_set_address_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| name: str
|
||||
|
@ -187,7 +187,7 @@ const mp_obj_property_t bleio_adapter_name_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_adapter_get_name_obj,
|
||||
(mp_obj_t)&bleio_adapter_set_name_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| def start_advertising(self, data: ReadableBuffer, *, scan_response: Optional[ReadableBuffer] = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> None:
|
||||
|
@ -375,8 +375,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_advertising_obj, bleio_adapter_get_a
|
|||
const mp_obj_property_t bleio_adapter_advertising_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_adapter_get_advertising_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| connected: bool
|
||||
|
@ -392,8 +392,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_connected_obj, bleio_adapter_get_con
|
|||
const mp_obj_property_t bleio_adapter_connected_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_adapter_get_connected_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| connections: Tuple[Connection]
|
||||
|
@ -408,8 +408,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_connections_obj, bleio_adapter_get_c
|
|||
const mp_obj_property_t bleio_adapter_connections_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_adapter_get_connections_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| def connect(self, address: Address, *, timeout: float) -> Connection:
|
||||
|
|
|
@ -104,8 +104,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_address_get_address_bytes_obj, bleio_address_get
|
|||
const mp_obj_property_t bleio_address_address_bytes_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&bleio_address_get_address_bytes_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| type: int
|
||||
|
@ -124,8 +124,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_address_get_type_obj, bleio_address_get_type);
|
|||
const mp_obj_property_t bleio_address_type_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&bleio_address_get_type_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def __eq__(self, other: object) -> bool:
|
||||
|
|
|
@ -164,8 +164,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_properties_obj, bleio_
|
|||
const mp_obj_property_t bleio_characteristic_properties_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_characteristic_get_properties_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| uuid: Optional[UUID]
|
||||
|
@ -184,8 +184,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_uuid_obj, bleio_charac
|
|||
const mp_obj_property_t bleio_characteristic_uuid_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_characteristic_get_uuid_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| value: bytearray
|
||||
|
@ -216,7 +216,7 @@ const mp_obj_property_t bleio_characteristic_value_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_characteristic_get_value_obj,
|
||||
(mp_obj_t)&bleio_characteristic_set_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| max_length: int
|
||||
|
@ -232,8 +232,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_max_length_obj, bleio_
|
|||
const mp_obj_property_t bleio_characteristic_max_length_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_characteristic_get_max_length_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| descriptors: Descriptor
|
||||
|
@ -250,8 +250,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_descriptors_obj, bleio
|
|||
const mp_obj_property_t bleio_characteristic_descriptors_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_characteristic_get_descriptors_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| service: Service
|
||||
|
@ -267,8 +267,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_service_obj, bleio_cha
|
|||
const mp_obj_property_t bleio_characteristic_service_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_characteristic_get_service_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| def set_cccd(self, *, notify: bool = False, indicate: bool = False) -> None:
|
||||
|
|
|
@ -180,8 +180,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_buffer_get_in_waiting_obj, bleio_
|
|||
const mp_obj_property_t bleio_characteristic_buffer_in_waiting_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&bleio_characteristic_buffer_get_in_waiting_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def reset_input_buffer(self) -> None:
|
||||
|
|
|
@ -164,8 +164,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connected_obj, bleio_conne
|
|||
const mp_obj_property_t bleio_connection_connected_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_connection_get_connected_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
|
||||
|
@ -182,8 +182,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_paired_obj, bleio_connecti
|
|||
const mp_obj_property_t bleio_connection_paired_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_connection_get_paired_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
|
||||
|
@ -239,14 +239,14 @@ const mp_obj_property_t bleio_connection_connection_interval_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_connection_get_connection_interval_obj,
|
||||
(mp_obj_t)&bleio_connection_set_connection_interval_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
const mp_obj_property_t bleio_connection_max_packet_length_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_connection_get_max_packet_length_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = {
|
||||
|
|
|
@ -153,8 +153,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_descriptor_get_uuid_obj, bleio_descriptor_get_uu
|
|||
const mp_obj_property_t bleio_descriptor_uuid_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&bleio_descriptor_get_uuid_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| characteristic: Characteristic
|
||||
|
@ -170,8 +170,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_descriptor_get_characteristic_obj, bleio_
|
|||
const mp_obj_property_t bleio_descriptor_characteristic_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_descriptor_get_characteristic_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| value: bytearray
|
||||
|
@ -202,7 +202,7 @@ const mp_obj_property_t bleio_descriptor_value_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_descriptor_get_value_obj,
|
||||
(mp_obj_t)&bleio_descriptor_set_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t bleio_descriptor_locals_dict_table[] = {
|
||||
|
|
|
@ -204,8 +204,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_incoming_packet_length_
|
|||
const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_packet_buffer_get_incoming_packet_length_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| outgoing_packet_length: int
|
||||
|
@ -225,8 +225,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_outgoing_packet_length_
|
|||
const mp_obj_property_t bleio_packet_buffer_outgoing_packet_length_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_packet_buffer_get_outgoing_packet_length_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t bleio_packet_buffer_locals_dict_table[] = {
|
||||
|
|
|
@ -82,8 +82,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_address_obj, bleio_scanentr
|
|||
const mp_obj_property_t bleio_scanentry_address_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_scanentry_get_address_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| advertisement_bytes: bytes
|
||||
|
@ -98,8 +98,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_advertisement_bytes_obj, sc
|
|||
const mp_obj_property_t bleio_scanentry_advertisement_bytes_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_scanentry_get_advertisement_bytes_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| rssi: int
|
||||
|
@ -114,8 +114,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_rssi_obj, scanentry_get_rss
|
|||
const mp_obj_property_t bleio_scanentry_rssi_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_scanentry_get_rssi_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| connectable: bool
|
||||
|
@ -130,8 +130,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_connectable_obj, scanentry_
|
|||
const mp_obj_property_t bleio_scanentry_connectable_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_scanentry_get_connectable_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| scan_response: bool
|
||||
|
@ -146,8 +146,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_scan_response_obj, scanentr
|
|||
const mp_obj_property_t bleio_scanentry_scan_response_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_scanentry_get_scan_response_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t bleio_scanentry_locals_dict_table[] = {
|
||||
|
|
|
@ -86,8 +86,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_characteristics_obj, bleio_se
|
|||
const mp_obj_property_t bleio_service_characteristics_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_service_get_characteristics_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| remote: bool
|
||||
|
@ -103,8 +103,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_remote_obj, bleio_service_get
|
|||
const mp_obj_property_t bleio_service_remote_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_service_get_remote_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| secondary: bool
|
||||
|
@ -120,8 +120,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_secondary_obj, bleio_service_
|
|||
const mp_obj_property_t bleio_service_secondary_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_service_get_secondary_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
//| uuid: Optional[UUID]
|
||||
|
@ -140,8 +140,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_uuid_obj, bleio_service_get_u
|
|||
const mp_obj_property_t bleio_service_uuid_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = { (mp_obj_t)&bleio_service_get_uuid_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE },
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -135,8 +135,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_uuid_get_uuid16_obj, bleio_uuid_get_uuid16);
|
|||
const mp_obj_property_t bleio_uuid_uuid16_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&bleio_uuid_get_uuid16_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| uuid128: bytes
|
||||
|
@ -161,8 +161,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_uuid_get_uuid128_obj, bleio_uuid_get_uuid128);
|
|||
const mp_obj_property_t bleio_uuid_uuid128_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&bleio_uuid_get_uuid128_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| size: int
|
||||
|
@ -181,8 +181,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_uuid_get_size_obj, bleio_uuid_get_size);
|
|||
const mp_obj_property_t bleio_uuid_size_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&bleio_uuid_get_size_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "py/objexcept.h"
|
||||
#include "py/runtime.h"
|
||||
#include "shared-bindings/_bleio/__init__.h"
|
||||
|
|
|
@ -52,7 +52,7 @@ typedef struct _mp_obj__EVE_t {
|
|||
STATIC const mp_obj_type_t _EVE_type;
|
||||
|
||||
#define EVEHAL(s) \
|
||||
(&((mp_obj__EVE_t *)mp_instance_cast_to_native_base((s), &_EVE_type))->_eve)
|
||||
(&((mp_obj__EVE_t *)mp_obj_cast_to_native_base((s), &_EVE_type))->_eve)
|
||||
|
||||
//| def register(self, o: object) -> None:
|
||||
//| ...
|
||||
|
|
|
@ -167,8 +167,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_get_bpp_obj, pixelbuf_pixelbuf_obj_g
|
|||
const mp_obj_property_t pixelbuf_pixelbuf_bpp_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&pixelbuf_pixelbuf_get_bpp_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
@ -200,7 +200,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_brightness_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&pixelbuf_pixelbuf_get_brightness_obj,
|
||||
(mp_obj_t)&pixelbuf_pixelbuf_set_brightness_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| auto_write: bool
|
||||
|
@ -222,7 +222,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_auto_write_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&pixelbuf_pixelbuf_get_auto_write_obj,
|
||||
(mp_obj_t)&pixelbuf_pixelbuf_set_auto_write_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| byteorder: str
|
||||
|
@ -236,8 +236,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_get_byteorder_str, pixelbuf_pixelbuf
|
|||
const mp_obj_property_t pixelbuf_pixelbuf_byteorder_str = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&pixelbuf_pixelbuf_get_byteorder_str,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC mp_obj_t pixelbuf_pixelbuf_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
||||
|
|
|
@ -75,7 +75,7 @@ STATIC mp_obj_t stage_render(size_t n_args, const mp_obj_t *args) {
|
|||
uint16_t *buffer = bufinfo.buf;
|
||||
size_t buffer_size = bufinfo.len / 2; // 16-bit indexing
|
||||
|
||||
mp_obj_t native_display = mp_instance_cast_to_native_base(args[6],
|
||||
mp_obj_t native_display = mp_obj_cast_to_native_base(args[6],
|
||||
&displayio_display_type);
|
||||
if (!mp_obj_is_type(native_display, &displayio_display_type)) {
|
||||
mp_raise_TypeError(translate("argument num/types mismatch"));
|
||||
|
|
|
@ -246,7 +246,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(aesio_aes_set_mode_obj, aesio_aes_set_mode);
|
|||
const mp_obj_property_t aesio_aes_mode_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&aesio_aes_get_mode_obj,
|
||||
(mp_obj_t)&aesio_aes_set_mode_obj, (mp_obj_t)&mp_const_none_obj},
|
||||
(mp_obj_t)&aesio_aes_set_mode_obj, MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t aesio_locals_dict_table[] = {
|
||||
|
|
|
@ -100,8 +100,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(alarm_pin_pinalarm_get_pin_obj, alarm_pin_pinalarm_obj
|
|||
const mp_obj_property_t alarm_pin_pinalarm_pin_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&alarm_pin_pinalarm_get_pin_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| value: bool
|
||||
|
@ -116,8 +116,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(alarm_pin_pinalarm_get_value_obj, alarm_pin_pinalarm_o
|
|||
const mp_obj_property_t alarm_pin_pinalarm_value_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&alarm_pin_pinalarm_get_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t alarm_pin_pinalarm_locals_dict_table[] = {
|
||||
|
|
|
@ -125,8 +125,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(alarm_time_timealarm_get_monotonic_time_obj, alarm_tim
|
|||
const mp_obj_property_t alarm_time_timealarm_monotonic_time_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&alarm_time_timealarm_get_monotonic_time_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t alarm_time_timealarm_locals_dict_table[] = {
|
||||
|
|
|
@ -74,8 +74,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(alarm_touch_touchalarm_get_pin_obj, alarm_touch_toucha
|
|||
const mp_obj_property_t alarm_touch_touchalarm_pin_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&alarm_touch_touchalarm_get_pin_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t alarm_touch_touchalarm_locals_dict_table[] = {
|
||||
|
|
|
@ -120,8 +120,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogin_get_value_obj, analogio_analogin_obj
|
|||
const mp_obj_property_t analogio_analogin_value_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&analogio_analogin_get_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| reference_voltage: float
|
||||
|
@ -145,8 +145,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogin_get_reference_voltage_obj,
|
|||
const mp_obj_property_t analogio_analogin_reference_voltage_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&analogio_analogin_get_reference_voltage_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t analogio_analogin_locals_dict_table[] = {
|
||||
|
|
|
@ -119,9 +119,9 @@ MP_DEFINE_CONST_FUN_OBJ_2(analogio_analogout_set_value_obj, analogio_analogout_o
|
|||
|
||||
const mp_obj_property_t analogio_analogout_value_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&mp_const_none_obj,
|
||||
.proxy = {MP_ROM_NONE,
|
||||
(mp_obj_t)&analogio_analogout_set_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t analogio_analogout_locals_dict_table[] = {
|
||||
|
|
|
@ -207,8 +207,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_get_playing_obj, audiobusio_i2sout_o
|
|||
const mp_obj_property_t audiobusio_i2sout_playing_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiobusio_i2sout_get_playing_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def pause(self) -> None:
|
||||
|
@ -256,8 +256,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_get_paused_obj, audiobusio_i2sout_ob
|
|||
const mp_obj_property_t audiobusio_i2sout_paused_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiobusio_i2sout_get_paused_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
#endif // CIRCUITPY_AUDIOBUSIO_I2SOUT
|
||||
|
||||
|
|
|
@ -229,8 +229,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_pdmin_get_sample_rate_obj, audiobusio_pdmin
|
|||
const mp_obj_property_t audiobusio_pdmin_sample_rate_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiobusio_pdmin_get_sample_rate_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t audiobusio_pdmin_locals_dict_table[] = {
|
||||
|
|
|
@ -157,7 +157,7 @@ const mp_obj_property_t audioio_rawsample_sample_rate_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audioio_rawsample_get_sample_rate_obj,
|
||||
(mp_obj_t)&audioio_rawsample_set_sample_rate_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t audioio_rawsample_locals_dict_table[] = {
|
||||
|
|
|
@ -149,7 +149,7 @@ const mp_obj_property_t audioio_wavefile_sample_rate_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audioio_wavefile_get_sample_rate_obj,
|
||||
(mp_obj_t)&audioio_wavefile_set_sample_rate_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| bits_per_sample: int
|
||||
|
@ -165,8 +165,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audioio_wavefile_get_bits_per_sample_obj, audioio_wave
|
|||
const mp_obj_property_t audioio_wavefile_bits_per_sample_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audioio_wavefile_get_bits_per_sample_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
//| channel_count: int
|
||||
//| """Number of audio channels. (read only)"""
|
||||
|
@ -181,8 +181,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audioio_wavefile_get_channel_count_obj, audioio_wavefi
|
|||
const mp_obj_property_t audioio_wavefile_channel_count_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audioio_wavefile_get_channel_count_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -200,8 +200,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_get_playing_obj, audioio_audioout_obj
|
|||
const mp_obj_property_t audioio_audioout_playing_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audioio_audioout_get_playing_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def pause(self) -> None:
|
||||
|
@ -249,8 +249,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_get_paused_obj, audioio_audioout_obj_
|
|||
const mp_obj_property_t audioio_audioout_paused_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audioio_audioout_get_paused_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t audioio_audioout_locals_dict_table[] = {
|
||||
|
|
|
@ -169,8 +169,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixer_get_playing_obj, audiomixer_mixer_obj
|
|||
const mp_obj_property_t audiomixer_mixer_playing_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomixer_mixer_get_playing_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| sample_rate: int
|
||||
|
@ -186,8 +186,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixer_get_sample_rate_obj, audiomixer_mixer
|
|||
const mp_obj_property_t audiomixer_mixer_sample_rate_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomixer_mixer_get_sample_rate_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| voice: Tuple[MixerVoice, ...]
|
||||
|
@ -207,8 +207,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixer_get_voice_obj, audiomixer_mixer_obj_g
|
|||
const mp_obj_property_t audiomixer_mixer_voice_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomixer_mixer_get_voice_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def play(self, sample: _typing.AudioSample, *, voice: int = 0, loop: bool = False) -> None:
|
||||
|
|
|
@ -133,7 +133,7 @@ const mp_obj_property_t audiomixer_mixervoice_level_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomixer_mixervoice_get_level_obj,
|
||||
(mp_obj_t)&audiomixer_mixervoice_set_level_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| playing: bool
|
||||
|
@ -151,8 +151,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixervoice_get_playing_obj, audiomixer_mixe
|
|||
const mp_obj_property_t audiomixer_mixervoice_playing_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomixer_mixervoice_get_playing_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t audiomixer_mixervoice_locals_dict_table[] = {
|
||||
|
|
|
@ -149,7 +149,7 @@ const mp_obj_property_t audiomp3_mp3file_file_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomp3_mp3file_get_file_obj,
|
||||
(mp_obj_t)&audiomp3_mp3file_set_file_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
@ -178,7 +178,7 @@ const mp_obj_property_t audiomp3_mp3file_sample_rate_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomp3_mp3file_get_sample_rate_obj,
|
||||
(mp_obj_t)&audiomp3_mp3file_set_sample_rate_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| bits_per_sample: int
|
||||
|
@ -194,8 +194,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_bits_per_sample_obj, audiomp3_mp3
|
|||
const mp_obj_property_t audiomp3_mp3file_bits_per_sample_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomp3_mp3file_get_bits_per_sample_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| channel_count: int
|
||||
|
@ -211,8 +211,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_channel_count_obj, audiomp3_mp3fi
|
|||
const mp_obj_property_t audiomp3_mp3file_channel_count_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomp3_mp3file_get_channel_count_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| rms_level: float
|
||||
|
@ -228,8 +228,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_rms_level_obj, audiomp3_mp3file_o
|
|||
const mp_obj_property_t audiomp3_mp3file_rms_level_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiomp3_mp3file_get_rms_level_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -201,8 +201,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_get_playing_obj, audiopwmio_pwm
|
|||
const mp_obj_property_t audiopwmio_pwmaudioout_playing_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiopwmio_pwmaudioout_get_playing_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def pause(self) -> None:
|
||||
|
@ -250,8 +250,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_get_paused_obj, audiopwmio_pwma
|
|||
const mp_obj_property_t audiopwmio_pwmaudioout_paused_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&audiopwmio_pwmaudioout_get_paused_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t audiopwmio_pwmaudioout_locals_dict_table[] = {
|
||||
|
|
|
@ -396,8 +396,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_get_frequency_obj, busio_spi_obj_get_frequen
|
|||
const mp_obj_property_t busio_spi_frequency_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&busio_spi_get_frequency_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t busio_spi_locals_dict_table[] = {
|
||||
|
|
|
@ -286,7 +286,7 @@ const mp_obj_property_t busio_uart_baudrate_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&busio_uart_get_baudrate_obj,
|
||||
(mp_obj_t)&busio_uart_set_baudrate_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| in_waiting: int
|
||||
|
@ -302,8 +302,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_get_in_waiting_obj, busio_uart_obj_get_in_w
|
|||
const mp_obj_property_t busio_uart_in_waiting_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&busio_uart_get_in_waiting_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| timeout: float
|
||||
|
@ -331,7 +331,7 @@ const mp_obj_property_t busio_uart_timeout_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&busio_uart_get_timeout_obj,
|
||||
(mp_obj_t)&busio_uart_set_timeout_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def reset_input_buffer(self) -> None:
|
||||
|
|
|
@ -257,7 +257,7 @@ STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map
|
|||
|
||||
canio_match_obj_t *matches[nmatch];
|
||||
for (size_t i = 0; i < nmatch; i++) {
|
||||
mp_obj_type_t *type = mp_obj_get_type(match_objects[i]);
|
||||
const mp_obj_type_t *type = mp_obj_get_type(match_objects[i]);
|
||||
if (type != &canio_match_type) {
|
||||
mp_raise_TypeError_varg(translate("expected '%q' but got '%q'"), MP_QSTR_Match, type->name);
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ STATIC const mp_obj_property_t canio_can_loopback_obj = {
|
|||
STATIC mp_obj_t canio_can_send(mp_obj_t self_in, mp_obj_t message_in) {
|
||||
canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
common_hal_canio_can_check_for_deinit(self);
|
||||
mp_obj_type_t *message_type = mp_obj_get_type(message_in);
|
||||
const mp_obj_type_t *message_type = mp_obj_get_type(message_in);
|
||||
if (message_type != &canio_message_type && message_type != &canio_remote_transmission_request_type) {
|
||||
mp_raise_TypeError_varg(translate("expected '%q' or '%q' but got '%q'"), MP_QSTR_Message, MP_QSTR_RemoteTransmissionRequest, message_type->name);
|
||||
}
|
||||
|
|
|
@ -85,8 +85,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(canio_match_id_get_obj, canio_match_id_get);
|
|||
const mp_obj_property_t canio_match_id_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_match_id_get_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//|
|
||||
|
@ -103,8 +103,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(canio_match_mask_get_obj, canio_match_mask_get);
|
|||
const mp_obj_property_t canio_match_mask_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_match_mask_get_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| extended: bool
|
||||
|
@ -120,8 +120,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(canio_match_extended_get_obj, canio_match_extended_get
|
|||
const mp_obj_property_t canio_match_extended_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_match_extended_get_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t canio_match_locals_dict_table[] = {
|
||||
|
|
|
@ -87,7 +87,7 @@ STATIC const mp_obj_property_t canio_message_id_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_message_id_get_obj,
|
||||
(mp_obj_t)&canio_message_id_set_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| data: bytes
|
||||
|
@ -116,7 +116,7 @@ STATIC const mp_obj_property_t canio_message_data_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_message_data_get_obj,
|
||||
(mp_obj_t)&canio_message_data_set_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
@ -141,7 +141,7 @@ STATIC const mp_obj_property_t canio_message_extended_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_message_extended_get_obj,
|
||||
(mp_obj_t)&canio_message_extended_set_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t canio_message_locals_dict_table[] = {
|
||||
|
|
|
@ -86,7 +86,7 @@ STATIC const mp_obj_property_t canio_remote_transmission_request_id_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_remote_transmission_request_id_get_obj,
|
||||
(mp_obj_t)&canio_remote_transmission_request_id_set_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| extended: bool
|
||||
|
@ -110,7 +110,7 @@ STATIC const mp_obj_property_t canio_remote_transmission_request_extended_obj =
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_remote_transmission_request_extended_get_obj,
|
||||
(mp_obj_t)&canio_remote_transmission_request_extended_set_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| length: int
|
||||
|
@ -138,7 +138,7 @@ STATIC const mp_obj_property_t canio_remote_transmission_request_length_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&canio_remote_transmission_request_length_get_obj,
|
||||
(mp_obj_t)&canio_remote_transmission_request_length_set_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t canio_remote_transmission_request_locals_dict_table[] = {
|
||||
|
|
|
@ -109,7 +109,7 @@ const mp_obj_property_t countio_counter_count_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&countio_counter_get_count_obj,
|
||||
(mp_obj_t)&countio_counter_set_count_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def reset(self) -> None:
|
||||
|
|
|
@ -225,7 +225,7 @@ const mp_obj_property_t digitalio_digitalio_direction_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&digitalio_digitalinout_get_direction_obj,
|
||||
(mp_obj_t)&digitalio_digitalinout_set_direction_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| value: bool
|
||||
|
@ -255,7 +255,7 @@ const mp_obj_property_t digitalio_digitalinout_value_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&digitalio_digitalinout_get_value_obj,
|
||||
(mp_obj_t)&digitalio_digitalinout_set_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| drive_mode: DriveMode
|
||||
|
@ -299,7 +299,7 @@ const mp_obj_property_t digitalio_digitalio_drive_mode_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&digitalio_digitalinout_get_drive_mode_obj,
|
||||
(mp_obj_t)&digitalio_digitalinout_set_drive_mode_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| pull: Optional[Pull]
|
||||
|
@ -324,7 +324,7 @@ STATIC mp_obj_t digitalio_digitalinout_obj_get_pull(mp_obj_t self_in) {
|
|||
} else if (pull == PULL_DOWN) {
|
||||
return (mp_obj_t)&digitalio_pull_down_obj;
|
||||
}
|
||||
return (mp_obj_t)&mp_const_none_obj;
|
||||
return mp_const_none;
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(digitalio_digitalinout_get_pull_obj, digitalio_digitalinout_obj_get_pull);
|
||||
|
||||
|
@ -352,7 +352,7 @@ const mp_obj_property_t digitalio_digitalio_pull_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&digitalio_digitalinout_get_pull_obj,
|
||||
(mp_obj_t)&digitalio_digitalinout_set_pull_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t digitalio_digitalinout_locals_dict_table[] = {
|
||||
|
|
|
@ -101,8 +101,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_bitmap_get_width_obj, displayio_bitmap_obj_g
|
|||
const mp_obj_property_t displayio_bitmap_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_bitmap_get_width_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| height: int
|
||||
|
@ -119,8 +119,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_bitmap_get_height_obj, displayio_bitmap_obj_
|
|||
const mp_obj_property_t displayio_bitmap_height_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_bitmap_get_height_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int:
|
||||
|
|
|
@ -108,7 +108,7 @@ const mp_obj_property_t displayio_colorconverter_dither_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_colorconverter_get_dither_obj,
|
||||
(mp_obj_t)&displayio_colorconverter_set_dither_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def make_transparent(self, pixel: int) -> None:
|
||||
|
|
|
@ -202,7 +202,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
|
|||
|
||||
// Helper to ensure we have the native super class instead of a subclass.
|
||||
static displayio_display_obj_t *native_display(mp_obj_t display_obj) {
|
||||
mp_obj_t native_display = mp_instance_cast_to_native_base(display_obj, &displayio_display_type);
|
||||
mp_obj_t native_display = mp_obj_cast_to_native_base(display_obj, &displayio_display_type);
|
||||
mp_obj_assert_native_inited(native_display);
|
||||
return MP_OBJ_TO_PTR(native_display);
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ const mp_obj_property_t displayio_display_auto_refresh_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_display_get_auto_refresh_obj,
|
||||
(mp_obj_t)&displayio_display_set_auto_refresh_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| brightness: float
|
||||
|
@ -337,7 +337,7 @@ const mp_obj_property_t displayio_display_brightness_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_display_get_brightness_obj,
|
||||
(mp_obj_t)&displayio_display_set_brightness_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| auto_brightness: bool
|
||||
|
@ -365,7 +365,7 @@ const mp_obj_property_t displayio_display_auto_brightness_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_display_get_auto_brightness_obj,
|
||||
(mp_obj_t)&displayio_display_set_auto_brightness_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
@ -383,8 +383,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_width_obj, displayio_display_obj
|
|||
const mp_obj_property_t displayio_display_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_display_get_width_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| height: int
|
||||
|
@ -399,8 +399,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_height_obj, displayio_display_ob
|
|||
const mp_obj_property_t displayio_display_height_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_display_get_height_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| rotation: int
|
||||
|
@ -423,7 +423,7 @@ const mp_obj_property_t displayio_display_rotation_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_display_get_rotation_obj,
|
||||
(mp_obj_t)&displayio_display_set_rotation_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| bus: _DisplayBus
|
||||
|
@ -439,8 +439,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_bus_obj, displayio_display_obj_g
|
|||
const mp_obj_property_t displayio_display_bus_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_display_get_bus_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size
|
|||
|
||||
// Helper to ensure we have the native super class instead of a subclass.
|
||||
static displayio_epaperdisplay_obj_t *native_display(mp_obj_t display_obj) {
|
||||
mp_obj_t native_display = mp_instance_cast_to_native_base(display_obj, &displayio_epaperdisplay_type);
|
||||
mp_obj_t native_display = mp_obj_cast_to_native_base(display_obj, &displayio_epaperdisplay_type);
|
||||
mp_obj_assert_native_inited(native_display);
|
||||
return MP_OBJ_TO_PTR(native_display);
|
||||
}
|
||||
|
@ -242,8 +242,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_time_to_refresh_obj, displ
|
|||
const mp_obj_property_t displayio_epaperdisplay_time_to_refresh_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_epaperdisplay_get_time_to_refresh_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| busy: bool
|
||||
|
@ -259,8 +259,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_busy_obj, displayio_epaper
|
|||
const mp_obj_property_t displayio_epaperdisplay_busy_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_epaperdisplay_get_busy_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| width: int
|
||||
|
@ -275,8 +275,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_width_obj, displayio_epape
|
|||
const mp_obj_property_t displayio_epaperdisplay_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_epaperdisplay_get_width_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| height: int
|
||||
|
@ -291,8 +291,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_height_obj, displayio_epap
|
|||
const mp_obj_property_t displayio_epaperdisplay_height_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_epaperdisplay_get_height_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| rotation: int
|
||||
|
@ -315,7 +315,7 @@ const mp_obj_property_t displayio_epaperdisplay_rotation_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_epaperdisplay_get_rotation_obj,
|
||||
(mp_obj_t)&displayio_epaperdisplay_set_rotation_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| bus: _DisplayBus
|
||||
|
@ -330,8 +330,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_bus_obj, displayio_epaperd
|
|||
const mp_obj_property_t displayio_epaperdisplay_bus_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_epaperdisplay_get_bus_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_arg
|
|||
|
||||
// Helper to ensure we have the native super class instead of a subclass.
|
||||
displayio_group_t *native_group(mp_obj_t group_obj) {
|
||||
mp_obj_t native_group = mp_instance_cast_to_native_base(group_obj, &displayio_group_type);
|
||||
mp_obj_t native_group = mp_obj_cast_to_native_base(group_obj, &displayio_group_type);
|
||||
if (native_group == MP_OBJ_NULL) {
|
||||
mp_raise_ValueError_varg(translate("Must be a %q subclass."), MP_QSTR_Group);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ const mp_obj_property_t displayio_group_hidden_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_group_get_hidden_obj,
|
||||
(mp_obj_t)&displayio_group_set_hidden_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| scale: int
|
||||
|
@ -132,7 +132,7 @@ const mp_obj_property_t displayio_group_scale_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_group_get_scale_obj,
|
||||
(mp_obj_t)&displayio_group_set_scale_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| x: int
|
||||
|
@ -157,7 +157,7 @@ const mp_obj_property_t displayio_group_x_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_group_get_x_obj,
|
||||
(mp_obj_t)&displayio_group_set_x_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| y: int
|
||||
|
@ -182,7 +182,7 @@ const mp_obj_property_t displayio_group_y_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_group_get_y_obj,
|
||||
(mp_obj_t)&displayio_group_set_y_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def append(self, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> None:
|
||||
|
|
|
@ -103,8 +103,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_ondiskbitmap_get_width_obj, displayio_ondisk
|
|||
const mp_obj_property_t displayio_ondiskbitmap_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_ondiskbitmap_get_width_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
|
||||
};
|
||||
|
||||
|
@ -122,8 +122,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_ondiskbitmap_get_height_obj, displayio_ondis
|
|||
const mp_obj_property_t displayio_ondiskbitmap_height_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_ondiskbitmap_get_height_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ STATIC mp_obj_t displayio_tilegrid_make_new(const mp_obj_type_t *type, size_t n_
|
|||
|
||||
uint16_t bitmap_width;
|
||||
uint16_t bitmap_height;
|
||||
mp_obj_t native = mp_instance_cast_to_native_base(bitmap, &displayio_shape_type);
|
||||
mp_obj_t native = mp_obj_cast_to_native_base(bitmap, &displayio_shape_type);
|
||||
if (native != MP_OBJ_NULL) {
|
||||
displayio_shape_t *bmp = MP_OBJ_TO_PTR(native);
|
||||
bitmap_width = bmp->width;
|
||||
|
@ -137,7 +137,7 @@ STATIC mp_obj_t displayio_tilegrid_make_new(const mp_obj_type_t *type, size_t n_
|
|||
|
||||
// Helper to ensure we have the native super class instead of a subclass.
|
||||
static displayio_tilegrid_t *native_tilegrid(mp_obj_t tilegrid_obj) {
|
||||
mp_obj_t native_tilegrid = mp_instance_cast_to_native_base(tilegrid_obj, &displayio_tilegrid_type);
|
||||
mp_obj_t native_tilegrid = mp_obj_cast_to_native_base(tilegrid_obj, &displayio_tilegrid_type);
|
||||
mp_obj_assert_native_inited(native_tilegrid);
|
||||
return MP_OBJ_TO_PTR(native_tilegrid);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ const mp_obj_property_t displayio_tilegrid_hidden_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_hidden_obj,
|
||||
(mp_obj_t)&displayio_tilegrid_set_hidden_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| x: int
|
||||
|
@ -187,7 +187,7 @@ const mp_obj_property_t displayio_tilegrid_x_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_x_obj,
|
||||
(mp_obj_t)&displayio_tilegrid_set_x_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| y: int
|
||||
|
@ -212,7 +212,7 @@ const mp_obj_property_t displayio_tilegrid_y_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_y_obj,
|
||||
(mp_obj_t)&displayio_tilegrid_set_y_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| flip_x: bool
|
||||
|
@ -236,7 +236,7 @@ const mp_obj_property_t displayio_tilegrid_flip_x_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_flip_x_obj,
|
||||
(mp_obj_t)&displayio_tilegrid_set_flip_x_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| flip_y: bool
|
||||
|
@ -260,7 +260,7 @@ const mp_obj_property_t displayio_tilegrid_flip_y_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_flip_y_obj,
|
||||
(mp_obj_t)&displayio_tilegrid_set_flip_y_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
@ -286,7 +286,7 @@ const mp_obj_property_t displayio_tilegrid_transpose_xy_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_transpose_xy_obj,
|
||||
(mp_obj_t)&displayio_tilegrid_set_transpose_xy_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| pixel_shader: Union[ColorConverter, Palette]
|
||||
|
@ -314,7 +314,7 @@ const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_pixel_shader_obj,
|
||||
(mp_obj_t)&displayio_tilegrid_set_pixel_shader_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int:
|
||||
|
|
|
@ -60,8 +60,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bitmap_obj, fontio_builtinfont_
|
|||
const mp_obj_property_t fontio_builtinfont_bitmap_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&fontio_builtinfont_get_bitmap_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def get_bounding_box(self) -> Tuple[int, int]:
|
||||
|
|
|
@ -88,7 +88,7 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t
|
|||
|
||||
// Helper to ensure we have the native super class instead of a subclass.
|
||||
static framebufferio_framebufferdisplay_obj_t *native_display(mp_obj_t display_obj) {
|
||||
mp_obj_t native_display = mp_instance_cast_to_native_base(display_obj, &framebufferio_framebufferdisplay_type);
|
||||
mp_obj_t native_display = mp_obj_cast_to_native_base(display_obj, &framebufferio_framebufferdisplay_type);
|
||||
mp_obj_assert_native_inited(native_display);
|
||||
return MP_OBJ_TO_PTR(native_display);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_refresh_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_auto_refresh_obj,
|
||||
(mp_obj_t)&framebufferio_framebufferdisplay_set_auto_refresh_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| brightness: float
|
||||
|
@ -209,7 +209,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_brightness_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_brightness_obj,
|
||||
(mp_obj_t)&framebufferio_framebufferdisplay_set_brightness_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| auto_brightness: bool
|
||||
|
@ -240,7 +240,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_brightness_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_auto_brightness_obj,
|
||||
(mp_obj_t)&framebufferio_framebufferdisplay_set_auto_brightness_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| width: int
|
||||
|
@ -255,8 +255,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_width_obj, frameb
|
|||
const mp_obj_property_t framebufferio_framebufferdisplay_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_width_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| height: int
|
||||
|
@ -271,8 +271,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_height_obj, frame
|
|||
const mp_obj_property_t framebufferio_framebufferdisplay_height_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_height_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| rotation: int
|
||||
|
@ -295,7 +295,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_rotation_obj,
|
||||
(mp_obj_t)&framebufferio_framebufferdisplay_set_rotation_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| framebuffer: _typing.FrameBuffer
|
||||
|
@ -311,8 +311,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_framebuffer_obj,
|
|||
const mp_obj_property_t framebufferio_framebufferframebuffer_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_framebuffer_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ const mp_obj_property_t frequencyio_frequencyin_capture_period_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&frequencyio_frequency_get_capture_period_obj,
|
||||
(mp_obj_t)&frequencyio_frequency_set_capture_period_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def __get__(self, index: int) -> int:
|
||||
|
@ -217,8 +217,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_get_value_obj, frequencyio_fre
|
|||
const mp_obj_property_t frequencyio_frequencyin_value_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&frequencyio_frequencyin_get_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t frequencyio_frequencyin_locals_dict_table[] = {
|
||||
|
|
|
@ -111,8 +111,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_latitude_obj, gnss_obj_get_latitude);
|
|||
const mp_obj_property_t gnss_latitude_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&gnss_get_latitude_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| longitude: float
|
||||
|
@ -128,8 +128,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_longitude_obj, gnss_obj_get_longitude);
|
|||
const mp_obj_property_t gnss_longitude_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&gnss_get_longitude_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| altitude: float
|
||||
|
@ -145,8 +145,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_altitude_obj, gnss_obj_get_altitude);
|
|||
const mp_obj_property_t gnss_altitude_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&gnss_get_altitude_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| timestamp: time.struct_time
|
||||
|
@ -164,8 +164,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_timestamp_obj, gnss_obj_get_timestamp);
|
|||
const mp_obj_property_t gnss_timestamp_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&gnss_get_timestamp_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| fix: PositionFix
|
||||
|
@ -181,8 +181,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_fix_obj, gnss_obj_get_fix);
|
|||
const mp_obj_property_t gnss_fix_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&gnss_get_fix_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = {
|
||||
|
|
|
@ -98,8 +98,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(ipaddress_ipv4address_get_packed_obj, ipaddress_ipv4ad
|
|||
const mp_obj_property_t ipaddress_ipv4address_packed_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&ipaddress_ipv4address_get_packed_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| version: int
|
||||
|
@ -122,8 +122,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(ipaddress_ipv4address_get_version_obj, ipaddress_ipv4a
|
|||
const mp_obj_property_t ipaddress_ipv4address_version_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&ipaddress_ipv4address_get_version_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def __eq__(self, other: object) -> bool:
|
||||
|
|
|
@ -108,8 +108,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_get_bytes_per_block_obj,
|
|||
const mp_obj_property_t memorymonitor_allocationsize_bytes_per_block_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&memorymonitor_allocationsize_get_bytes_per_block_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def __len__(self) -> int:
|
||||
|
|
|
@ -70,8 +70,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_frequency_obj, mcu_processor_get_fre
|
|||
const mp_obj_property_t mcu_processor_frequency_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&mcu_processor_get_frequency_obj, // getter
|
||||
(mp_obj_t)&mp_const_none_obj, // no setter
|
||||
(mp_obj_t)&mp_const_none_obj, // no deleter
|
||||
MP_ROM_NONE, // no setter
|
||||
MP_ROM_NONE, // no deleter
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -87,8 +87,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_reset_reason_obj, mcu_processor_get_
|
|||
const mp_obj_property_t mcu_processor_reset_reason_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&mcu_processor_get_reset_reason_obj, // getter
|
||||
(mp_obj_t)&mp_const_none_obj, // no setter
|
||||
(mp_obj_t)&mp_const_none_obj, // no deleter
|
||||
MP_ROM_NONE, // no setter
|
||||
MP_ROM_NONE, // no deleter
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -107,8 +107,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_temperature_obj, mcu_processor_get_t
|
|||
const mp_obj_property_t mcu_processor_temperature_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&mcu_processor_get_temperature_obj, // getter
|
||||
(mp_obj_t)&mp_const_none_obj, // no setter
|
||||
(mp_obj_t)&mp_const_none_obj, // no deleter
|
||||
MP_ROM_NONE, // no setter
|
||||
MP_ROM_NONE, // no deleter
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -126,8 +126,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_uid_obj, mcu_processor_get_uid);
|
|||
const mp_obj_property_t mcu_processor_uid_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&mcu_processor_get_uid_obj, // getter
|
||||
(mp_obj_t)&mp_const_none_obj, // no setter
|
||||
(mp_obj_t)&mp_const_none_obj, // no deleter
|
||||
MP_ROM_NONE, // no setter
|
||||
MP_ROM_NONE, // no deleter
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -146,8 +146,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_voltage_obj, mcu_processor_get_volta
|
|||
const mp_obj_property_t mcu_processor_voltage_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&mcu_processor_get_voltage_obj, // getter
|
||||
(mp_obj_t)&mp_const_none_obj, // no setter
|
||||
(mp_obj_t)&mp_const_none_obj, // no deleter
|
||||
MP_ROM_NONE, // no setter
|
||||
MP_ROM_NONE, // no deleter
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -172,12 +172,12 @@ STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = {
|
|||
#if CIRCUITPY_INTERNAL_NVM_SIZE > 0
|
||||
{ MP_ROM_QSTR(MP_QSTR_nvm), MP_ROM_PTR(&common_hal_mcu_nvm_obj) },
|
||||
#else
|
||||
{ MP_ROM_QSTR(MP_QSTR_nvm), MP_ROM_PTR(&mp_const_none_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_nvm), MP_ROM_NONE },
|
||||
#endif
|
||||
#if CIRCUITPY_WATCHDOG
|
||||
{ MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&common_hal_mcu_watchdogtimer_obj) },
|
||||
#else
|
||||
{ MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&mp_const_none_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_NONE },
|
||||
#endif
|
||||
{ MP_ROM_QSTR(MP_QSTR_ResetReason), MP_ROM_PTR(&mcu_reset_reason_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RunMode), MP_ROM_PTR(&mcu_runmode_type) },
|
||||
|
|
|
@ -84,7 +84,7 @@ const mp_obj_property_t mod_msgpack_exttype_code_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&mod_msgpack_exttype_get_code_obj,
|
||||
(mp_obj_t)&mod_msgpack_exttype_set_code_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| data: bytes
|
||||
|
@ -108,7 +108,7 @@ const mp_obj_property_t mod_msgpack_exttype_data_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&mod_msgpack_exttype_get_data_obj,
|
||||
(mp_obj_t)&mod_msgpack_exttype_set_data_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC mp_rom_map_elem_t mod_msgpack_exttype_locals_dict_table[] = {
|
||||
|
|
|
@ -211,8 +211,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_get_maxlen_obj, pulseio_pulsein_obj_ge
|
|||
const mp_obj_property_t pulseio_pulsein_maxlen_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&pulseio_pulsein_get_maxlen_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| paused: bool
|
||||
|
@ -230,8 +230,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_get_paused_obj, pulseio_pulsein_obj_ge
|
|||
const mp_obj_property_t pulseio_pulsein_paused_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&pulseio_pulsein_get_paused_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def __bool__(self) -> bool: ...
|
||||
|
|
|
@ -203,7 +203,7 @@ const mp_obj_property_t pwmio_pwmout_duty_cycle_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&pwmio_pwmout_get_duty_cycle_obj,
|
||||
(mp_obj_t)&pwmio_pwmout_set_duty_cycle_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| frequency: int
|
||||
|
@ -240,7 +240,7 @@ const mp_obj_property_t pwmio_pwmout_frequency_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&pwmio_pwmout_get_frequency_obj,
|
||||
(mp_obj_t)&pwmio_pwmout_set_frequency_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t pwmio_pwmout_locals_dict_table[] = {
|
||||
|
|
|
@ -314,7 +314,7 @@ const mp_obj_property_t rgbmatrix_rgbmatrix_brightness_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_brightness_obj,
|
||||
(mp_obj_t)&rgbmatrix_rgbmatrix_set_brightness_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def refresh(self) -> None:
|
||||
|
@ -342,8 +342,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_get_width_obj, rgbmatrix_rgbmatrix
|
|||
const mp_obj_property_t rgbmatrix_rgbmatrix_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_width_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| height: int
|
||||
|
@ -359,8 +359,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_get_height_obj, rgbmatrix_rgbmatri
|
|||
const mp_obj_property_t rgbmatrix_rgbmatrix_height_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_height_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t rgbmatrix_rgbmatrix_locals_dict_table[] = {
|
||||
|
|
|
@ -141,7 +141,7 @@ const mp_obj_property_t rotaryio_incrementalencoder_position_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rotaryio_incrementalencoder_get_position_obj,
|
||||
(mp_obj_t)&rotaryio_incrementalencoder_set_position_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t rotaryio_incrementalencoder_locals_dict_table[] = {
|
||||
|
|
|
@ -91,7 +91,7 @@ const mp_obj_property_t rtc_rtc_datetime_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rtc_rtc_get_datetime_obj,
|
||||
(mp_obj_t)&rtc_rtc_set_datetime_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| calibration: int
|
||||
|
@ -122,7 +122,7 @@ const mp_obj_property_t rtc_rtc_calibration_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&rtc_rtc_get_calibration_obj,
|
||||
(mp_obj_t)&rtc_rtc_set_calibration_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t rtc_rtc_locals_dict_table[] = {
|
||||
|
|
|
@ -221,8 +221,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_frequency_obj, sdioio_sdcard_obj_get
|
|||
const mp_obj_property_t sdioio_sdcard_frequency_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&sdioio_sdcard_get_frequency_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| @property
|
||||
|
@ -240,8 +240,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_width_obj, sdioio_sdcard_obj_get_wid
|
|||
const mp_obj_property_t sdioio_sdcard_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&sdioio_sdcard_get_width_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| def deinit(self) -> None:
|
||||
|
|
|
@ -70,8 +70,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_usb_connected_obj, supervisor_r
|
|||
const mp_obj_property_t supervisor_runtime_usb_connected_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&supervisor_runtime_get_usb_connected_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| serial_connected: bool
|
||||
|
@ -85,8 +85,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial_connected_obj, superviso
|
|||
const mp_obj_property_t supervisor_runtime_serial_connected_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&supervisor_runtime_get_serial_connected_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| serial_bytes_available: int
|
||||
|
@ -102,8 +102,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial_bytes_available_obj, sup
|
|||
const mp_obj_property_t supervisor_runtime_serial_bytes_available_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&supervisor_runtime_get_serial_bytes_available_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| run_reason: RunReason
|
||||
|
@ -117,8 +117,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_run_reason_obj, supervisor_runt
|
|||
const mp_obj_property_t supervisor_runtime_run_reason_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&supervisor_runtime_get_run_reason_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
void supervisor_set_run_reason(supervisor_run_reason_t run_reason) {
|
||||
|
|
|
@ -135,8 +135,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(synthio_miditrack_get_sample_rate_obj, synthio_miditra
|
|||
const mp_obj_property_t synthio_miditrack_sample_rate_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&synthio_miditrack_get_sample_rate_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
STATIC const mp_rom_map_elem_t synthio_miditrack_locals_dict_table[] = {
|
||||
|
|
|
@ -248,7 +248,7 @@ STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) {
|
|||
|
||||
mp_int_t secs = mp_obj_get_int(arg);
|
||||
|
||||
if (secs < EPOCH1970_EPOCH2000_DIFF_SECS) {
|
||||
if (secs < 0 || (mp_uint_t)secs < TIMEUTILS_SECONDS_1970_TO_2000) {
|
||||
mp_raise_msg(&mp_type_OverflowError, translate("timestamp out of range for platform time_t"));
|
||||
}
|
||||
|
||||
|
|
|
@ -123,8 +123,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(touchio_touchin_get_value_obj, touchio_touchin_obj_get
|
|||
const mp_obj_property_t touchio_touchin_value_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&touchio_touchin_get_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
@ -142,8 +142,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(touchio_touchin_get_raw_value_obj, touchio_touchin_obj
|
|||
const mp_obj_property_t touchio_touchin_raw_value_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&touchio_touchin_get_raw_value_obj,
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
@ -187,7 +187,7 @@ const mp_obj_property_t touchio_touchin_threshold_obj = {
|
|||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&touchio_touchin_get_threshold_obj,
|
||||
(mp_obj_t)&touchio_touchin_set_threshold_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue