diff options
author | Klaus Goger <klaus.goger@theobroma-systems.com> | 2023-11-16 15:45:27 +0100 |
---|---|---|
committer | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2023-11-28 16:21:47 +0000 |
commit | 79fa6994b8a1147f9d5507afc3ec00c8f22a8a34 (patch) | |
tree | 3039d8d01296bcd46f19f466fa2073a5d0eb4ed4 | |
parent | a4f68d5b448e12942f00c1ca5cb9ca05be1e2155 (diff) |
mule-attiny: bitbang_updi_reset: add meson file
Instead of doing Makefile magic we could use a modern build system like
meson. This commits tries to replicate the features of the current
Makefile.
To build:
# create build directory
meson build
meson compile -C build
As an alternative you can also change to the build dir and do a meson
compile.
Test reset Makefile target was implemented as a unittest
meson test -C build
As meson really does not want you to use environment variables in its
definitions you can only pass a complete environment to an external
command. To not add a wrapper script I decided to add build options.
Currently the GPIOs are set to match Ringneck.
To change the settings (for example Jaguar) use:
meson configure build -Drst_gpio_idx=13 -Drst_gpiochip_idx=2
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
-rw-r--r-- | mule-attiny/bitbang_updi_reset/.gitignore | 2 | ||||
-rw-r--r-- | mule-attiny/bitbang_updi_reset/meson.build | 33 | ||||
-rw-r--r-- | mule-attiny/bitbang_updi_reset/meson_options.txt | 2 |
3 files changed, 37 insertions, 0 deletions
diff --git a/mule-attiny/bitbang_updi_reset/.gitignore b/mule-attiny/bitbang_updi_reset/.gitignore index 48cdea4..2695db1 100644 --- a/mule-attiny/bitbang_updi_reset/.gitignore +++ b/mule-attiny/bitbang_updi_reset/.gitignore @@ -1 +1,3 @@ updi_reset +build* +config diff --git a/mule-attiny/bitbang_updi_reset/meson.build b/mule-attiny/bitbang_updi_reset/meson.build new file mode 100644 index 0000000..08e6892 --- /dev/null +++ b/mule-attiny/bitbang_updi_reset/meson.build @@ -0,0 +1,33 @@ +project('bitbang_updi_reset', + 'c', + license : 'MIT', + version: '1.0', + default_options : 'werror=true' +) + +project_source_files = [ + 'serial_emu.c', + 'updi_emu.c', + 'updi_reset.c' +] + +project_dependencies = [ + dependency('libgpiod') +] + +updi_reset = executable('updi_reset', + project_source_files, + dependencies: project_dependencies, + install: true +) + +test('reset_test', + find_program('nice'), + args : [ + '--20', + updi_reset, + get_option('rst_gpiochip_idx').to_string(), + get_option('rst_gpio_idx').to_string() + ], + depends: updi_reset +) diff --git a/mule-attiny/bitbang_updi_reset/meson_options.txt b/mule-attiny/bitbang_updi_reset/meson_options.txt new file mode 100644 index 0000000..7919504 --- /dev/null +++ b/mule-attiny/bitbang_updi_reset/meson_options.txt @@ -0,0 +1,2 @@ +option('rst_gpiochip_idx', type : 'integer', min : 0, max : 4, value : 3) +option('rst_gpio_idx', type : 'integer', min : 0, max : 31, value : 4) |