File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -97,16 +97,16 @@ def main():
9797
9898 response = ser .read ()
9999
100- if (ord (response ) == BL_COMMAND_ANNOUNCE ):
101- # Respond with 'AOK'
102- # values = bytearray([6])
103- ser .write (BL_COMMAND_AOK .to_bytes (1 , byteorder = 'big' ))
100+ if (ord (response ) == BL_COMMAND_ANNOUNCE ):
101+ # Respond with 'AOK'
102+ # values = bytearray([6])
103+ ser .write (BL_COMMAND_AOK .to_bytes (1 , byteorder = 'big' ))
104104
105- verboseprint ("Bootload response received" )
106- else :
107- print ( "Unkown response: " + str ( ord ( response )) +
108- ". Perhaps you have the wrong port?" )
109- exit ()
105+ verboseprint ("Bootload response received" )
106+ break
107+ else :
108+ verboseprint ( "Unkown response: " + str ( ord ( response )) )
109+ response = ''
110110
111111 # Send upload baud rate
112112 baud_in_bytes = args .baud .to_bytes (4 , byteorder = 'big' )
@@ -198,6 +198,9 @@ def main():
198198
199199 if end > totalLen :
200200 end = totalLen
201+ else :
202+ print ("Unknown BL response" )
203+ exit ()
201204
202205 exit ()
203206
You can’t perform that action at this time.
0 commit comments