<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 7, 2020 at 11:54 PM Michael Van Canneyt <<a href="mailto:michael@freepascal.org" target="_blank">michael@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"><br>
On Sun, 7 Jun 2020, Christo Crause via fpc-devel wrote:<br>
<br>
> I want to change the _haltproc for freertos ESP controllers to use normal<br>
> write/writeln functionality to send information to standard output. On<br>
> these targets the output is typically buffered serial provided by the OS.<br>
> Text output written just prior to setting the cpu to sleep doesn't get<br>
> sent, hence a flush is needed to complete data transmission before putting<br>
> the cpu to sleep. Looking at consoleio.OpenIO there doesn't seem to be a<br>
> convenient way to provide a flush helper function. Also the RTL Flush<br>
> procedure calls InOutFunc and not FlushFunc.<br>
><br>
> What is the proper way to hook a flush helper function into the existing<br>
> RTL infrastructure?<br>
<br>
Simply do this in InoutFunc ?<br>
<br>
Michael.<br></blockquote><div><br></div><div>Thanks for your response Michael. Using InOutFunc to also flush the output buffer will work, but that seems inefficient, since the flush needs to wait until the transmit buffer is empty (at slow UART speeds this could potentially take several ms to complete). Is there a specific reason why the RTL Flush procedure does not call the FlushFunc method?</div></div></div>