Though I have not yet tested your code, thank you for your great example.
is it possible to write code for PRU in C?
Yes, there is a beta C compiler from TI ( you have to ask Jason Kridner for it ), and CCS 6 comes with it too I’ve been told( I do not use CCS personally ).
The Beta C compiler is downloadable from:
under the “PRU Code Generation Tools” section. IIRC, you need to create a log in and fill in a request form.
There’s also a project to port GCC located at:
that I’ve not yet tried.
The GCC compiler last I heard was not complete, or even really all that usable for more than a couple things.