display.py: flashing firmware
This commit is contained in:
14
display.py
14
display.py
@ -293,12 +293,16 @@ if firmware:
|
|||||||
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('firmware is already', pretty_version(hwversion))
|
||||||
else:
|
|
||||||
print('firmware file:', pretty_version(tag[4:]))
|
|
||||||
print('display version:', pretty_version(hwversion))
|
print('display version:', pretty_version(hwversion))
|
||||||
#d.bootmode()
|
print('binfile version:', pretty_version(tag[4:]))
|
||||||
#os.system(f'../stm32flash-0.7/stm32flash -R -v -b 115200 -w /tmp/fw.bin {dev}')
|
result = input('flash this (takes 1 min)? ').lower()
|
||||||
|
if result in ('y', 'yes'):
|
||||||
|
print('\ndo NOT interrupt')
|
||||||
|
d.bootmode()
|
||||||
|
d.term.close()
|
||||||
|
time.sleep(1.)
|
||||||
|
os.system(f'../stm32flash-0.7/stm32flash -R -v -b 115200 -w {firmware} {tty}')
|
||||||
if daemon:
|
if daemon:
|
||||||
while True:
|
while True:
|
||||||
d.refresh()
|
d.refresh()
|
||||||
|
Reference in New Issue
Block a user