remove the double init code
This commit is contained in:
parent
d2c397aa21
commit
cbf96ef8d1
|
@ -56,15 +56,7 @@ func uartInit() error {
|
|||
return errors.New("port open error!")
|
||||
} else {
|
||||
flushUart() //flush uart data
|
||||
sPort.Close()
|
||||
sPort, err = serial.OpenPort(c)
|
||||
if err != nil {
|
||||
log.Println(log.ErrorLog, err)
|
||||
return errors.New("port open error!")
|
||||
} else {
|
||||
flushUart() //flush uart data
|
||||
go uartReadStart()
|
||||
}
|
||||
go uartReadStart()
|
||||
}
|
||||
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue