From b20f538e2945482009e20e2a31d1b6d7c1d768a0 Mon Sep 17 00:00:00 2001 From: Vova Date: Sat, 29 May 2021 00:37:26 +0300 Subject: [PATCH] Cleanup --- platforms/embedded/bluepill/lib/wasm3 | 1 - platforms/embedded/bluepill/lib/wasm3/library.json | 7 +++++++ platforms/embedded/bluepill/lib/wasm3/src | 1 + platforms/embedded/bluepill/platformio.ini | 7 +------ platforms/embedded/bluepill/src/main.cpp | 9 +++++++-- platforms/embedded/fomu/src/main.c | 4 ++-- source/m3_config_platforms.h | 2 +- 7 files changed, 19 insertions(+), 12 deletions(-) delete mode 120000 platforms/embedded/bluepill/lib/wasm3 create mode 100644 platforms/embedded/bluepill/lib/wasm3/library.json create mode 120000 platforms/embedded/bluepill/lib/wasm3/src diff --git a/platforms/embedded/bluepill/lib/wasm3 b/platforms/embedded/bluepill/lib/wasm3 deleted file mode 120000 index 17056a9..0000000 --- a/platforms/embedded/bluepill/lib/wasm3 +++ /dev/null @@ -1 +0,0 @@ -../../../../source \ No newline at end of file diff --git a/platforms/embedded/bluepill/lib/wasm3/library.json b/platforms/embedded/bluepill/lib/wasm3/library.json new file mode 100644 index 0000000..38cdf08 --- /dev/null +++ b/platforms/embedded/bluepill/lib/wasm3/library.json @@ -0,0 +1,7 @@ +{ + "build" : { + "flags": "-Os -fomit-frame-pointer -fno-stack-check -fno-stack-protector -Wfatal-errors -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers", + "srcFilter": ["+<*>", "-"], + "libArchive": false + } +} diff --git a/platforms/embedded/bluepill/lib/wasm3/src b/platforms/embedded/bluepill/lib/wasm3/src new file mode 120000 index 0000000..e3e41d7 --- /dev/null +++ b/platforms/embedded/bluepill/lib/wasm3/src @@ -0,0 +1 @@ +../../../../../source \ No newline at end of file diff --git a/platforms/embedded/bluepill/platformio.ini b/platforms/embedded/bluepill/platformio.ini index 39beed6..6b3199b 100644 --- a/platforms/embedded/bluepill/platformio.ini +++ b/platforms/embedded/bluepill/platformio.ini @@ -5,11 +5,6 @@ framework = stm32cube upload_protocol = stlink lib_deps = jeeh -src_filter = - +<*> - - - -src_build_flags = +build_flags = -Dd_m3FixedHeap=8192 -Os -Wfatal-errors - -flto diff --git a/platforms/embedded/bluepill/src/main.cpp b/platforms/embedded/bluepill/src/main.cpp index 6ba3448..120af16 100644 --- a/platforms/embedded/bluepill/src/main.cpp +++ b/platforms/embedded/bluepill/src/main.cpp @@ -49,9 +49,14 @@ void run_wasm() uint32_t value = 0; result = m3_GetResultsV (f, &value); - if (result) FATAL("m3_GetResults: %s", result); + if (result) FATAL("m3_GetResults", result); - printf("Result: %d\n", value); + char buff[32]; + itoa(value, buff, 10); + + puts("Result: "); + puts(buff); + puts("\n"); } PinC<13> led; diff --git a/platforms/embedded/fomu/src/main.c b/platforms/embedded/fomu/src/main.c index 6e40414..77cea3e 100644 --- a/platforms/embedded/fomu/src/main.c +++ b/platforms/embedded/fomu/src/main.c @@ -73,11 +73,11 @@ bool run_wasm() uart_print("Running...\n"); result = m3_CallV (f, 24); - if (result) FATAL("m3_Call: %s", result); + if (result) FATAL("m3_Call", result); uint32_t value = 0; result = m3_GetResultsV (f, &value); - if (result) FATAL("m3_GetResults: %s", result); + if (result) FATAL("m3_GetResults", result); char buff[32]; ltoa(value, buff, 10); diff --git a/source/m3_config_platforms.h b/source/m3_config_platforms.h index 57b24d2..b3b8e8b 100644 --- a/source/m3_config_platforms.h +++ b/source/m3_config_platforms.h @@ -71,7 +71,7 @@ # define M3_NO_UBSAN # else # define M3_WEAK __attribute__((weak)) -# define M3_NO_UBSAN __attribute__((no_sanitize("undefined"))) +# define M3_NO_UBSAN //__attribute__((no_sanitize("undefined"))) # endif # ifndef M3_MIN