Is there any current documentation for "external c modules"? #17437
-
I want to add an external C based module and started with the documentation found at MicroPython external C modules. It is good as a starting point but lacks of any in depth documentation. After looking around I found the micropython-usermod’s documentation. Unfortunately, when trying to add a class I realized that this seems to be outdated. Where to find an up-to-date documentation available related to the external C modules? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Unfortunately, there isn't much documentation available. To get a deeper understanding, you just need to read the code. You may also find the files under "micropython/examples/usercmodule" helpful. This URL, https://mpy-c-gen.oliverrobson.tech/, may be useful for writing the C stub. I hope these are still accurate. You might also find my repository, https://github.com/shariltumin/c-module-tutorial-micropython, helpful. |
Beta Was this translation helpful? Give feedback.
@poWer4aiX check
micropython/extmod/modsocket.c
Line 530 in 5f058e9
the new way is using this
MP_DENIFE_CONST_OBJ_TYPE
macro function 👍🏼