rename binary file - print about test mode
This commit is contained in:
@ -130,7 +130,9 @@ class Display:
|
|||||||
def version(self):
|
def version(self):
|
||||||
self.term.write(bytes([ESC,ESC,1,0xf3]))
|
self.term.write(bytes([ESC,ESC,1,0xf3]))
|
||||||
reply = self.term.read(4)
|
reply = self.term.read(4)
|
||||||
assert reply[0:2] == ESCESC
|
if reply[0:2] != ESCESC:
|
||||||
|
print('make sure the display is not in test mode - touch through it first!')
|
||||||
|
raise ValueError(f'reply is not starting with ESCESC: {reply!r}')
|
||||||
return self.term.read(reply[2]-1)
|
return self.term.read(reply[2]-1)
|
||||||
|
|
||||||
def font(self, size):
|
def font(self, size):
|
||||||
@ -274,8 +276,7 @@ if firmware:
|
|||||||
if tag[:4] != MAGIC:
|
if tag[:4] != MAGIC:
|
||||||
raise ValueError(f'{firmware} is not a valid firmware file')
|
raise ValueError(f'{firmware} is not a valid firmware file')
|
||||||
hwversion = d.version()
|
hwversion = d.version()
|
||||||
if tag[4:] == hwversion:
|
if tag[4:] != hwversion:
|
||||||
# print('firmware is already', pretty_version(hwversion))
|
|
||||||
print('display version:', pretty_version(hwversion))
|
print('display version:', pretty_version(hwversion))
|
||||||
print('binfile version:', pretty_version(tag[4:]))
|
print('binfile version:', pretty_version(tag[4:]))
|
||||||
result = input('flash this (takes 1 min)? ').lower()
|
result = input('flash this (takes 1 min)? ').lower()
|
||||||
|
Reference in New Issue
Block a user