<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 08 Jul 2013, at 12:09, Dennis Poon wrote:</div><blockquote type="cite"><div bgcolor="#ffffff" text="#000000"><font class="Apple-style-span" color="#000000"><br></font><font class="Apple-style-span" size="4">
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</font><br><font class="Apple-style-span" size="4">
at the line of fopen(FDevice, 0_RDWR or 0_SYNC).</font><br></div></blockquote><div><br></div>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.</div><div><br></div><div>Assume your fpOpen() call returns a handle called `Handle`. Now add the following lines after your open call:</div><div><br></div><div>===Code===</div><div>Var Attr: TTermios;</div><div><br></div><div>tcgetattr(Handle, @Attr);</div><div><br></div><div>Attr.c_cflag:= Attr.c_cflag or CREAD or CLOCAL;<span class="Apple-tab-span" style="white-space:pre"> </span>// --> This is the line that fixed the issue</div><div>//Do fix your other attributes here aswell, like ispeed, ospeed, etc...</div><div><br></div><div>tcsetattr(Handle, TCSADRAIN, @Attr);<span class="Apple-tab-span" style="white-space:pre"> </span>// Take a look at the documentation of this call to see what constant (TCSADRAIN) you want to use.</div><div>===EOC===</div><div><br></div><div>Hope it helps!</div><div><br></div><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="font-size: medium; color: rgb(0, 0, 0); font-style: normal; ">--</div><div style="font-size: medium; color: rgb(0, 0, 0); font-style: normal; ">Ewald</div></div></span></div></div></div>
</div>
<br></body></html>