M0 (docs/FEASIBILITY.md, verified against esp-emulator wasm v0.51.0): - GPIO outputs observable via gpio_state(); gpio_set_input() drives pads and raises guest interrupts (button-class peripherals work) - LEDC PWM and RMT waveforms are NOT visible in the pad registers; duty is readable from LEDC registers and WS2812 frames decode from RMT channel RAM (per-chip MMIO map in peris/mmio/) - Node probe + ESP-IDF test firmware (gpio/ledc/rmt three-phase loop) M1 peripherals framework: - esp-emu-peris.html entry (stock layout + Peripherals/Debug tabs), peris/worker.js (stock worker clone + per-batch pin sampling hooks) - device plugin API v1 (docs/DEVICE-API.md) with manifest registry: add a peripheral = one module + one manifest line - devices: led, button, touch-button, toggle-switch; wiring config import/export + localStorage autosave; pin-conflict reporting - serve.py merged dev server, sync_www.py publisher (www only gains files, stock ones untouched), xterm vendored locally (no CDN) - tests/m1_smoke.mjs integration smoke (config/LED state/button ISR/ toggle/conflict/unknown-type) - all green
1.6 KiB
1.6 KiB
跟进上游 esp-emulator / esp-emu-browser 升级
锁定版本
当前基线:esp-emulator v0.51.0(_tools/esp-emu-browser/www/pkg,wasm-bindgen --target web)。
升级步骤
- 下载新版 wasm 包(如
esp-emu-<ver>-wasm.tar.gz)解压出新的www/(_tools下已有update_esp_emu_browser.bat,目前为空,可按此逻辑补全)。 - 先跑 M0 探针:
node tests/m0_probe.mjs <新固件路径不动,直接对 pkg>。 探针直接 import 新pkg/esp_emu.js,六项结论(Q1a/Q1b/Q2a/Q2b/Q3a/Q3b)若有变化, 先更新docs/FEASIBILITY.md与peris/mmio/地址表,再动其它代码。 - diff 官方 worker.js:
diff <new_www>/worker.js peris/worker.js我们对原文件的改动全部带peris:注释,逐块把上游新逻辑移植进peris/worker.js:- 新增/变更的消息类型 → 同步到 peris/worker.js 与 peris/app.js 的 switch
- 运行循环(run_batch/throttle/restart)变化 → 保持
peris.onBatchEnd()钩子在每批之后
- diff 官方 app.js / index.html:页面功能(终端/图表/寄存器/内存面板)改动按需
移植进
peris/app.js与esp-emu-peris.html(我们的文件是它们的超集复刻)。 - 若
WasmEmulatorAPI 变化(新增 GPIO/PWM/RMT 接口!),优先改用官方 API 简化设备实现—— 那正是 ROADMAP.md 里等的东西。 - GUI 冒测(加载固件、LED/按键、配置导入导出),提交。
需要盯的上游能力(详见 ROADMAP.md)
- GPIO 之外的外设 API(i2c/spi 设备模型、rmt 回调、touch、adc)
- 事件回调机制(目前只能轮询)
- 浏览器包的 UART1 / 快照保存