MicroPython external C modules - C++ and threading #10493
Replies: 4 comments 4 replies
-
In C one doesn't need explicit casts, but C++ does, hence the error. In other words the MicroPython code here is not C++-compatible. Can you change the code in the mentioned file into
and try again? |
Beta Was this translation helpful? Give feedback.
-
Yes sorry my mistake, typo, that should be indeed
|
Beta Was this translation helpful? Give feedback.
-
Yes, it works with both C and C++
I would like to do it but I am not familiar with the PR process, however I would be glad to be guided so that I can learn how to do it ! |
Beta Was this translation helpful? Give feedback.
-
It's a bit hard to find a good and complete explanation apparently, but this should get you started: glance over https://github.com/micropython/micropython/blob/master/CONTRIBUTING.md (not all super relevant for a one-line change, but still worth reading) then check the instructions here for example: https://gist.github.com/Chaser324/ce0505fbed06b947d962 (until 'Submitting', rest is not relevant). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I need the threading mechanism, therefore CFLAGS_EXTRA="-DMICROPY_PY_THREAD=1".
The C example works fine, the add_ints() can be imported and called with success from python.
However, while compiling the cpp example, I get:
The make command:
I have seen this answer: https://github.com/orgs/micropython/discussions/10023#discussioncomment-4234225, but I need the threading module.
Thanks in advance for help.
Beta Was this translation helpful? Give feedback.
All reactions