Search found 8 matches

by tim3385
Wed Dec 18, 2019 9:47 am
Forum: Development of MicroPython
Topic: How to soft reset the whole context of upy when process running?
Replies: 3
Views: 3001

Re: How to soft reset the whole context of upy when process running?

At the beginning, there was no mp_stack_set_top(...). I just tried it after I encounter this problem. Now I just in ports/windows/mpconfigport.h(javascript port has no MICROPY_STACK_CHECK define originally) #define MICROPY_STACK_CHECK (0) Hope there no other problems~~ ps. My applicataion need run i...
by tim3385
Thu Nov 14, 2019 6:36 pm
Forum: Development of MicroPython
Topic: How to get a ll out of an objint (inverse of mp_obj_new_int_from_ll)
Replies: 4
Views: 3778

Re: How to get a ll out of an objint (inverse of mp_obj_new_int_from_ll)

Thanks for your
std::uint64_t mpz_to_64bit_int(const mp_obj_int_t* arg, bool is_signed).
I want to use it to get uint64_t from mp_obj_t which is a number in upy code.

But how to get mp_obj_int_t* from a mp_obj_t? MP_OBJ_TO_PTR is a violent way and cause mpz_to_64bit_int crash.

Thank you.
by tim3385
Sat Nov 09, 2019 3:21 am
Forum: Development of MicroPython
Topic: How to soft reset the whole context of upy when process running?
Replies: 3
Views: 3001

Re: How to soft reset the whole context of upy when process running?

This is my code refer from some ports implementation. upy works but soft-reset not works yet. #if MICROPY_ENABLE_GC long heap_size = 1024*1024 * (sizeof(mp_uint_t) / 4); #endif static char *heap = NULL; void __wxpyInit(void) { #if MICROPY_PY_THREAD mp_thread_init(); #endif mp_stack_ctrl_init(); stat...
by tim3385
Sat Nov 09, 2019 3:21 am
Forum: Development of MicroPython
Topic: How to soft reset the whole context of upy when process running?
Replies: 3
Views: 3001

How to soft reset the whole context of upy when process running?

THIS TOPIC IS MOVED FROM ISSUES OF GITHUB(Please remove the topic that I post in "General Discussion and Questions"): I integrated upy into my project(Thanks for your great work). upy works well in my project process. In one running process, the python script file(A in short) could be reloaded when ...
by tim3385
Thu Nov 07, 2019 4:23 pm
Forum: General Discussion and Questions
Topic: How to soft reset the whole context of upy when process running?
Replies: 1
Views: 1261

Re: How to soft reset the whole context of upy when process running?

This is my code refer from some ports implementation. upy works but soft-reset not works yet. #if MICROPY_ENABLE_GC long heap_size = 1024*1024 * (sizeof(mp_uint_t) / 4); #endif static char *heap = NULL; void __wxpyInit(void) { #if MICROPY_PY_THREAD mp_thread_init(); #endif mp_stack_ctrl_init(); stat...
by tim3385
Thu Nov 07, 2019 4:19 pm
Forum: General Discussion and Questions
Topic: How to soft reset the whole context of upy when process running?
Replies: 1
Views: 1261

How to soft reset the whole context of upy when process running?

THIS TOPIC IS MOVED FROM ISSUES OF GITHUB: I integrated upy into my project(Thanks for your great work). upy works well in my project process. In one running process, the python script file(A in short) could be reloaded when it was modified. But another python script file(B in short) that imported b...
by tim3385
Thu Nov 07, 2019 4:17 pm
Forum: General Discussion and Questions
Topic: Python file can't import another py file
Replies: 1
Views: 1878

Re: Python file can't import another py file

Importing py files in WASM works. But I am not sure if my method is correct. Here's what I did: 1)mp_lexer_new_from_file() in lexer.c was enabled by set "#define MICROPY_READER_POSIX (1)" in ports/javascript/mpconfigport.h. And comment the mp_lexer_new_from_file() define in the ports/javascript/main...
by tim3385
Mon Aug 05, 2019 3:41 am
Forum: General Discussion and Questions
Topic: Python file can't import another py file
Replies: 1
Views: 1878

Python file can't import another py file

I embed javascript port into my emscripten application. mp_js_do_str works fine in my c code. And that pyexec_file invoke a python file is fine too. i.e. upy works in web application. But The python file can't "import" another module which is also a python file in the same directory. I test it in em...