Changeset 36


Ignore:
Timestamp:
Aug 4, 2010, 9:15:16 AM (14 years ago)
Author:
george
Message:
  • Přidáno: Třída generického seznamu (TGenericList) pro Free Pascal.
Files:
8 added
1 edited

Legend:

Unmodified
Added
Removed
  • Comm/CommPort.pas

    r2 r36  
    44{     barry@audit.kharkov.com       }
    55
     6// Modified date: 2010-07-29
     7
    68unit CommPort;
    79
     
    1113  Windows, Messages, SysUtils, Classes, Graphics, Controls,
    1214  Forms, Dialogs, ExtCtrls;
     15
     16const
     17  WaitTime = 10;
    1318
    1419type
     
    470475      LeaveCriticalSection(FComPort.WriteSection);
    471476      if FComPort.FKillThreads then Break;
    472       Sleep(10);
     477      Sleep(WaitTime);
    473478    end
    474     else Sleep(10);
     479    else Sleep(WaitTime);
    475480  until FComPort.FKillThreads or Terminated;
    476481  SetEvent(FComPort.wEvent);
     
    509514  SetEvent(FComPort.rEvent);
    510515  Repeat
    511     if WaitForSingleObject(FcomPort.ReadReadyEvent, 500) = WAIT_OBJECT_0 then begin
     516    if WaitForSingleObject(FcomPort.ReadReadyEvent, WaitTime) = WAIT_OBJECT_0 then begin
    512517      if FComPort.FKillThreads then Break;
    513518      if FComPort.Enabled then
     
    595600    if FcomPort.FKillThreads then Break;
    596601    OK := WaitCommEvent(FComHandle, FStatus, @SOL);
    597     if Not OK then Sleep(10);
     602    if Not OK then Sleep(WaitTime);
    598603    if FcomPort.FKillThreads then Break;
    599604    if (not OK) and (GetLastError = ERROR_IO_PENDING) then begin
     
    725730    FKillThreads := False;
    726731    StatusThread := TStatusThread.Create(Self, FMonitorEvents);
    727     WaitForSingleObject(sEvent, 10);
     732    WaitForSingleObject(sEvent, WaitTime);
    728733    SetCommMask(FComHandle, EV_BREAK or EV_CTS or EV_DSR or EV_ERR or
    729734                       EV_RING or EV_RLSD or EV_RXCHAR or EV_TXEMPTY);
    730735    ReadThread := TReadThread.Create(Self);
    731     WaitForSingleObject(rEvent, 10);
     736    WaitForSingleObject(rEvent, WaitTime);
    732737    WriteThread := TWriteThread.Create(Self);
    733     WaitForSingleObject(wEvent, 10);
     738    WaitForSingleObject(wEvent, WaitTime);
    734739    FOpen := True;
    735740    if Assigned(FOnOpen) then
     
    883888{Errorflags for OnErrorSignal
    884889 CE_BREAK       The hardware detected a break condition.
    885  CE_DNS         Windows 95 only: A parallel device is not selected.
     890 CE_DNS         Windows 95 only: A parallel device is not selected.
    886891 CE_FRAME       The hardware detected a framing error.
    887  CE_IOE         An I/O error occurred during communications with the device.
     892 CE_IOE         An I/O error occurred during communications with the device.
    888893 CE_MODE        The requested mode is not supported, or the hFile parameter
    889894                is invalid. If this value is specified, it is the only valid error.
    890  CE_OOP         Windows 95 only: A parallel device signaled that it is out of paper.
     895 CE_OOP         Windows 95 only: A parallel device signaled that it is out of paper.
    891896 CE_OVERRUN     A character-buffer overrun has occurred. The next character is lost.
    892  CE_PTO         Windows 95 only: A time-out occurred on a parallel device.
     897 CE_PTO         Windows 95 only: A time-out occurred on a parallel device.
    893898 CE_RXOVER      An input buffer overflow has occurred. There is either no
    894899                room in the input buffer, or a character was received after
Note: See TracChangeset for help on using the changeset viewer.