summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/meson.build1
-rw-r--r--src/tempmodule/meson.build16
2 files changed, 17 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build
index 2b036a6..eba583d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,4 +1,5 @@
subdir('server')
+subdir('tempmodule')
sources = dp_sources
extra = dp_extra
diff --git a/src/tempmodule/meson.build b/src/tempmodule/meson.build
new file mode 100644
index 0000000..e974884
--- /dev/null
+++ b/src/tempmodule/meson.build
@@ -0,0 +1,16 @@
+if get_option('fwbuild')
+ espmake = find_program('espmake')
+
+ sourcedir = meson.current_source_dir()
+ fw_filenames = ['main.ino', 'indicator.c', 'temperature.c', 'indicator.h', 'temperature.h']
+ fw_sources = files(fw_filenames)
+ fw = custom_target('fw',
+ output : 'fw.bin',
+ input : fw_sources,
+ command : [espmake, '-C', sourcedir, '&&', 'cp', '/tmp/mkESP/main_d1_mini/main.bin', '@OUTDIR@/fw.bin'])
+
+ if get_option('fwflash')
+ esptool = find_program('esptool.py')
+ run_target('flash_fw', depends : fw, command : [esptool, 'write_flash', '0x0', fw])
+ endif
+endif