mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
px_uploader: catch non-standard baud exception
to fix Cygwin upload. It failed silently but when catching it prints "non-standard baudrates are not supported on this platform". Discussion about platform independet FTDI detection is in issue #10429.
This commit is contained in:
@@ -336,7 +336,12 @@ class uploader(object):
|
||||
self.port.flushInput()
|
||||
# Set a baudrate that can not work on a real serial port
|
||||
# in that it is 233% off.
|
||||
self.port.baudrate = self.baudrate_bootloader * 2.33
|
||||
try:
|
||||
self.port.baudrate = self.baudrate_bootloader * 2.33
|
||||
except NotImplementedError as e:
|
||||
# This error can occur because pySerial on Windows does not support odd baudrates
|
||||
print(str(e) + " -> could not check for FTDI device, assuming USB connection")
|
||||
return
|
||||
|
||||
self.__send(uploader.GET_SYNC +
|
||||
uploader.EOC)
|
||||
|
||||
Reference in New Issue
Block a user