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!")
|
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
|
||||||
|
|
Loading…
Reference in New Issue