forked from Archive/PX4-Autopilot
uploader: ignore bad character encodings for older bootloaders
this prevents the uploader from throwing an exception with older bootloaders
This commit is contained in:
parent
1ecd3e9291
commit
ec2197fd1b
|
@ -389,6 +389,7 @@ class uploader(object):
|
|||
self.otp_pid = self.otp[12:8:-1]
|
||||
self.otp_coa = self.otp[32:160]
|
||||
# show user:
|
||||
try:
|
||||
print("type: " + self.otp_id.decode('Latin-1'))
|
||||
print("idtype: " + binascii.b2a_qp(self.otp_idtype).decode('Latin-1'))
|
||||
print("vid: " + binascii.hexlify(self.otp_vid).decode('Latin-1'))
|
||||
|
@ -401,6 +402,9 @@ class uploader(object):
|
|||
self.sn = self.sn + x
|
||||
print(binascii.hexlify(x).decode('Latin-1'), end='') # show user
|
||||
print('')
|
||||
except Exception:
|
||||
# ignore bad character encodings
|
||||
pass
|
||||
print("erase...")
|
||||
self.__erase()
|
||||
|
||||
|
|
Loading…
Reference in New Issue