From aabef0e4cd285c0cbdcebe38e67b4a5f50541a08 Mon Sep 17 00:00:00 2001 From: Felipe Martinez Date: Sun, 15 Dec 2024 18:29:19 +0000 Subject: [PATCH] Show pins on wasm frontend --- frontend/wasm/infiniemu.d.ts | 1 + frontend/wasm/src/common.ts | 2 +- frontend/wasm/src/components/Emulator.vue | 4 ++++ frontend/wasm/src/worker.ts | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/wasm/infiniemu.d.ts b/frontend/wasm/infiniemu.d.ts index c145c47..6addbfe 100644 --- a/frontend/wasm/infiniemu.d.ts +++ b/frontend/wasm/infiniemu.d.ts @@ -47,6 +47,7 @@ const module: EmscriptenModuleFactory([]); function addConsoleLine(text: string, type: Line["type"]) { @@ -177,6 +180,7 @@ worker.onmessage = async (event) => { performance.ips.value = data.ips; performance.loopTime.value = data.loopTime; performance.sramSize.value = data.totalSRAM; + pins.value = data.pins; break; case "rttFound": diff --git a/frontend/wasm/src/worker.ts b/frontend/wasm/src/worker.ts index 4e3535a..3d8b1a8 100644 --- a/frontend/wasm/src/worker.ts +++ b/frontend/wasm/src/worker.ts @@ -133,7 +133,7 @@ class Emulator { screenUpdated = this.doLoop(10000000); } else { - while (this.isRunning && !screenUpdated && performance.now() - start < 50) { + while (this.isRunning && !screenUpdated && performance.now() - start < 20) { screenUpdated ||= this.doLoop(iterations); } } @@ -176,6 +176,7 @@ class Emulator { loopTime: end - start, ips: (this.instructionCount - instructionCountStart) / ((end - start) / 1000), totalSRAM: this.Module._nrf52832_get_sram_size(this.nrf52), + pins: this.Module._pins_read_all(this.pins), }); }