remove the double init code

This commit is contained in:
xiaoheng 2018-12-11 19:54:44 +08:00
parent d2c397aa21
commit cbf96ef8d1
1 changed files with 1 additions and 9 deletions

View File

@ -56,15 +56,7 @@ func uartInit() error {
return errors.New("port open error!") return errors.New("port open error!")
} else { } else {
flushUart() //flush uart data flushUart() //flush uart data
sPort.Close() go uartReadStart()
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()
}
} }
return err return err