8000 MicroPython external C modules · Issue #1752 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

MicroPython external C modules #1752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
8000 dmazzella opened this issue Apr 5, 2019 · 6 comments
Closed

MicroPython external C modules #1752

dmazzella opened this issue Apr 5, 2019 · 6 comments
Milestone

Comments

@dmazzella
Copy link

why build MicroPython external C modules capability was removed?

interest in a PR for it?

@dhalbert
Copy link
Collaborator
dhalbert commented Apr 5, 2019

Nothing was removed. Could you point to the MicroPython PR you have in mind? You're talking about a runtime import of a native module, not a module precompiled into the firmware, right? We haven't merged from upstream in several months.

@dmazzella
Copy link
Author

#4195

@dhalbert dhalbert added this to the Lo 8000 ng term milestone Apr 5, 2019
@dhalbert
Copy link
Collaborator
dhalbert commented Apr 5, 2019

OK, thought you were talking about micropython#1627 or similar. That PR is after our last merge from micropython. I see this is a build-convenience mechanism: you still need to know how to implement native modules.

Our build structure is slightly different these days, so there would need to be some changes on the original MicroPython PR. If you'd like to work on a PR, that would be fine, maybe with a sample module as well. Do you have an existing specialized module you're trying to compile in?

@dmazzella
Copy link
Author

PR is #1754, for test you can see USER_C_MODULES

@dmazzella
Copy link
Author

cmodules.zip

unzip into root folder of circuitpython:

MBP-di-Damiano:~/projects/circuitpython$ make -j12 BOARD=pca10059 SD=s140 USER_C_MODULES=$(pwd)/cmodules -C ports/nrf/
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Including User C Module from /Users/damianomazzella/projects/circuitpython/cmodules/example

usage:

Adafruit CircuitPython 4.0.0-beta.6-43-gb9e37818e-dirty on 2019-04-05; PCA10059 nRF52840 Dongle with nRF52840
>>> 
>>> 
>>> import example
>>> example.
__class__       __name__        add_ints
>>> example.add_ints(1, 2)
3
>>>

@dmazzella
Copy link
Author

thanks for merge #1754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0