I'm in the process of getting MODBUS working on uPython (using modbus_tk) and am in need of a bit of help on the C side of things.
The modbus_tk code depends on the struct CPython standard library which has yet to be implemented in C for uPython. My plan is to implement the un/pack methods in /micropython/py/struct.c (and whatever else is required to support the modbus_tk python library). I then want to make struct.c an optionally importable uPython library (i.e. import struct) but am unsure how to achieve this.
Can anybody provide a bit of guidance?
C Library Import Framework
Re: C Library Import Framework
I'm travelling now, so didn't have time to answer your previous mails in detail yet, but here's a quick link for the simplest module in the codebase: https://github.com/micropython/micropyt ... nix/time.c (And again, playing with "unix" version is one seamless way to start hacking with micropython ).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: C Library Import Framework
FYI, I started implementing struct module.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: C Library Import Framework
struct module now should have more or less complete functionality.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/