On 08 Jul 2013, at 12:09, Dennis Poon wrote: > > However, when I extract the relevant code from that example and use the > normal fpc compiler (2.6.0) instead of the pparm (2.6.2) and special fp lib > inside that zip, my program freezes on synapser.pas TBlockSerial.Connect > at the line of fopen(FDevice, 0_RDWR or 0_SYNC).
Well, I recently had a similar issue, on Mac OS X and an USB to Serial converter (which had an FTDI chipset) -- maybe this issue is similar. The fix was really quite easy, but it took me a while to find out. Assume your fpOpen() call returns a handle called `Handle`. Now add the following lines after your open call: ===Code=== Var Attr: TTermios; tcgetattr(Handle, @Attr); Attr.c_cflag:= Attr.c_cflag or CREAD or CLOCAL; // --> This is the line that fixed the issue //Do fix your other attributes here aswell, like ispeed, ospeed, etc... tcsetattr(Handle, TCSADRAIN, @Attr); // Take a look at the documentation of this call to see what constant (TCSADRAIN) you want to use. ===EOC=== Hope it helps! -- Ewald
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal