diff options
Diffstat (limited to 'src/device/meson.build')
-rw-r--r-- | src/device/meson.build | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/device/meson.build b/src/device/meson.build new file mode 100644 index 0000000..9bb9b69 --- /dev/null +++ b/src/device/meson.build @@ -0,0 +1,17 @@ +fw_image = 'fw.bin' +if get_option('fwbuild') + espmake = find_program('espmake') + + sourcedir = meson.current_source_dir() + fw_filenames = ['main.ino'] + fw_sources = files(fw_filenames) + fw = custom_target('fw', + output : fw_image, + input : fw_sources, + command : [espmake, '-C', sourcedir, '&&', 'cp', '/tmp/mkESP/main_d1_mini/main.bin', '@OUTDIR@/' + fw_image], install : true, install_dir : resource_dir) + + if get_option('fwflash') + esptool = find_program('esptool.py') + run_target('flash_fw', depends : fw, command : [esptool, 'write_flash', '0x0', fw]) + endif +endif |