Integrate OpenGD77 wrapping and flashing tools into meson

replace/7e4a19b68b316be540ae5bd8b8f5412a9607d716
Niccolò Izzo 2021-01-01 19:08:35 +01:00
rodzic 94b7be826a
commit 2cd9a989fe
1 zmienionych plików z 34 dodań i 12 usunięć

Wyświetl plik

@ -416,6 +416,8 @@ targets = [
objcopy = find_program('objcopy', required:false, disabler:true)
radio_tool = find_program('radio_tool', required:false, disabler:true)
bin2sgl = find_program('bin2sgl.Linux', required:false, disabler:true)
gd77_loader = find_program('gd-77_firmware_loader.py', required:false, disabler:true)
foreach t : targets
@ -429,18 +431,38 @@ foreach t : targets
input : exe,
command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'])
wrap = custom_target(name+'_wrap',
output : name+'_wrap',
input : bin,
command : [radio_tool,
'--wrap',
'-o', '@OUTPUT@',
'-r', t['wrap'],
'-s', t['load_addr']+':@INPUT@'])
# Handle GD77 custom wrapping and flashing tools
if name == 'openrtx_gd77'
wrap = custom_target(name+'_wrap',
output : name+'_wrap',
input : bin,
command : [bin2sgl,
'-f', '@INPUT@',
'&&', 'mv', '@INPUT@.sgl', '@OUTPUT@.sgl'])
custom_target(name+'_flash',
input : wrap,
output : name+'_flash',
command : [gd77_loader, '-f', '@INPUT@.sgl'])
else
wrap = custom_target(name+'_wrap',
output : name+'_wrap',
input : bin,
command : [radio_tool,
'--wrap',
'-o', '@OUTPUT@',
'-r', t['wrap'],
'-s', t['load_addr']+':@INPUT@'])
custom_target(name+'_flash',
input : wrap,
output : name+'_flash',
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
endif
custom_target(name+'_flash',
input : wrap,
output : name+'_flash',
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
endif
endforeach