Clean up the build
parent
6392910695
commit
f620e41a31
13
build.sh
13
build.sh
|
@ -1,7 +1,11 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BDIR=build
|
||||
BDIR=build_firmware
|
||||
BDIR_TEST=build_test
|
||||
|
||||
meson . "$BDIR_TEST"
|
||||
meson compile -C "$BDIR_TEST"
|
||||
|
||||
meson . "$BDIR" --cross-file meson_cross.txt
|
||||
|
||||
|
@ -10,3 +14,10 @@ for arg in "$@"; do
|
|||
done
|
||||
|
||||
meson compile -C "$BDIR"
|
||||
|
||||
echo
|
||||
echo "########################################################################"
|
||||
echo "Build complete. Firmware files are at:"
|
||||
echo " - $BDIR/poly1.elf"
|
||||
echo " - $BDIR/poly1.hex"
|
||||
echo "Test executables are in $BDIR_TEST."
|
||||
|
|
20
meson.build
20
meson.build
|
@ -1,15 +1,28 @@
|
|||
project('poly1', 'cpp', default_options: ['optimization=2'])
|
||||
project('poly1', 'cpp', default_options: ['optimization=2', 'cpp_std=c++17'])
|
||||
|
||||
atpack_zip = 'Microchip.AVR-Dx_DFP.2.1.152.atpack'
|
||||
dependencies = []
|
||||
|
||||
local_headers = ['.']
|
||||
local_headers = ['.', 'etl/include']
|
||||
|
||||
sources = [
|
||||
'main.cpp',
|
||||
'board.cpp',
|
||||
]
|
||||
|
||||
_includes = local_headers
|
||||
_incl_dirs = include_directories(_includes)
|
||||
|
||||
# test binaries
|
||||
if host_machine.cpu_family() != 'avr'
|
||||
test_midi = executable(
|
||||
'test_midi',
|
||||
['test_midi.cpp'],
|
||||
include_directories: _incl_dirs,
|
||||
)
|
||||
subdir_done()
|
||||
endif
|
||||
|
||||
# debug build
|
||||
if get_option('buildtype') == 'debug'
|
||||
add_project_arguments(['-DDEBUG=1', '-ggdb3'], language: ['c', 'cpp'])
|
||||
|
@ -31,9 +44,6 @@ add_project_link_arguments(['-mmcu=' + host_machine.cpu()], language: ['c', 'cpp
|
|||
add_project_arguments(['-DF_CPU=' + get_option('cpu_freq').to_string()], language: ['c', 'cpp'])
|
||||
add_project_arguments(['-I' + atpack_path / 'include'], language: ['c', 'cpp'])
|
||||
|
||||
_includes = local_headers
|
||||
_incl_dirs = include_directories(_includes)
|
||||
|
||||
atpack = custom_target(
|
||||
'atpack',
|
||||
command: [ 'unzip', '@INPUT@', '-d', '@OUTPUT@' ],
|
||||
|
|
|
@ -80,6 +80,13 @@ void print_midi(struct midi_message * m)
|
|||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
printf("test_midi HEX_BYTES...\n");
|
||||
printf("Parses MIDI data and prints out the message packets.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
serial_test serport;
|
||||
etl::queue<struct midi_message, 2048> queue;
|
||||
midix m(serport, queue);
|
||||
|
|
Loading…
Reference in New Issue