<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 21, 2020 at 12:05 PM Bo Berglund via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">So hence my question:<br>
Is there something bad about serial (built-in to fpc) that makes it<br>
unsuitable for use?<br></blockquote><div><br></div><div>In my limited experience the FPC serial unit is a bit more low level than the components such as synaser etc. There is a bit more of a learning curve and one needs to decide whether to go blocking or not and how to handle async reads etc. I needed to use custom baud rates with auto baud for an application (debugwire-gdb-bridge) so I took the time to figure out some of the details. Since then I've re-used it in other serial based applications - once you get past the learning curve of how things fit together it is relatively easy (I guess like most things). I prefer it now because it reduces external dependencies in a project.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Seems like there are virtually no posts describing solutions using<br>
serial...<br></blockquote><div><br></div><div>Here is a unit showing how to open, read and write (blocking) using the serial unit: <br></div><div><a href="https://github.com/ccrause/debugwire-gdb-bridge/blob/master/serialutils.pas">https://github.com/ccrause/debugwire-gdb-bridge/blob/master/serialutils.pas</a></div><div></div><div>Unfortunately there is other code for sending a break command and setting custom baud rates which makes it appear more complicated than it should be.<br></div></div></div>