Search found 629 matches

by jickster
Thu Oct 26, 2017 3:26 pm
Forum: Development of MicroPython
Topic: [SOLVED]"missing" bytecode 0x81?
Replies: 3
Views: 2853

Re: "missing" bytecode 0x81?

pythoncoder wrote:
Thu Oct 26, 2017 7:20 am
bc0.h has

Code: Select all

#define MP_BC_LOAD_CONST_SMALL_INT_MULTI (0x70) // + N(64)
I think this means that immediate values in a 6 bit range are added to the bytecode so that bytecodes 0x70-0xaf are emitted. So bytecode 0x81 has an immediate value of 17 (base 10) encoded.
What is immediate value?
by jickster
Thu Oct 26, 2017 3:24 pm
Forum: Development of MicroPython
Topic: [SOLVED]Macros in mpconfigport.h have ZERO documentation
Replies: 2
Views: 2358

Re: Macros in mpconfigport.h have ZERO documentation

There's no need to duplicate that for each and every port. Just look them up in mpfonfig.h (if that takes a lot of time you are using a crappy text editor and cannot really blame the code for it), where pretty much all of them have one or more documentation. If that is not sufficient paste the macr...
by jickster
Wed Oct 25, 2017 7:42 pm
Forum: Development of MicroPython
Topic: MICROPY_PERSISTENT_CODE discussion
Replies: 7
Views: 5105

MICROPY_PERSISTENT_CODE discussion

mpconfig.h // Whether generated code can persist independently of the VM/runtime instance // This is enabled automatically when needed by other features #ifndef MICROPY_PERSISTENT_CODE #define MICROPY_PERSISTENT_CODE (MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE || MICROPY_MODULE_FRO...
by jickster
Wed Oct 25, 2017 6:45 pm
Forum: Development of MicroPython
Topic: [SOLVED]"missing" bytecode 0x81?
Replies: 3
Views: 2853

[SOLVED]"missing" bytecode 0x81?

This is main.py led = pyb.LED(1) This is the frozen main.mpy // frozen bytecode for file main.py, scope main_<module> STATIC const byte bytecode_data_main__lt_module_gt_[30] = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, MP_QSTR__lt_module_gt_ & 0xff, MP_QSTR__lt_module_gt_ >> 8, MP_QSTR_main_dot_py ...
by jickster
Wed Oct 25, 2017 6:11 pm
Forum: Development of MicroPython
Topic: [SOLVED]bytecode documentation?
Replies: 1
Views: 1739

[SOLVED]bytecode documentation?

Is there documentation for each bytecode like how many arguments it takes, what it does, etc?
by jickster
Wed Oct 25, 2017 6:08 pm
Forum: Development of MicroPython
Topic: mpy-tool.py - possible to map bytecode to .py file?
Replies: 0
Views: 1563

mpy-tool.py - possible to map bytecode to .py file?

Background When you wanna turn a .py into compiled code - .mpy - you use mpy-cross.exe . Then, you can create frozen code from those .mpy using tools/mpy-tool.py ; the output is a c-file with the decompiled .mpy in a C-array of bytes. Issue It would be REALLY nice if on each line of the c-array the...
by jickster
Wed Oct 25, 2017 2:52 pm
Forum: Development of MicroPython
Topic: [SOLVED]what is sequence of calls to .make_new
Replies: 1
Views: 1682

[SOLVED]what is sequence of calls to .make_new

I'm getting stuck trying to figure out sequence of C-code for when

Code: Select all

make_new
C-code is called for pyb.LED

What's the sequence?

Let's say I have this .py

Code: Select all

ledObj = pyb.LED(1)
by jickster
Wed Oct 25, 2017 1:37 pm
Forum: Development of MicroPython
Topic: [SOLVED]Macros in mpconfigport.h have ZERO documentation
Replies: 2
Views: 2358

[SOLVED]Macros in mpconfigport.h have ZERO documentation

Someone please add some comments - one line per MACRO - in mpconfigport.h; PLEASE.
It would save an enormous amount of time both individually and cumulatively.
by jickster
Tue Oct 24, 2017 3:12 pm
Forum: Development of MicroPython
Topic: [SOLVED]memzip vs frozen - what's the difference?
Replies: 4
Views: 3574

Re: memzip vs frozen - what's the difference?

memzip was created specifically for the teensy and existed long before frozen. Once frozen was introduced, the teensy port supported both (but only one at a time). memzip supports uncompressed zip files (i.e. a zipfile containing only uncompressed files) used as a read-only file system. I chose thi...
by jickster
Fri Oct 20, 2017 3:04 pm
Forum: Development of MicroPython
Topic: Calling a python function from C
Replies: 14
Views: 28655

Re: Calling a python function from C

Here's an example of calling a python function from C: https://github.com/micropython/micropython/blob/master/stmhal/pin.c#L118 If you search for mp_call_function in the stmhal directory you'll see several other examples. The link is dead. Please post another one showing how to call Python from C.