kopia lustrzana https://github.com/micropython/micropython
tools/pydfu.py: Add support for multiple memory segments.
Segments are separated by / and begin with the memory address. This follows how the ST DFU tool works.pull/3877/merge
rodzic
ec7982ec6d
commit
92667dc2e5
|
@ -394,10 +394,11 @@ def get_memory_layout(device):
|
|||
intf = cfg[(0, 0)]
|
||||
mem_layout_str = get_string(device, intf.iInterface)
|
||||
mem_layout = mem_layout_str.split('/')
|
||||
addr = int(mem_layout[1], 0)
|
||||
segments = mem_layout[2].split(',')
|
||||
seg_re = re.compile(r'(\d+)\*(\d+)(.)(.)')
|
||||
result = []
|
||||
for mem_layout_index in range(1, len(mem_layout), 2):
|
||||
addr = int(mem_layout[mem_layout_index], 0)
|
||||
segments = mem_layout[mem_layout_index + 1].split(',')
|
||||
seg_re = re.compile(r'(\d+)\*(\d+)(.)(.)')
|
||||
for segment in segments:
|
||||
seg_match = seg_re.match(segment)
|
||||
num_pages = int(seg_match.groups()[0], 10)
|
||||
|
|
Ładowanie…
Reference in New Issue