Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vshymanskyy committed Sep 13, 2024
1 parent 227bd9a commit 35fa4f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ bytearray(b' Blink\x00\xf0\x9f\xa4\xa9 C++ is running!\x00\n\x00\x00\x00')

## CoreMark results

| ESP32 `240MHz` | iMXRT1062 `600MHz` | STM32F405 `168MHz` |
|----------------|--------------------|--------------------|
| 271.573 | 1911.437 | 233.918 |
| ESP32 `240MHz` | iMXRT1062 `600MHz` | STM32F405 `168MHz` | i5-8250U `1.6GHz` |
|----------------|--------------------|--------------------|-------------------|
| 271.573 | 1911.437 | 233.918 | 18696.248 |

## TODO

Expand Down
3 changes: 2 additions & 1 deletion runtime/libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ int strncmp(const char *_l, const char *_r, size_t n) {

void abort() {
mp_printf(&mp_plat_print, "Aborting\n");
for(;;) {} // Wait forever
__builtin_trap();
for(;;) {} // Should not reach here
}

#if defined(__ARM_EABI__)
Expand Down
6 changes: 3 additions & 3 deletions runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ __attribute__((weak))
void w2c_app_0x5Fstart(w2c_wasm* module) {}

void os_print_last_error(const char* msg) {
mp_printf(&mp_plat_print, "Error: %s\n", msg);
mp_raise_msg(&mp_type_RuntimeError, msg);
abort();
}

void wasm_rt_trap_handler(wasm_rt_trap_t code) {
#if WASM_RT_OPTIMIZE
mp_printf(&mp_plat_print, "Trap: %d\n", code);
mp_raise_msg(&mp_type_RuntimeError, "wasm trap");
#else
mp_printf(&mp_plat_print, "Trap: %s\n", wasm_rt_strerror(code));
mp_raise_msg(&mp_type_RuntimeError, wasm_rt_strerror(code));
#endif
abort();
}
Expand Down

0 comments on commit 35fa4f3

Please sign in to comment.