Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions programmer.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ func touch_port_1200bps(portname string, WaitForUploadPort bool) (string, error)
log.Println(ports)
portname = findNewPortName(ports, after_reset_ports)
if portname != "" {
time.Sleep(time.Millisecond * 500)
break
}
if timeout {
Expand Down
9 changes: 8 additions & 1 deletion serialport.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ func (p *serport) writerNoBuf() {
if err == nil {
h.broadcastSys <- msgJson
}

}

log.Print("Just wrote ", n2, " bytes to serial: ", string(data.data))
Expand All @@ -299,6 +298,8 @@ func (p *serport) writerNoBuf() {
log.Println(msgstr)
h.broadcastSys <- []byte(msgstr)
p.portIo.Close()
spListDual(false)
spList(false)
}

func spHandlerOpen(portname string, baud int, buftype string, isSecondary bool) {
Expand Down Expand Up @@ -360,6 +361,10 @@ func spHandlerOpen(portname string, baud int, buftype string, isSecondary bool)

sh.register <- p
defer func() { sh.unregister <- p }()

spListDual(false)
spList(false)

// this is internally buffered thread to not send to serial port if blocked
go p.writerBuffered()
// this is thread to send to serial port regardless of block
Expand All @@ -378,4 +383,6 @@ func spHandlerClose(p *serport) {
func spCloseReal(p *serport) {
p.bufferwatcher.Close()
p.portIo.Close()
spListDual(false)
spList(false)
}