[squeak-dev] FFI calls to functions that expect pointers to write results into

Herbert König herbertkoenig at gmx.net
Fri Feb 6 20:59:24 UTC 2015


Hie Doug,
Am 05.02.2015 um 18:00 schrieb Douglas McPherson:
> The /dev/mem provided by the FFI interfaces is immensely faster. For 
> example I hooked up photocell and capacitor on a GPIO as sort of a 
> (very) poor mans ADC to read the resistance of the photocell. Driving 
> the GPIO low and then reversing the GPIO direction and polling 
> continuously until it comes high was a way to measure the relative 
> time it takes the circuit to charge. 
I can appreciate that (EE background :-))
> It would be great to collaborate on and publish a package to wrap 
> GPIO, I2C, and PWM functionalities. I think we should combine our 
> efforts with Tim’s too, as he has been using the wiringPi library via 
> FFI for /dev/mem access, which is probably a better choice than the 
> cobbled together library I used. I think we should include the file 
> i/o based access methods for both GPIO and I2C since it gives some 
> measure of portability to other Linux systems (such as the BeagleBone 
> Black).

Definitely yes to all. I'll cook up some documentation, then send you my 
code. It's a mere 12K fileout.

Right now I have the problem that it crashes the Pi after about 12 
hours, no signs of warning. The Pi is unwilling to start another 
process. In the X server I can't open other programs any more and if I 
try to SSH into the Pi it says 'The computer is not willing to start a 
shell'.

Dunno if it's the latest Raspbian update or my use of OSProcess or GPIO. 
So I started everything on a not updated Pi. Half a day between Errors 
is not nice to debug :-)) I had two crashes up to now. Tomorrow I'll 
know more.

Cheers,

Herbert




More information about the Squeak-dev mailing list