From d0a3c74c8cd5780c77a57f27aca70ff2e1e110e7 Mon Sep 17 00:00:00 2001 From: JishinMaster Date: Mon, 20 Apr 2020 19:25:09 +0200 Subject: [PATCH 1/7] upgrade to latest lvgl, micropython, ulab --- components/micropython/CMakeLists.txt | 5 +- components/micropython/core | 2 +- .../micropython/port/include/mpconfigport.h | 8 +-- .../micropython/port/src/lvgl/lv_bindings | 2 +- components/micropython/port/src/maixpy_main.c | 6 +- components/micropython/port/src/mphalport.c | 15 ++++- .../micropython/port/src/mpthreadport.c | 2 +- .../src/standard_lib/machine/machine_sdcard.c | 58 +++++++++++++++---- .../src/standard_lib/uos/vfs_spiffs_file.c | 4 +- .../port/src/ulab/micropython-ulab | 2 +- 10 files changed, 77 insertions(+), 27 deletions(-) mode change 160000 => 120000 components/micropython/core diff --git a/components/micropython/CMakeLists.txt b/components/micropython/CMakeLists.txt index fb7d344ce..910ecfb7b 100644 --- a/components/micropython/CMakeLists.txt +++ b/components/micropython/CMakeLists.txt @@ -213,6 +213,7 @@ if(CONFIG_COMPONENT_MICROPYTHON_ENABLE) "core/extmod/vfs_fat.c" "core/extmod/vfs_fat_diskio.c" "core/extmod/vfs_fat_file.c" + "core/extmod/vfs_blockdev.c" "core/extmod/utime_mphal.c" "core/extmod/uos_dupterm.c" "core/lib/embed/abort_.c" @@ -428,9 +429,9 @@ if(CONFIG_COMPONENT_MICROPYTHON_ENABLE) VERBATIM ) add_custom_target(gen_collected_h - COMMAND ${python} ${mpy_core_src_dir}/makeqstrdefs.py split ${mpy_build_gen_header_dir}/qstr.i.last ${mpy_build_gen_header_dir}/qstr ${QSTR_DEFS_COLLECTED} + COMMAND ${python} ${mpy_core_src_dir}/makeqstrdefs.py split qstr ${mpy_build_gen_header_dir}/qstr.i.last ${mpy_build_gen_header_dir}/qstr ${QSTR_DEFS_COLLECTED} COMMAND touch ${mpy_build_gen_header_dir}/qstr.split - COMMAND ${python} ${mpy_core_src_dir}/makeqstrdefs.py cat ${mpy_build_gen_header_dir}/qstr.i.last ${mpy_build_gen_header_dir}/qstr ${QSTR_DEFS_COLLECTED} + COMMAND ${python} ${mpy_core_src_dir}/makeqstrdefs.py cat qstr ${mpy_build_gen_header_dir}/qstr.i.last ${mpy_build_gen_header_dir}/qstr ${QSTR_DEFS_COLLECTED} DEPENDS gen_qstr_i_last VERBATIM ) diff --git a/components/micropython/core b/components/micropython/core deleted file mode 160000 index ced340d73..000000000 --- a/components/micropython/core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ced340d739e84737dd5c8e6b4ab9af2ea44e29e7 diff --git a/components/micropython/core b/components/micropython/core new file mode 120000 index 000000000..f137bab31 --- /dev/null +++ b/components/micropython/core @@ -0,0 +1 @@ +../../../micropython \ No newline at end of file diff --git a/components/micropython/port/include/mpconfigport.h b/components/micropython/port/include/mpconfigport.h index 6b9a31d1c..8b57919d1 100644 --- a/components/micropython/port/include/mpconfigport.h +++ b/components/micropython/port/include/mpconfigport.h @@ -436,8 +436,8 @@ extern const struct _mp_obj_module_t mp_module_touchscreen; #if MICROPY_PY_THREAD #define MICROPY_EVENT_POLL_HOOK \ do { \ - extern void mp_handle_pending(void); \ - mp_handle_pending(); \ + extern void mp_handle_pending(bool); \ + mp_handle_pending(true); \ MICROPY_PY_USOCKET_EVENTS_HANDLER \ MP_THREAD_GIL_EXIT(); \ MP_THREAD_GIL_ENTER(); \ @@ -445,8 +445,8 @@ extern const struct _mp_obj_module_t mp_module_touchscreen; #else #define MICROPY_EVENT_POLL_HOOK \ do { \ - extern void mp_handle_pending(void); \ - mp_handle_pending(); \ + extern void mp_handle_pending(bool); \ + mp_handle_pending(true); \ MICROPY_PY_USOCKET_EVENTS_HANDLER \ } while (0); #endif diff --git a/components/micropython/port/src/lvgl/lv_bindings b/components/micropython/port/src/lvgl/lv_bindings index ddf09164e..4a6412b5e 160000 --- a/components/micropython/port/src/lvgl/lv_bindings +++ b/components/micropython/port/src/lvgl/lv_bindings @@ -1 +1 @@ -Subproject commit ddf09164ee1711a61169030a7ee8bf370ee5743f +Subproject commit 4a6412b5e4550b60f0ae57b81db62e88af2c3c1a diff --git a/components/micropython/port/src/maixpy_main.c b/components/micropython/port/src/maixpy_main.c index 6abd15979..f0fc2770f 100644 --- a/components/micropython/port/src/maixpy_main.c +++ b/components/micropython/port/src/maixpy_main.c @@ -123,7 +123,7 @@ STATIC bool init_sdcard_fs(void) { if (vfs == NULL || vfs_fat == NULL) { break; } - vfs_fat->flags = FSUSER_FREE_OBJ; + vfs_fat->blockdev.flags = MP_BLOCKDEV_FLAG_FREE_OBJ; sdcard_init_vfs(vfs_fat, part_num); // try to mount the partition @@ -326,7 +326,7 @@ void pyexec_str(vstr_t* str) { mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, str->buf, str->len, 0); qstr source_name = lex->source_name; mp_parse_tree_t parse_tree = mp_parse(lex, MP_PARSE_FILE_INPUT); - mp_obj_t module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, true); + mp_obj_t module_fun = mp_compile(&parse_tree, source_name, true); //, MP_EMIT_OPT_NONE mp_call_function_0(module_fun); nlr_pop(); } else { @@ -589,7 +589,7 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) { mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0); qstr source_name = lex->source_name; mp_parse_tree_t parse_tree = mp_parse(lex, input_kind); - mp_obj_t module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, true); + mp_obj_t module_fun = mp_compile(&parse_tree, source_name, true);//MP_EMIT_OPT_NONE, mp_call_function_0(module_fun); nlr_pop(); } else { diff --git a/components/micropython/port/src/mphalport.c b/components/micropython/port/src/mphalport.c index 6ec295853..e2fba844b 100644 --- a/components/micropython/port/src/mphalport.c +++ b/components/micropython/port/src/mphalport.c @@ -16,6 +16,17 @@ #include "FreeRTOS.h" #endif +MP_WEAK uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) { + uintptr_t ret = 0; + if (MP_STATE_PORT(Maix_stdio_uart) != NULL) { + mp_obj_t Maix_stdio_uart = MP_OBJ_FROM_PTR(MP_STATE_PORT(Maix_stdio_uart)); + int errcode; + const mp_stream_p_t *stream_p = mp_get_stream(Maix_stdio_uart); + ret = stream_p->ioctl(Maix_stdio_uart, MP_STREAM_POLL, poll_flags, &errcode); + } + return ret | mp_uos_dupterm_poll(poll_flags); +} + int mp_hal_stdin_rx_chr(void) { int c = 0; for (;;) @@ -42,8 +53,8 @@ int mp_hal_stdin_rx_chr(void) { // #if MICROPY_PY_THREAD // ulTaskNotifyTake(pdFALSE, 1); // #endif - extern void mp_handle_pending(void); - mp_handle_pending(); + extern void mp_handle_pending(bool); + mp_handle_pending(true); MICROPY_PY_USOCKET_EVENTS_HANDLER MP_THREAD_GIL_EXIT(); #if MICROPY_PY_THREAD diff --git a/components/micropython/port/src/mpthreadport.c b/components/micropython/port/src/mpthreadport.c index aaa52823e..78dc2cbd7 100644 --- a/components/micropython/port/src/mpthreadport.c +++ b/components/micropython/port/src/mpthreadport.c @@ -127,7 +127,7 @@ mp_state_thread_t *mp_thread_get_state(void) { return pvTaskGetThreadLocalStoragePointer(NULL, 0); } -void mp_thread_set_state(void *state) { +void mp_thread_set_state(struct _mp_state_thread_t *state) { vTaskSetThreadLocalStoragePointer(NULL, 0, state); } diff --git a/components/micropython/port/src/standard_lib/machine/machine_sdcard.c b/components/micropython/port/src/standard_lib/machine/machine_sdcard.c index ee7218482..f27b77f52 100644 --- a/components/micropython/port/src/standard_lib/machine/machine_sdcard.c +++ b/components/micropython/port/src/standard_lib/machine/machine_sdcard.c @@ -6,6 +6,16 @@ #include "extmod/vfs_fat.h" #include "sdcard.h" #include "machine_sdcard.h" + +#define BP_IOCTL_INIT MP_BLOCKDEV_IOCTL_INIT +#define BP_IOCTL_DEINIT MP_BLOCKDEV_IOCTL_DEINIT +#define BP_IOCTL_SYNC MP_BLOCKDEV_IOCTL_SYNC +#define BP_IOCTL_BLOCK_COUNT MP_BLOCKDEV_IOCTL_BLOCK_COUNT +#define BP_IOCTL_BLOCK_SIZE MP_BLOCKDEV_IOCTL_BLOCK_SIZE +#define BP_IOCTL_ERASE MP_BLOCKDEV_IOCTL_BLOCK_ERASE +#define BP_IOCTL_SEC_COUNT MP_BLOCKDEV_IOCTL_SEC_COUNT +#define BP_IOCTL_SEC_SIZE MP_BLOCKDEV_IOCTL_SEC_SIZE + uint64_t sdcard_get_capacity_in_bytes(void) { return cardinfo.CardCapacity; } @@ -36,7 +46,7 @@ STATIC mp_obj_t machine_sdcard_write_sector(mp_obj_t self, mp_obj_t block_num, m } STATIC MP_DEFINE_CONST_FUN_OBJ_3(machine_sdcard_write_sector_obj, machine_sdcard_write_sector); - +/* STATIC mp_obj_t machine_sdcard_ioctl(mp_obj_t self, mp_obj_t cmd_in, mp_obj_t arg_in) { mp_int_t cmd = mp_obj_get_int(cmd_in); switch (cmd) { @@ -60,10 +70,38 @@ STATIC mp_obj_t machine_sdcard_ioctl(mp_obj_t self, mp_obj_t cmd_in, mp_obj_t ar case BP_IOCTL_SEC_SIZE: return MP_OBJ_NEW_SMALL_INT(SDCARD_BLOCK_SIZE); + default: // unknown command + return MP_OBJ_NEW_SMALL_INT(-1); // error + } +}*/ +STATIC mp_obj_t machine_sdcard_ioctl(mp_obj_t self, mp_obj_t cmd_in, mp_obj_t arg_in) { + mp_int_t cmd = mp_obj_get_int(cmd_in); + switch (cmd) { + case MP_BLOCKDEV_IOCTL_INIT: + if (!sdcard_power_on()) { + return MP_OBJ_NEW_SMALL_INT(-1); // error + } + return MP_OBJ_NEW_SMALL_INT(0); // success + + case MP_BLOCKDEV_IOCTL_DEINIT: + sdcard_power_off(); + return MP_OBJ_NEW_SMALL_INT(0); // success + + case MP_BLOCKDEV_IOCTL_SYNC: + // nothing to do + return MP_OBJ_NEW_SMALL_INT(0); // success + + case MP_BLOCKDEV_IOCTL_BLOCK_COUNT: + return MP_OBJ_NEW_SMALL_INT(sdcard_get_capacity_in_bytes() / SDCARD_BLOCK_SIZE); + + case MP_BLOCKDEV_IOCTL_BLOCK_SIZE: + return MP_OBJ_NEW_SMALL_INT(SDCARD_BLOCK_SIZE); + default: // unknown command return MP_OBJ_NEW_SMALL_INT(-1); // error } } + STATIC MP_DEFINE_CONST_FUN_OBJ_3(machine_sdcard_ioctl_obj, machine_sdcard_ioctl); const mp_obj_base_t machine_sdcard_obj = {&machine_sdcard_type}; @@ -83,17 +121,17 @@ const mp_obj_type_t machine_sdcard_type = { void sdcard_init_vfs(fs_user_mount_t *vfs, int part) { vfs->base.type = &mp_fat_vfs_type; - vfs->flags |= FSUSER_NATIVE | FSUSER_HAVE_IOCTL; + vfs->blockdev.flags |= MP_BLOCKDEV_FLAG_NATIVE | MP_BLOCKDEV_FLAG_HAVE_IOCTL; vfs->fatfs.drv = vfs; vfs->fatfs.part = part; - vfs->readblocks[0] = NULL; - vfs->readblocks[1] = NULL; - vfs->readblocks[2] = MP_OBJ_FROM_PTR(sd_read_sector_dma); // native version - vfs->writeblocks[0] = MP_OBJ_FROM_PTR(&machine_sdcard_write_sector_obj); - vfs->writeblocks[1] = NULL; - vfs->writeblocks[2] = MP_OBJ_FROM_PTR(sd_write_sector_dma); // native version - vfs->u.ioctl[0] = MP_OBJ_FROM_PTR(&machine_sdcard_ioctl_obj); - vfs->u.ioctl[1] = MP_OBJ_FROM_PTR(&machine_sdcard_obj); + vfs->blockdev.readblocks[0] = NULL; + vfs->blockdev.readblocks[1] = NULL; + vfs->blockdev.readblocks[2] = MP_OBJ_FROM_PTR(sd_read_sector_dma); // native version + vfs->blockdev.writeblocks[0] = MP_OBJ_FROM_PTR(&machine_sdcard_write_sector_obj); + vfs->blockdev.writeblocks[1] = NULL; + vfs->blockdev.writeblocks[2] = MP_OBJ_FROM_PTR(sd_write_sector_dma); // native version + vfs->blockdev.u.ioctl[0] = MP_OBJ_FROM_PTR(&machine_sdcard_ioctl_obj); + vfs->blockdev.u.ioctl[1] = MP_OBJ_FROM_PTR(&machine_sdcard_obj); //vfs->readblocks[0] = MP_OBJ_FROM_PTR(&pyb_sdcard_readblocks_obj); //vfs->readblocks[1] = MP_OBJ_FROM_PTR(&pyb_sdcard_obj); //vfs->writeblocks[0] = MP_OBJ_FROM_PTR(&pyb_sdcard_writeblocks_obj); diff --git a/components/micropython/port/src/standard_lib/uos/vfs_spiffs_file.c b/components/micropython/port/src/standard_lib/uos/vfs_spiffs_file.c index 9012b5bf4..1525829c7 100644 --- a/components/micropython/port/src/standard_lib/uos/vfs_spiffs_file.c +++ b/components/micropython/port/src/standard_lib/uos/vfs_spiffs_file.c @@ -190,9 +190,9 @@ STATIC mp_uint_t file_obj_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, STATIC const mp_arg_t file_open_args[] = { - { MP_QSTR_file, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} }, + { 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_encoding, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} }, + { MP_QSTR_encoding, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_NONE} }, }; #define FILE_OPEN_NUM_ARGS MP_ARRAY_SIZE(file_open_args) diff --git a/components/micropython/port/src/ulab/micropython-ulab b/components/micropython/port/src/ulab/micropython-ulab index c315a571d..a844e1bfb 160000 --- a/components/micropython/port/src/ulab/micropython-ulab +++ b/components/micropython/port/src/ulab/micropython-ulab @@ -1 +1 @@ -Subproject commit c315a571df49a19b843f7dffc300c21ccb7d4edd +Subproject commit a844e1bfb94ab1a3a6da142661faaf10f9218e05 From 909c20105073c279a55bcd99a300a3f851dacabe Mon Sep 17 00:00:00 2001 From: JishinMaster Date: Mon, 20 Apr 2020 19:34:15 +0200 Subject: [PATCH 2/7] upgrade to latest lvgl, micropython, ulab --- components/micropython/core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 120000 => 160000 components/micropython/core diff --git a/components/micropython/core b/components/micropython/core deleted file mode 120000 index f137bab31..000000000 --- a/components/micropython/core +++ /dev/null @@ -1 +0,0 @@ -../../../micropython \ No newline at end of file diff --git a/components/micropython/core b/components/micropython/core new file mode 160000 index 000000000..388d419ba --- /dev/null +++ b/components/micropython/core @@ -0,0 +1 @@ +Subproject commit 388d419ba39b061923d2568814195e8bf73330d4 From d5a06e63951a688205eedd6aae4c47fb659a3b8d Mon Sep 17 00:00:00 2001 From: JishinMaster Date: Fri, 24 Apr 2020 17:02:48 +0200 Subject: [PATCH 3/7] Removed submodule --- .gitmodules | 3 --- components/micropython/core | 1 - 2 files changed, 4 deletions(-) delete mode 160000 components/micropython/core diff --git a/.gitmodules b/.gitmodules index a69f2dfbd..5e7ac6518 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "tools/flash/kflash_py"] path = tools/flash/kflash_py url = https://github.com/sipeed/kflash.py.git -[submodule "components/micropython/core"] - path = components/micropython/core - url = https://github.com/micropython/micropython.git [submodule "components/micropython/port/src/lvgl/lv_bindings"] path = components/micropython/port/src/lvgl/lv_bindings url = https://github.com/littlevgl/lv_binding_micropython.git diff --git a/components/micropython/core b/components/micropython/core deleted file mode 160000 index 388d419ba..000000000 --- a/components/micropython/core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 388d419ba39b061923d2568814195e8bf73330d4 From 1d2c2f402fb8c49c8c494913edd11c2624f1a96d Mon Sep 17 00:00:00 2001 From: JishinMaster Date: Fri, 24 Apr 2020 17:07:39 +0200 Subject: [PATCH 4/7] Upgraded micropython submodule --- .gitmodules | 3 +++ components/micropython/core | 1 + 2 files changed, 4 insertions(+) create mode 160000 components/micropython/core diff --git a/.gitmodules b/.gitmodules index 5e7ac6518..c51b13434 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,3 +20,6 @@ [submodule "components/micropython/port/src/ulab/micropython-ulab"] path = components/micropython/port/src/ulab/micropython-ulab url = https://github.com/Neutree/micropython-ulab.git +[submodule "components/micropython/core"] + path = components/micropython/core + url = https://github.com/micropython/micropython.git diff --git a/components/micropython/core b/components/micropython/core new file mode 160000 index 000000000..0bfd55afb --- /dev/null +++ b/components/micropython/core @@ -0,0 +1 @@ +Subproject commit 0bfd55afbe8eb798a806605a735fb3a68dee07a0 From fc80b196f4182e3570007c50fa9376ee56067e55 Mon Sep 17 00:00:00 2001 From: JishinMaster Date: Fri, 24 Apr 2020 17:31:38 +0200 Subject: [PATCH 5/7] Removed submodule --- .gitmodules | 3 --- components/micropython/port/src/lvgl/lv_bindings | 1 - 2 files changed, 4 deletions(-) delete mode 160000 components/micropython/port/src/lvgl/lv_bindings diff --git a/.gitmodules b/.gitmodules index c51b13434..405c298f6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "tools/flash/kflash_py"] path = tools/flash/kflash_py url = https://github.com/sipeed/kflash.py.git -[submodule "components/micropython/port/src/lvgl/lv_bindings"] - path = components/micropython/port/src/lvgl/lv_bindings - url = https://github.com/littlevgl/lv_binding_micropython.git [submodule "components/spiffs/core"] path = components/spiffs/core url = https://github.com/pellepl/spiffs.git diff --git a/components/micropython/port/src/lvgl/lv_bindings b/components/micropython/port/src/lvgl/lv_bindings deleted file mode 160000 index 4a6412b5e..000000000 --- a/components/micropython/port/src/lvgl/lv_bindings +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4a6412b5e4550b60f0ae57b81db62e88af2c3c1a From b9491f5bef1e1d7b5fb04650093ffa878955e978 Mon Sep 17 00:00:00 2001 From: JishinMaster Date: Fri, 24 Apr 2020 17:37:23 +0200 Subject: [PATCH 6/7] upgrade lvgl_bindings submodule to latest micropython API --- .gitmodules | 3 +++ components/micropython/port/src/lvgl/lv_bindings | 1 + 2 files changed, 4 insertions(+) create mode 160000 components/micropython/port/src/lvgl/lv_bindings diff --git a/.gitmodules b/.gitmodules index 405c298f6..e4d669e8e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,3 +20,6 @@ [submodule "components/micropython/core"] path = components/micropython/core url = https://github.com/micropython/micropython.git +[submodule "components/micropython/port/src/lvgl/lv_bindings"] + path = components/micropython/port/src/lvgl/lv_bindings + url = https://github.com/JishinMaster/lv_binding_micropython.git diff --git a/components/micropython/port/src/lvgl/lv_bindings b/components/micropython/port/src/lvgl/lv_bindings new file mode 160000 index 000000000..163faed53 --- /dev/null +++ b/components/micropython/port/src/lvgl/lv_bindings @@ -0,0 +1 @@ +Subproject commit 163faed53369a9dc65e0ada916539c5772c3bc49 From 7fea04392003b46901f7ee7415939699b0b94d85 Mon Sep 17 00:00:00 2001 From: JishinMaster Date: Fri, 18 Dec 2020 12:24:17 +0100 Subject: [PATCH 7/7] updated submodules --- .gitmodules | 2 +- .../kendryte_sdk/kendryte-standalone-sdk | 2 +- components/micropython/CMakeLists.txt | 21 ++++++++++++++++++- components/micropython/core | 2 +- .../micropython/port/src/lvgl/lv_bindings | 2 +- .../micropython/port/src/moduhashlib_maixpy.c | 2 +- components/micropython/port/src/mphalport.c | 4 ++-- .../micropython/port/src/mpthreadport.c | 2 +- .../port/src/ulab/micropython-ulab | 2 +- components/spiffs/core | 2 +- tools/flash/kflash_py | 2 +- tools/kconfig/Kconfiglib | 2 +- tools/spiffs/mkspiffs | 2 +- 13 files changed, 33 insertions(+), 14 deletions(-) diff --git a/.gitmodules b/.gitmodules index e4d669e8e..f010b9483 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,7 +16,7 @@ url = https://github.com/igrr/mkspiffs.git [submodule "components/micropython/port/src/ulab/micropython-ulab"] path = components/micropython/port/src/ulab/micropython-ulab - url = https://github.com/Neutree/micropython-ulab.git + url = https://github.com/v923z/micropython-ulab.git [submodule "components/micropython/core"] path = components/micropython/core url = https://github.com/micropython/micropython.git diff --git a/components/kendryte_sdk/kendryte-standalone-sdk b/components/kendryte_sdk/kendryte-standalone-sdk index 7fdb511fe..9d3274d2f 160000 --- a/components/kendryte_sdk/kendryte-standalone-sdk +++ b/components/kendryte_sdk/kendryte-standalone-sdk @@ -1 +1 @@ -Subproject commit 7fdb511fe61026eec5874885de5981c4f60f664d +Subproject commit 9d3274d2f9423f8ac9ee44015947b3c83a6bba2d diff --git a/components/micropython/CMakeLists.txt b/components/micropython/CMakeLists.txt index bdecbd9f0..5b5b17a07 100644 --- a/components/micropython/CMakeLists.txt +++ b/components/micropython/CMakeLists.txt @@ -356,7 +356,25 @@ if(CONFIG_COMPONENT_MICROPYTHON_ENABLE) # ulab if(CONFIG_MICROPYTHON_ULAB_ENALBE) list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code") - append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/approx") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/compare") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/fft") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/filter") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/linalg") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/numerical") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/poly") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/user") + list(APPEND ADD_INCLUDE "${mpy_port_dir}/src/ulab/micropython-ulab/code/vector") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/approx") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/compare") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/fft") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/filter") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/linalg") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/numerical") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/poly") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/user") + append_srcs_dir(ADD_SRCS "port/src/ulab/micropython-ulab/code/vector") endif() if(CONFIG_MICROPY_SSL_ENABLE) @@ -537,3 +555,4 @@ if(CONFIG_COMPONENT_MICROPYTHON_ENABLE) endif() + diff --git a/components/micropython/core b/components/micropython/core index 0bfd55afb..069557ede 160000 --- a/components/micropython/core +++ b/components/micropython/core @@ -1 +1 @@ -Subproject commit 0bfd55afbe8eb798a806605a735fb3a68dee07a0 +Subproject commit 069557edef84a4f37ad52ae93838129da8e5fe77 diff --git a/components/micropython/port/src/lvgl/lv_bindings b/components/micropython/port/src/lvgl/lv_bindings index 163faed53..3a0706fee 160000 --- a/components/micropython/port/src/lvgl/lv_bindings +++ b/components/micropython/port/src/lvgl/lv_bindings @@ -1 +1 @@ -Subproject commit 163faed53369a9dc65e0ada916539c5772c3bc49 +Subproject commit 3a0706feeefbc22a243e49195014637d57b4680d diff --git a/components/micropython/port/src/moduhashlib_maixpy.c b/components/micropython/port/src/moduhashlib_maixpy.c index 7d1485ff1..8fafb6548 100644 --- a/components/micropython/port/src/moduhashlib_maixpy.c +++ b/components/micropython/port/src/moduhashlib_maixpy.c @@ -49,7 +49,7 @@ STATIC mp_obj_t uhashlib_sha256_update(mp_obj_t self_in, mp_obj_t arg) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ); self->total_len += bufinfo.len; - sha256_update_length(self->total_len); + //sha256_update_length(self->total_len); sha256_update((sha256_context_t*)self->state, bufinfo.buf, bufinfo.len); return mp_const_none; } diff --git a/components/micropython/port/src/mphalport.c b/components/micropython/port/src/mphalport.c index 8640b8a8e..a6bea1efc 100644 --- a/components/micropython/port/src/mphalport.c +++ b/components/micropython/port/src/mphalport.c @@ -124,8 +124,8 @@ void mp_hal_delay_ms(mp_uint_t ms) mp_uint_t dt; mp_uint_t t0 = mp_hal_ticks_us(); for (;;) { - extern void mp_handle_pending(); - mp_handle_pending(); + extern void mp_handle_pending(bool); + mp_handle_pending(true); MICROPY_PY_USOCKET_EVENTS_HANDLER MP_THREAD_GIL_EXIT(); // ulTaskNotifyTake(pdFALSE, 1); diff --git a/components/micropython/port/src/mpthreadport.c b/components/micropython/port/src/mpthreadport.c index 41a4deffe..943e3c4c5 100644 --- a/components/micropython/port/src/mpthreadport.c +++ b/components/micropython/port/src/mpthreadport.c @@ -85,7 +85,7 @@ void mp_thread_gc_others(void) { } TaskStatus_t task_status; vTaskGetInfo(th->id, &task_status,(BaseType_t)pdFALSE,(eTaskState)eInvalid); - gc_collect_root((void**)task_status.pxStackTop, ( (uint64_t)th->stack + (th->stack_len*sizeof(StackType_t)+1024) - (uint64_t)task_status.pxStackTop)/sizeof(void*)); + gc_collect_root((void**)task_status.pxStackBase, ( (uint64_t)th->stack + (th->stack_len*sizeof(StackType_t)+1024) - (uint64_t)task_status.pxStackBase)/sizeof(void*)); } mp_thread_mutex_unlock((mp_thread_mutex_t*)&thread_mutex); } diff --git a/components/micropython/port/src/ulab/micropython-ulab b/components/micropython/port/src/ulab/micropython-ulab index a844e1bfb..c71920e18 160000 --- a/components/micropython/port/src/ulab/micropython-ulab +++ b/components/micropython/port/src/ulab/micropython-ulab @@ -1 +1 @@ -Subproject commit a844e1bfb94ab1a3a6da142661faaf10f9218e05 +Subproject commit c71920e18636a1e8350cb22d53b119221e0318fc diff --git a/components/spiffs/core b/components/spiffs/core index ec68ba820..9d12e8f47 160000 --- a/components/spiffs/core +++ b/components/spiffs/core @@ -1 +1 @@ -Subproject commit ec68ba8208d7550860e4e78299d58a529b88bf85 +Subproject commit 9d12e8f47b0e611f277a0de8d39dc9089971ce20 diff --git a/tools/flash/kflash_py b/tools/flash/kflash_py index 1ef6f4c0b..6ac51ec43 160000 --- a/tools/flash/kflash_py +++ b/tools/flash/kflash_py @@ -1 +1 @@ -Subproject commit 1ef6f4c0b2cb8b1872b6ffe9337f4e02d5487fa6 +Subproject commit 6ac51ec4314c9cc4293f7597e317f67846062935 diff --git a/tools/kconfig/Kconfiglib b/tools/kconfig/Kconfiglib index 53c72959a..061e71f7d 160000 --- a/tools/kconfig/Kconfiglib +++ b/tools/kconfig/Kconfiglib @@ -1 +1 @@ -Subproject commit 53c72959ac4d71f99913e4b0eea99261a6585430 +Subproject commit 061e71f7d78cb057762d88de088055361863deff diff --git a/tools/spiffs/mkspiffs b/tools/spiffs/mkspiffs index 983970e40..f24829657 160000 --- a/tools/spiffs/mkspiffs +++ b/tools/spiffs/mkspiffs @@ -1 +1 @@ -Subproject commit 983970e40ff381d95d68a9bddff70c4d9921021b +Subproject commit f2482965703b9b4031a5d4797bfd7458016bf3d2