fix(toolbar): Run on QEMU-Linux boards boots directly — no bogus firmware error

The QEMU branch of handleRun required compiledProgram, but Pi-family
boards never have one (handleCompile early-returns 'no compilation
needed' without producing firmware), so the toolbar Run always surfaced
'Compilation produced no firmware' instead of powering the board on.
Start them directly, same as the workspace Start button.
This commit is contained in:
David Montero Crespo 2026-07-28 14:13:03 +02:00
parent 93f319db7e
commit 7bb54e8d32
1 changed files with 13 additions and 0 deletions

View File

@ -827,6 +827,19 @@ export const EditorToolbar = ({
stopBoard(activeBoardId); stopBoard(activeBoardId);
await new Promise((resolve) => setTimeout(resolve, 300)); await new Promise((resolve) => setTimeout(resolve, 300));
} }
// QEMU-Linux boards (Raspberry Pi family + overlay piFamily kinds)
// boot straight from the rootfs — there is no firmware to compile,
// and handleCompile's Pi early-return never sets compiledProgram, so
// the gate below would surface a bogus "Compilation produced no
// firmware" error. Power the board on directly instead.
if (isPiBoardKind(board?.boardKind ?? '')) {
trackRunSimulation(board?.boardKind);
reportRun(board?.boardKind);
console.log('[handleRun] → startBoard (QEMU-Linux, no firmware)', activeBoardId);
startBoard(activeBoardId);
setMessage(null);
return;
}
if (!board?.compiledProgram || codeChangedSinceLastCompile) { if (!board?.compiledProgram || codeChangedSinceLastCompile) {
console.log('[handleRun] auto-compile + run'); console.log('[handleRun] auto-compile + run');
autoRunAfterCompile.current = true; autoRunAfterCompile.current = true;