Page 1 of 1

C Library Import Framework

Posted: Mon Mar 03, 2014 11:46 am
by roy.emmerich
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?

Re: C Library Import Framework

Posted: Tue Mar 04, 2014 2:09 am
by pfalcon
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 ;-) ).

Re: C Library Import Framework

Posted: Fri Apr 11, 2014 12:48 am
by pfalcon
FYI, I started implementing struct module.

Re: C Library Import Framework

Posted: Sat Apr 19, 2014 2:45 pm
by pfalcon
struct module now should have more or less complete functionality.