diff --git a/bootstrap.sh b/bootstrap.sh index 34e4b03c050407a129e71f3e98b935af36d07f19..1363d4ebe413a252ba8e7e540405a63458320c0a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,10 +1,10 @@ #!/bin/sh set -xe -cd "$(dirname "$0")" || exit 1 +cd "$(dirname "$0")" test -d build/ && rm -r build/ -git submodule update --init --recursive +git submodule update --init ./lib/micropython meson --cross-file card10-cross.ini build/ set +x diff --git a/hw-tests/upy-minimal/meson.build b/hw-tests/upy-minimal/meson.build index 2ce4179f41aeaf32d2e3ca0fb577e94b1d5075ae..d674b5df47ac5e50e1a45c978b8c4bc3764e9d26 100644 --- a/hw-tests/upy-minimal/meson.build +++ b/hw-tests/upy-minimal/meson.build @@ -31,7 +31,8 @@ modules_h = custom_target( qstr_h = custom_target( 'qstrdefs.generated.h', output: 'qstrdefs.generated.h', - input: [modules_h, version_h, micropython_sources, 'modules/qstr.h'], + input: ['modules/qstrdefs.h', micropython_sources], + depends: [modules_h, version_h], command: [micropython_gen_qstr, meson.current_source_dir(), '@OUTPUT@', '@INPUT@'], ) diff --git a/hw-tests/upy-minimal/modules/qstr.h b/hw-tests/upy-minimal/modules/qstr.h deleted file mode 100644 index 0fc7efa17a9a86de2f20034d380fd4968cd9c0e7..0000000000000000000000000000000000000000 --- a/hw-tests/upy-minimal/modules/qstr.h +++ /dev/null @@ -1,12 +0,0 @@ -MP_QSTR_leds -MP_QSTR_set_dim -MP_QSTR_utime -MP_QSTR_sleep -MP_QSTR_sleep_ms -MP_QSTR_sleep_us -MP_QSTR_ticks_ms -MP_QSTR_ticks_us -MP_QSTR_ticks_cpu -MP_QSTR_ticks_add -MP_QSTR_ticks_diff -MP_QSTR_buzzer diff --git a/hw-tests/upy-minimal/modules/qstrdefs.h b/hw-tests/upy-minimal/modules/qstrdefs.h new file mode 100644 index 0000000000000000000000000000000000000000..b6c21cc086fa8612b6ecf4785e697b0230943e3c --- /dev/null +++ b/hw-tests/upy-minimal/modules/qstrdefs.h @@ -0,0 +1,19 @@ +#include "py/mpconfig.h" + +/* buzzer */ +Q(buzzer) + +/* leds */ +Q(leds) +Q(set_dim) + +/* utime */ +Q(utime) +Q(sleep) +Q(sleep_ms) +Q(sleep_us) +Q(ticks_ms) +Q(ticks_us) +Q(ticks_cpu) +Q(ticks_add) +Q(ticks_diff) diff --git a/lib/micropython/gen-qstr.sh b/lib/micropython/gen-qstr.sh index 1ae13ff95ff2c19774bb79f0b1931f84b303fab9..34b3b312a2af360e3120a0bbf4a38f936fea9e14 100755 --- a/lib/micropython/gen-qstr.sh +++ b/lib/micropython/gen-qstr.sh @@ -5,7 +5,7 @@ PYTHON="$1" SOURCE_DIR="$2" PROJECT_SRC="$3" OUTPUT="$4" -# IGNORE="$5" +CUSTOM_QSTR="$5" shift 5 @@ -27,7 +27,7 @@ gcc -E -DNO_QSTR -I"$SOURCE_DIR/micropython" -I"$PROJECT_SRC" -I"$OUTPUT_DIR" "$ # Preprocess Header ... I did not come up with this, this is code copied from # the official make file. Seriously. -cat "$SOURCE_DIR/micropython/py/qstrdefs.h" "$OUTPUT_DIR/qstrdefs.collected.h" \ +cat "$SOURCE_DIR/micropython/py/qstrdefs.h" "$CUSTOM_QSTR" "$OUTPUT_DIR/qstrdefs.collected.h" \ | sed 's/^Q(.*)/"&"/' \ | gcc -E -I"$SOURCE_DIR/micropython" -I"$PROJECT_SRC" -I"$OUTPUT_DIR" - \ | sed 's/^\"\(Q(.*)\)\"/\1/' \