diff --git a/.gitignore b/.gitignore index 8d609d3a..b64bb4db 100644 --- a/.gitignore +++ b/.gitignore @@ -56,9 +56,12 @@ subprojects/radio_tool subprojects/codec2 subprojects/tinyusb -#ignore log files +# ignore log files *.log -#ignore linux openrtx emulator history file +# ignore linux openrtx emulator history file .emulatorsh_history +# ignore bin2sgl +!scripts/bin2sgl.Linux.bin +!scripts/bin2sgl.exe diff --git a/meson.build b/meson.build index 482e3498..3641eb5c 100644 --- a/meson.build +++ b/meson.build @@ -523,7 +523,11 @@ targets = [ radio_tool = find_program('radio_tool') objcopy = find_program('objcopy', required:false, disabler:true) -bin2sgl = find_program('scripts/bin2sgl.Linux', required:false, disabler:true) +if build_machine.system() == 'linux' + bin2sgl = find_program('scripts/bin2sgl.Linux', required:false, disabler:true) +elif build_machine.system() == 'windows' + bin2sgl = find_program('scripts/bin2sgl.exe', required:false, disabler:true) +endif gd77_loader = find_program('scripts/gd-77_firmware_loader.py', required:false, disabler:true) dfu_util = find_program('dfu-util', required:false, disabler:true) @@ -542,17 +546,24 @@ foreach t : targets # Handle GD77 custom wrapping and flashing tools if name == 'openrtx_gd77' +if build_machine.system() == 'linux' wrap = custom_target(name+'_wrap', - output : name+'_wrap', + output : name+'_wrap.sgl', input : bin, command : [bin2sgl, '-f', '@INPUT@', - '&&', 'mv', '@INPUT@.sgl', '@OUTPUT@.sgl']) + '&&', 'mv', '@INPUT@.sgl', '@OUTPUT@']) +elif build_machine.system() == 'windows' + wrap = custom_target(name+'_wrap', + output : name+'_bin.sgl', + input : bin, + command : [bin2sgl, '@INPUT@']) +endif custom_target(name+'_flash', input : wrap, output : name+'_flash', - command : [gd77_loader, '-f', '@INPUT@.sgl']) + command : [gd77_loader, '-f', '@INPUT@']) # Module17 also uses dfu-tool for flashing elif name == 'openrtx_mod17' diff --git a/scripts/bin2sgl.Linux.bin b/scripts/bin2sgl.Linux.bin new file mode 100755 index 00000000..ee5cb18a Binary files /dev/null and b/scripts/bin2sgl.Linux.bin differ diff --git a/scripts/bin2sgl.exe b/scripts/bin2sgl.exe new file mode 100644 index 00000000..354d15dd Binary files /dev/null and b/scripts/bin2sgl.exe differ