Enabled circuit breaker with emscripten

This is possible because we use WASM and ASYNCIFY with the latest-upstream
toolchain.
This commit is contained in:
M4x1m3
2020-07-01 21:22:15 +02:00
parent 10a11dddeb
commit 81e9cbc0e0
2 changed files with 14 additions and 6 deletions

View File

@@ -447,7 +447,7 @@ void ConsoleController::printText(const char * text, size_t length) {
flushOutputAccumulationBufferToStore();
micropython_port_vm_hook_refresh_print();
}
#if __EMSCRIPTEN__
// #if __EMSCRIPTEN__
/* If we called micropython_port_interrupt_if_needed here, we would need to
* put in the WHITELIST all the methods that call
* ConsoleController::printText, which means all the MicroPython methods that
@@ -460,13 +460,17 @@ void ConsoleController::printText(const char * text, size_t length) {
* device.
*
* TODO: Allow print interrpution on emscripten -> maybe by using WASM=1 ? */
#else
/*
* This can be run in Omega, since it uses WebASM.
*/
// #else
/* micropython_port_vm_hook_loop is not enough to detect user interruptions,
* because it calls micropython_port_interrupt_if_needed every 20000
* operations, and a print operation is quite long. We thus explicitely call
* micropython_port_interrupt_if_needed here. */
micropython_port_interrupt_if_needed();
#endif
// #endif
}
void ConsoleController::autoImportScript(Script script, bool force) {