[squeak-dev] Re: Delay time question

Robert F. Scheer rfscheer at speakeasy.net
Fri Feb 29 05:11:28 UTC 2008


On Thu, 2008-02-28 at 20:26 +0100, Bert Freudenberg wrote:
> On Feb 28, 2008, at 20:26 , Robert F. Scheer wrote:
> > My conclusion is not to use 1ms delays anywhere in the time critical
> > loops of the robot.  I'm off to look at the interprocess semaphore
> > methods that David and Andreas have alluded to.  It looks like C  
> > serial
> > handlers are the way to go atm.
> 
> Well, I had satisfactory results reading from a pipe using AsyncFile  
> (had to add a utility method though):
> 
> 	http://tinlizzie.org/updates/olpc/updates/0995sugar-bf.cs
> 
> In this code, #readChar blocks until data is actually available - it  
> might work to just open /dev/tty... and start reading in a process,  
> similar to what I did in #fetchCommandsFrom:.
> 
> - Bert -
> 
> 
> 

This is tantalizingly close to working.  I can open, close and write
something to serial ports as pipes with the AsyncFile methods but can't
successfully read.  As Jon Hylands pointed out, it's probably because
they have no ability to negotiate baud rates and other minor serial port
stuff.  

The exciting part was opening '/dev/ttyUSB0' instead of having to
symlink ttySx to ttyUSBx and pretending the USB port is a tty.

But at this point, I don't see how to get it working with serial lines
unless I put C handlers in the way and use maybe RAM disk shared files
as transfer pipes.

- Robert




More information about the Squeak-dev mailing list