WIP: replace picow boards as pico, plus uf2 only and generic last

This commit is contained in:
tyeth 2025-04-09 23:31:46 +01:00
parent bccb1224c1
commit 2c9ca9b67b
2 changed files with 10 additions and 6 deletions

View file

@ -148,16 +148,19 @@ function populateBoardSelect() {
// Filter boards to only include those with UF2 install method // Filter boards to only include those with UF2 install method
const filteredBoards = Object.entries(appState.boardsData) const filteredBoards = Object.entries(appState.boardsData)
.filter(([boardId, board]) => ['uf2', 'web-native-usb'].includes(board.installMethod)); .filter(([boardId, board]) => board.installMethod === 'uf2'); //['uf2', 'web-native-usb'].includes(board.installMethod)); //funhouse
// Sort boards by vendor and name // Sort boards by vendor and name
const sortedBoards = filteredBoards const sortedBoards = filteredBoards
.sort((a, b) => { .sort((a, b) => {
const vendorA = a[1].vendor || ''; const vendorA = a[1].vendor || '';
const vendorB = b[1].vendor || ''; const vendorB = b[1].vendor || '';
if (vendorA === 'Generic') {
// Sort by vendor first return 1; // Sort Generic to the end
if (vendorA !== vendorB) { } else if (vendorB === 'Generic') {
return -1; // Sort Generic to the end
} else if (vendorA !== vendorB) {
// Sort by vendor first
return vendorA.localeCompare(vendorB); return vendorA.localeCompare(vendorB);
} }
@ -392,7 +395,8 @@ function attachEventListeners() {
// collect the asset names, split on '.' after removing wippersnapper. and take first part. // collect the asset names, split on '.' after removing wippersnapper. and take first part.
const firmwareFile = document.getElementById('firmware_file'); const firmwareFile = document.getElementById('firmware_file');
const firmwareData = window['FIRMWARE_DATA']; const firmwareData = window['FIRMWARE_DATA'];
const boardInstallName = boardConfig.installBoardName || ""; // TODO: remove once W-variant board targets have assets, and non-w variants exist in boards repo
const boardInstallName = (boardConfig.installBoardName || "").replaceAll('-','_').replace('picow','pico');
const assets = firmwareData.firmwareFiles.map(asset => { return {"name":asset.name.replace('wippersnapper.', '').split('.')[0], "url":asset.url}; }); const assets = firmwareData.firmwareFiles.map(asset => { return {"name":asset.name.replace('wippersnapper.', '').split('.')[0], "url":asset.url}; });
const asset = assets.find(asset => asset.name === boardInstallName); const asset = assets.find(asset => asset.name === boardInstallName);
if (asset) { if (asset) {

View file

@ -241,7 +241,7 @@ document.addEventListener('DOMContentLoaded', function() {
// collect the asset names, split on '.' after removing wippersnapper. and take first part. // collect the asset names, split on '.' after removing wippersnapper. and take first part.
const firmwareFile = document.getElementById('firmware_file'); const firmwareFile = document.getElementById('firmware_file');
const firmwareData = window['FIRMWARE_DATA']; const firmwareData = window['FIRMWARE_DATA'];
const boardInstallName = board.installBoardName || ""; const boardInstallName = (board.installBoardName || "").replaceAll('-','_').replace('picow','pico');
const assets = firmwareData.firmwareFiles.map(asset => { return {"name":asset.name.replace('wippersnapper.', '').split('.')[0], "url":asset.url}; }); const assets = firmwareData.firmwareFiles.map(asset => { return {"name":asset.name.replace('wippersnapper.', '').split('.')[0], "url":asset.url}; });
const asset = assets.find(asset => asset.name === boardInstallName); const asset = assets.find(asset => asset.name === boardInstallName);
if (asset) { if (asset) {