mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-21 23:18:13 +00:00
chore(vendor): update micropython to v1.13
This commit is contained in:
parent
830592f2d9
commit
ded61a4ccf
@ -183,6 +183,7 @@ SOURCE_MICROPYTHON = [
|
||||
'vendor/micropython/lib/embed/abort_.c',
|
||||
#'vendor/micropython/lib/mp-readline/readline.c',
|
||||
'vendor/micropython/lib/utils/gchelper_m3.s',
|
||||
'vendor/micropython/lib/utils/gchelper_native.c',
|
||||
'vendor/micropython/lib/utils/interrupt_char.c',
|
||||
'vendor/micropython/lib/utils/printf.c',
|
||||
'vendor/micropython/lib/utils/pyexec.c',
|
||||
@ -271,6 +272,7 @@ SOURCE_MICROPYTHON = [
|
||||
'vendor/micropython/py/repl.c',
|
||||
'vendor/micropython/py/runtime.c',
|
||||
'vendor/micropython/py/runtime_utils.c',
|
||||
'vendor/micropython/py/scheduler.c',
|
||||
'vendor/micropython/py/scope.c',
|
||||
'vendor/micropython/py/sequence.c',
|
||||
'vendor/micropython/py/showbc.c',
|
||||
|
@ -9,7 +9,9 @@ TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
CPPDEFINES_MOD = []
|
||||
SOURCE_MOD = []
|
||||
SOURCE_MOD = [
|
||||
'vendor/micropython/extmod/vfs_posix_file.c',
|
||||
]
|
||||
if EVERYTHING:
|
||||
SOURCE_MOD_SECP256K1_ZKP = []
|
||||
|
||||
@ -304,8 +306,8 @@ SOURCE_UNIX = [
|
||||
'embed/unix/sdcard.c',
|
||||
'embed/unix/touch.c',
|
||||
'embed/unix/usb.c',
|
||||
'vendor/micropython/lib/utils/gchelper_generic.c',
|
||||
'vendor/micropython/ports/unix/alloc.c',
|
||||
'vendor/micropython/ports/unix/file.c',
|
||||
'vendor/micropython/ports/unix/gccollect.c',
|
||||
'vendor/micropython/ports/unix/input.c',
|
||||
'vendor/micropython/ports/unix/unix_mphal.c',
|
||||
|
@ -71,9 +71,7 @@
|
||||
#define MICROPY_REPL_AUTO_INDENT (1)
|
||||
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
|
||||
#define MICROPY_ENABLE_SOURCE_LINE (1)
|
||||
#ifndef MICROPY_FLOAT_IMPL // can be configured by each board via mpconfigboard.mk
|
||||
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
||||
#endif
|
||||
#define MICROPY_STREAMS_NON_BLOCK (1)
|
||||
#define MICROPY_MODULE_WEAK_LINKS (1)
|
||||
#define MICROPY_CAN_OVERRIDE_BUILTINS (0)
|
||||
@ -93,6 +91,7 @@
|
||||
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
|
||||
#define MICROPY_PY_BUILTINS_FROZENSET (0)
|
||||
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
|
||||
#define MICROPY_PY_BUILTINS_SLICE_INDICES (0)
|
||||
#define MICROPY_PY_BUILTINS_ROUND_INT (0)
|
||||
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
|
||||
#define MICROPY_PY_ALL_SPECIAL_METHODS (0)
|
||||
@ -170,15 +169,10 @@
|
||||
|
||||
#define MP_SSIZE_MAX (0x0fffffff)
|
||||
|
||||
#define UINT_FMT "%u"
|
||||
#define INT_FMT "%d"
|
||||
|
||||
typedef int mp_int_t; // must be pointer size
|
||||
typedef unsigned int mp_uint_t; // must be pointer size
|
||||
typedef long mp_off_t;
|
||||
|
||||
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
|
||||
|
||||
#include "irq.h"
|
||||
|
||||
#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
|
||||
|
@ -38,11 +38,13 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extmod/misc.h"
|
||||
#include "extmod/vfs_posix.h"
|
||||
#include "genhdr/mpversion.h"
|
||||
#include "input.h"
|
||||
#include "py/builtin.h"
|
||||
#include "py/compile.h"
|
||||
#include "py/gc.h"
|
||||
#include "py/mperrno.h"
|
||||
#include "py/mphal.h"
|
||||
#include "py/mpthread.h"
|
||||
#include "py/repl.h"
|
||||
@ -706,6 +708,8 @@ MP_NOINLINE int main_(int argc, char **argv) {
|
||||
return ret & 0xff;
|
||||
}
|
||||
|
||||
#if !MICROPY_VFS
|
||||
|
||||
#ifdef TREZOR_EMULATOR_FROZEN
|
||||
uint mp_import_stat(const char *path) { return MP_IMPORT_STAT_NO_EXIST; }
|
||||
#else
|
||||
@ -722,6 +726,29 @@ uint mp_import_stat(const char *path) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_IO
|
||||
// Factory function for I/O stream classes, only needed if generic VFS subsystem
|
||||
// isn't used. Note: buffering and encoding are currently ignored.
|
||||
mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *pos_args,
|
||||
mp_map_t *kwargs) {
|
||||
enum { ARG_file, ARG_mode };
|
||||
STATIC const mp_arg_t allowed_args[] = {
|
||||
{MP_QSTR_file, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_rom_obj = MP_ROM_NONE}},
|
||||
{MP_QSTR_mode, MP_ARG_OBJ, {.u_obj = MP_OBJ_NEW_QSTR(MP_QSTR_r)}},
|
||||
{MP_QSTR_buffering, MP_ARG_INT, {.u_int = -1}},
|
||||
{MP_QSTR_encoding, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE}},
|
||||
};
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kwargs, MP_ARRAY_SIZE(allowed_args),
|
||||
allowed_args, args);
|
||||
return mp_vfs_posix_file_open(&mp_type_textio, args[ARG_file].u_obj,
|
||||
args[ARG_mode].u_obj);
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void nlr_jump_fail(void *val) {
|
||||
printf("FATAL: uncaught NLR %p\n", val);
|
||||
exit(1);
|
||||
|
@ -82,6 +82,7 @@
|
||||
#define MICROPY_STREAMS_NON_BLOCK (1)
|
||||
#define MICROPY_MODULE_WEAK_LINKS (1)
|
||||
#define MICROPY_CAN_OVERRIDE_BUILTINS (0)
|
||||
#define MICROPY_VFS_POSIX_FILE (1)
|
||||
#define MICROPY_USE_INTERNAL_ERRNO (0)
|
||||
#define MICROPY_ENABLE_SCHEDULER (0)
|
||||
#define MICROPY_SCHEDULER_DEPTH (0)
|
||||
@ -98,6 +99,7 @@
|
||||
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
|
||||
#define MICROPY_PY_BUILTINS_FROZENSET (0)
|
||||
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
|
||||
#define MICROPY_PY_BUILTINS_SLICE_INDICES (0)
|
||||
#define MICROPY_PY_BUILTINS_ROUND_INT (0)
|
||||
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
|
||||
#define MICROPY_PY_ALL_SPECIAL_METHODS (0)
|
||||
@ -163,6 +165,10 @@
|
||||
// check stdout a chance to pass, etc.
|
||||
#define MICROPY_DEBUG_PRINTER (&mp_stderr_print)
|
||||
#define MICROPY_ASYNC_KBD_INTR (1)
|
||||
|
||||
#define mp_type_fileio mp_type_vfs_posix_fileio
|
||||
#define mp_type_textio mp_type_vfs_posix_textio
|
||||
|
||||
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
|
||||
// names in exception messages (may require more RAM).
|
||||
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
|
||||
@ -240,12 +246,6 @@ void mp_unix_mark_exec(void);
|
||||
#define MICROPY_FORCE_PLAT_ALLOC_EXEC (1)
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_OS_DUPTERM
|
||||
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
|
||||
#else
|
||||
#define MP_PLAT_PRINT_STRN(str, len) do { ssize_t ret = write(1, str, len); (void)ret; } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
// Can access physical memory using /dev/mem
|
||||
#define MICROPY_PLAT_DEV_MEM (1)
|
||||
|
2
vendor/micropython
vendored
2
vendor/micropython
vendored
@ -1 +1 @@
|
||||
Subproject commit d9712224e86b935ae74186c717efdddbdf3058de
|
||||
Subproject commit aa4d6db97f9952440dca3acb194bcb6b696d7217
|
Loading…
Reference in New Issue
Block a user