File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,14 +65,22 @@ def write_eeprom(
6565 programmer .write (address , chunk )
6666 print ("." , end = "" , flush = True )
6767
68- if not no_verify :
69- time .sleep (0.1 )
68+ address += len (chunk )
7069
71- written = programmer .read (address , len (chunk ))
72- time .sleep (0.1 )
73- for i in range (len (chunk )):
74- if written [i ] != chunk [i ]:
75- print (f"Correcting write error at { address + i } " )
76- programmer .write (address + i , chunk [i ].to_bytes (1 , "big" ))
70+ if no_verify :
71+ return
7772
73+ file .seek (0 )
74+ print ()
75+ print ("Verifying" , end = "" , flush = True )
76+ while True :
77+ chunk = file .read (block_size )
78+ if not chunk :
79+ break
80+ written = programmer .read (address , len (chunk ))
81+ if written != chunk :
82+ raise Exception (f"Verification error at 0x{ address :03x} " )
83+ print ("." , end = "" , flush = True )
7884 address += len (chunk )
85+
86+ print (" done" )
You can’t perform that action at this time.
0 commit comments