Changeset 413 for ISPProgrammer
- Timestamp:
- Aug 16, 2012, 12:59:53 PM (12 years ago)
- Location:
- ISPProgrammer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ISPProgrammer/Dallas/UDallasProgrammer.pas
r410 r413 8 8 Classes, SysUtils, USerialPort, UCommSerialPort, UCommPin, UCommMark, 9 9 UJobProgressView, SyncObjs, DateUtils, Dialogs, URegistry, 10 Forms, UISPProgrammer, Registry, UBinarySerializer, SpecializedList; 10 Forms, UISPProgrammer, Registry, UBinarySerializer, SpecializedList, 11 UCommTelnet; 11 12 12 13 const … … 135 136 136 137 procedure TDallasProgrammer.SetActive(AValue: Boolean); 138 var 139 SerialPort: TCommSerialPort; 140 Telnet: TCommTelnet; 137 141 begin 138 142 if Active = AValue then Exit; … … 144 148 HexData := TStringList.Create; 145 149 146 SerialPort.Active := False; 147 SerialPortBackup.Assign(SerialPort); 148 SerialPortBackupPin := SerialPort.Pin.RemotePin; 149 SerialPort.Pin.Disconnect; 150 151 //SerialPort.Name := SerialPort.Name; 152 SerialPort.FlowControl := fcNone; 153 SerialPort.BaudRate := BaudRate; 154 SerialPort.DTR := True; 155 SerialPort.Pin.Connect(CommMark.PinRaw); 156 SerialPort.Flush; 157 SerialPort.Purge; 158 SerialPort.Active := True; 159 if Assigned(FOnLogData) then 160 Pin.OnLogData := FOnLogData; 150 if ExtPin.Connected and (ExtPin.RemotePin.Node is TCommSerialPort) then begin 151 SerialPort := TCommSerialPort(ExtPin.RemotePin.Node); 152 SerialPort.Active := False; 153 SerialPortBackup.Assign(SerialPort); 154 SerialPortBackupPin := SerialPort.Pin.RemotePin; 155 SerialPort.Pin.Disconnect; 156 157 //SerialPort.Name := SerialPort.Name; 158 SerialPort.SerialPort.FlowControl := fcNone; 159 SerialPort.SerialPort.BaudRate := BaudRate; 160 SerialPort.SerialPort.DTR := True; 161 SerialPort.Pin.Connect(CommMark.PinRaw); 162 SerialPort.SerialPort.Flush; 163 SerialPort.SerialPort.Purge; 164 SerialPort.Active := True; 165 if Assigned(FOnLogData) then 166 Pin.OnLogData := FOnLogData; 167 end; 168 if ExtPin.Connected and (ExtPin.RemotePin.Node is TCommTelnet) then begin 169 Telnet := TCommTelnet(ExtPin.RemotePin.Node); 170 end; 161 171 ResponseClear; 162 172 CommMark.Active := True; 163 164 173 ReadIdentification; 165 174 end else begin 166 175 CommMark.Active := False; 167 SerialPort.Active := False; 168 SerialPort.Assign(SerialPortBackup); 169 SerialPort.Pin.Connect(SerialPortBackupPin); 170 SerialPort.Active := True; 176 if ExtPin.Connected and (ExtPin.RemotePin.Node is TCommSerialPort) then begin 177 SerialPort := TCommSerialPort(ExtPin.Node); 178 SerialPort.Active := False; 179 SerialPort.Assign(SerialPortBackup); 180 SerialPort.Pin.Connect(SerialPortBackupPin); 181 SerialPort.Active := True; 182 end; 183 if ExtPin.Connected and (ExtPin.RemotePin.Node is TCommTelnet) then begin 184 Telnet := TCommTelnet(ExtPin.RemotePin.Node); 185 end; 171 186 HexData.Free; 172 187 Request.Free; … … 359 374 Mark := TListByte.Create; 360 375 Mark.SetArray([13, 10]); 361 CommMark := TCommMark.Create ;376 CommMark := TCommMark.Create(nil); 362 377 CommMark.Mark.Assign(Mark); 363 378 CommMark.PinFrame.Connect(Pin); 364 379 BaudRate := 9600; 365 SerialPortBackup := TCommSerialPort.Create ;380 SerialPortBackup := TCommSerialPort.Create(nil); 366 381 end; 367 382 -
ISPProgrammer/UISPProgrammer.pas
r406 r413 6 6 7 7 uses 8 Classes, SysUtils, Registry, UIntelHexFile, UCommSerialPort,9 UCPUType, UJobProgressView ;8 Classes, SysUtils, Registry, UIntelHexFile, 9 UCPUType, UJobProgressView, UCommPin; 10 10 11 11 type … … 31 31 HexFile: TIntelHexFile; 32 32 FileName: string; 33 SerialPort: TCommSerialPort;34 33 Capabilities: TISPProgCapabilities; 34 ExtPin: TCommPin; 35 35 procedure Log(Text: string); 36 36 procedure LoadFromRegistry(Root: HKEY; Key: string); virtual; … … 130 130 constructor TISPProgrammer.Create; 131 131 begin 132 ExtPin := TCommPin.Create; 132 133 HexFile := TIntelHexFile.Create; 133 134 HexFile.BytePerLine := 20; 134 SerialPort := nil;135 135 end; 136 136 … … 138 138 begin 139 139 Active := False; 140 ExtPin.Free; 140 141 HexFile.Free; 141 142 inherited Destroy;
Note:
See TracChangeset
for help on using the changeset viewer.