Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions arena_console.html
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@
>
SD card
<button id="sd-purge-btn" disabled
title="Delete ALL patterns from SD card (DELETE_ALL_PATTERNS 0x8F)">xXx</button>
title="Format the SD card - wipes patterns, firmware image, and manifests (PURGE_MEMORY 0x8F)">xXx</button>
<span
id="sd-count-badge"
title="Pattern files on SD card (GET_FILE_COUNT 0x80). Click to refresh."
Expand Down Expand Up @@ -2590,10 +2590,10 @@

$('sd-purge-btn').addEventListener('click', async () => {
if (!session.connected) return;
if (!confirm('Delete ALL patterns from SD card? This cannot be undone.')) return;
if (!confirm('Format the SD card? This wipes ALL patterns, the panel firmware image, and manifests. This cannot be undone.')) return;
const resp = await run(
'delete-all-patterns',
Wire.encodeDeleteAllPatterns(),
'purge-memory',
Wire.encodePurgeMemory(),
(r) => (r && r.ok ? 'done' : null),
{ timeoutMs: 30000 }
);
Expand Down
11 changes: 6 additions & 5 deletions arena_studio.html
Original file line number Diff line number Diff line change
Expand Up @@ -2703,7 +2703,7 @@ <h2 id="modalTitle">Import error</h2>
</div>
</div>
<button class="pill" data-cmd="csdarchive" title="Download the whole SD as a ZIP (GET_SD_ARCHIVE 0x8A)">Download ZIP</button>
<button class="pill danger" data-cmd="csdpurge" title="Delete ALL patterns (DELETE_ALL_PATTERNS 0x8F)">Purge…</button>
<button class="pill danger" data-cmd="csdpurge" title="Format the SD card - wipes patterns, firmware image, and manifests (PURGE_MEMORY 0x8F)">Purge…</button>
<input id="cSdFile" type="file" accept=".pat" style="display:none">
<input id="cSdFolder2" type="file" webkitdirectory directory style="display:none">
</div>
Expand Down Expand Up @@ -4900,7 +4900,7 @@ <h2 id="modalTitle">Import error</h2>
}
Studio.clearConsoleAutoStop = clearAutoStop; // Run-path pre-emption (module block)

// The firmware refuses SD-write + ISP commands (0x8D/0xE0/0x8A/0xC8/0xC9)
// The firmware refuses SD-write + ISP commands (0x8D/0xE0/0x8A/0x8F/0xC8/0xC9)
// unless the display is stopped (state ALL_OFF — CE_DISPLAY_ACTIVE with
// "Stop display before …" otherwise). STOP_DISPLAY also BLANKS the panels
// (they latch their last frame, so the controller pushes a dark frame).
Expand Down Expand Up @@ -5028,8 +5028,9 @@ <h2 id="modalTitle">Import error</h2>
},
csdpurge: () => guardDestructive(async () => {
if (!connected()) return;
if (!confirm('Delete ALL patterns from the SD card? This cannot be undone.')) return;
const r = await send(Wire.encodeDeleteAllPatterns(), 'DELETE_ALL_PATTERNS 0x8F', { timeoutMs: 30000 });
if (!confirm('Format the SD card? This wipes ALL patterns, the panel firmware image, and manifests. This cannot be undone.')) return;
await quiesceDisplay(); // 0x8F requires the display stopped
const r = await send(Wire.encodePurgeMemory(), 'PURGE_MEMORY 0x8F', { timeoutMs: 30000 });
if (r && Wire.decodeResponse(r) && Wire.decodeResponse(r).ok) sdRefresh();
}),
// panel firmware
Expand Down Expand Up @@ -14929,7 +14930,7 @@ <h2 id="modalTitle">Import error</h2>
'[data-cmd="csdlist"]': 'Re-read the memory card’s pattern list.',
'[data-cmd="cpatinfo"]': 'Ask the arena again about the selected pattern (frames, size).',
'[data-cmd="csdarchive"]': 'Download every pattern on the card as one ZIP file.',
'[data-cmd="csdpurge"]': 'Delete ALL patterns from the card. It will ask first.',
'[data-cmd="csdpurge"]': 'Erase everything on the memory card, patterns, panel firmware, all of it, by reformatting it. It will ask first.',
'[data-cmd="cmemsd"]': 'Show the patterns on the SD memory card.',
'[data-cmd="cmempsram"]': 'Show the patterns in the controller’s RAM.',
'#cPatThumb': 'Preview of the selected pattern — hover to animate multi-frame patterns.',
Expand Down
2 changes: 1 addition & 1 deletion docs/development/arena-studio-wireframe-v6.html
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ <h3>Sequence · test any single condition ▶
</div>
</div>
<button class="pill" data-help="Download every pattern on the card as one ZIP">Download ZIP</button>
<button class="pill danger" data-help="Delete ALL patterns from the card (confirms first)">Purge…</button>
<button class="pill danger" data-help="Erase everything on the card, patterns, panel firmware, all of it, by reformatting it (confirms first)">Purge…</button>
</div>
<div class="memb" data-mem="sd">
<table class="sdtable">
Expand Down
12 changes: 7 additions & 5 deletions js/arena-wire-g6.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const ArenaWireG6 = (function () {
GET_PATTERN_FILE: 0x84, // [03 84 idx_lo idx_hi] 1-based; response: uint64 LE size, then raw bytes
SET_PATTERN_FILE: 0x85, // [0x85, idx_lo, idx_hi, len64 LE, data…] upload file (bulk stream)
DELETE_PATTERN_FILE: 0x86, // [03 86 idx_lo idx_hi] delete 1-based pattern; idx=0 deletes pattern.temp
DELETE_ALL_PATTERNS: 0x8f, // [01 8F] delete all files in /patterns
PURGE_MEMORY: 0x8f, // [01 8F] format the SD card (wipes everything, not just /patterns)
GET_SD_ARCHIVE: 0x8a, // [01 8A] stream full SD as ZIP; only in ALL_OFF state
STOP_DISPLAY: 0x30,
STREAM_FRAME: 0x32, // host-streamed full frame ("FR"+blocks; see encodeStreamFrame)
Expand Down Expand Up @@ -507,9 +507,11 @@ const ArenaWireG6 = (function () {
return frame(OPCODES.GET_PATTERN_FILE, u16le(index, 'index')); // 03 84 lo hi
}

// delete-all-patterns (0x8F) — delete every file in /patterns.
function encodeDeleteAllPatterns() {
return frame(OPCODES.DELETE_ALL_PATTERNS); // 01 8F
// purge-memory (0x8F): format the SD card (wipes everything, not just
// /patterns: also /firmware/panel.bin and both manifests). Much slower
// than the per-file delete it replaced; give it a generous timeout.
function encodePurgeMemory() {
return frame(OPCODES.PURGE_MEMORY); // 01 8F
}

// delete-pattern-file (0x86) — delete the pattern at 1-based index.
Expand Down Expand Up @@ -853,7 +855,7 @@ const ArenaWireG6 = (function () {
encodeGetPatternFile,
encodeSetPatternFile,
encodeDeletePatternFile,
encodeDeleteAllPatterns,
encodePurgeMemory,
encodeGetSdArchive,
encodeSetFirmwareFile,
encodeGetFirmwareInfo,
Expand Down
Loading