Hi
I want to add that I did a second procedure that send all the data as a single buffer, that works right, the total time is as fast as expected, however I can't use that procedure except for the test.
This is the test procedure:
procedure TFMain.BlockClick(Sender: TObject);
Var
p,t,j,u,r,g,b:byte;
Pos,Lng:integer;
begin
Pos:=0;
r:=RedVal.Position;
g:=GreenVal.Position;
b:=BlueVal.Position;
Lng:=8*(1+PixelAdd1.Value-PixelAdd.Value)*
(1+TileAdd1.Value-TileAdd.Value)*
(1+JBadd1.Value-JBadd.Value)*
(1+PortAdd1.Value-PortAdd.Value);
//SetLength(Buf,Lng+1) ;
For p:=PixelAdd.Value to PixelAdd1.Value do begin
For t:=TileAdd.Value to TileAdd1.Value do begin
For j:=JBadd.Value to JBadd1.Value do begin
For u:=PortAdd.Value to PortAdd1.Value do begin
PrepPixel(Pos,r,g,b, 0, SideSel.ItemIndex,p,t,j,u);
inc(Pos,8);
end;
end;
end;
end;
Serial.WriteBuffer(Buf,Lng); //<-- this send the buffer at the correct speed.
end;
Therefore it looks like the delay happens each time the routine WriteBuffer of LazSerial is accessed, still I didn't found the problem on the LazSerial