It will be free software, so some ideas would be taken...
Send from my Samsung Galaxy Note II
--
--
You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
Site: http://groups.google.com/group/python-on-a-chip
--- You received this message because you are subscribed to the Google Groups "python-on-a-chip" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-on-a-chip+unsubscribe@googlegroups.com.
> Yes there is a way for p14p to "handle interrupt driven code". But you have to write it yourself in C and you definitely don't want to run it within the interrupt context. Instead, here's what you'd probably want to do:
>
> 1) Declare an enumeration for each interrupt of interest.
> 2) Create a global var to hold the value of the triggered interrupt.
> 3) In the ISR, set the global var with the enum value of that interrupt.
> 4) In the big while() loop of interp.c near the top (where it checks the reschedule flag) insert new code that checks your global var. If non-zero, launch the thread to handle the ISR.
>
> (There are some details I'm leaving out, but that's the gist)
>
The way I did it in my x86 port was filling a list with a PyObject that represented the interruption and if other thread was processing that list exit, but if not, this thread started to dispatch this objects from inside Python as events on an event-loop. This way, interruptions were really easy to manage while still very performant reliable...