Skip to content

Commit eebd963

Browse files
committed
Fix picotool version, and Pico 2 W version parsing
1 parent c518847 commit eebd963

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

src/commands/switchBoard.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
cmakeUpdateSDK,
1414
} from "../utils/cmakeUtil.mjs";
1515
import { join } from "path";
16-
import { compareLtMajor } from "../utils/semverUtil.mjs";
16+
import { compareLt } from "../utils/semverUtil.mjs";
1717
import type UI from "../ui.mjs";
1818
import { updateVSCodeStaticConfigs } from "../utils/vscodeConfigUtil.mjs";
1919
import { getSupportedToolchains } from "../utils/toolchainUtil.mjs";
@@ -33,11 +33,11 @@ export default class SwitchBoardCommand extends Command {
3333
Promise<[string, boolean] | undefined> {
3434
const quickPickItems: string[] = ["pico", "pico_w"];
3535

36-
if (!compareLtMajor(sdkVersion, "2.0.0")) {
36+
if (!compareLt(sdkVersion, "2.0.0")) {
3737
quickPickItems.push("pico2");
3838
}
3939

40-
if (!compareLtMajor(sdkVersion, "2.1.0")) {
40+
if (!compareLt(sdkVersion, "2.1.0")) {
4141
quickPickItems.push("pico2_w");
4242
}
4343

src/utils/cmakeUtil.mts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { readFile, writeFile } from "fs/promises";
1010
import { rimraf, windows as rimrafWindows } from "rimraf";
1111
import { homedir } from "os";
1212
import which from "which";
13-
import { compareLtMajor } from "./semverUtil.mjs";
13+
import { compareLt } from "./semverUtil.mjs";
1414
import { buildCMakeIncPath } from "./download.mjs";
1515

1616
export const CMAKE_DO_NOT_EDIT_HEADER_PREFIX =
@@ -369,11 +369,18 @@ export async function cmakeUpdateSDK(
369369
if (
370370
picoBoard !== null &&
371371
((picoBoard[1].includes("pico2") &&
372-
compareLtMajor(newSDKVersion, "2.0.0")) ||
372+
compareLt(newSDKVersion, "2.0.0")) ||
373373
(picoBoard[1].includes('pico2_w') &&
374-
compareLtMajor(newSDKVersion, "2.1.0")))
374+
compareLt(newSDKVersion, "2.1.0")))
375375
) {
376-
const result = await window.showQuickPick(["pico", "pico_w"], {
376+
const quickPickItems = ["pico", "pico_w"];
377+
if (!compareLt(newSDKVersion, "2.0.0")) {
378+
quickPickItems.push("pico2");
379+
}
380+
if (!compareLt(newSDKVersion, "2.1.0")) {
381+
quickPickItems.push("pico2_w");
382+
}
383+
const result = await window.showQuickPick(quickPickItems, {
377384
placeHolder: "The new SDK version does not support your current board",
378385
canPickMany: false,
379386
ignoreFocusOut: true,

src/webview/newProjectPanel.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ export class NewProjectPanel {
524524
result: versionBundle !== undefined,
525525
toolchainVersion: versionBundle?.toolchain,
526526
riscvToolchainVersion: riscvToolchain,
527+
picotoolVersion: versionBundle?.picotool,
527528
},
528529
});
529530
}

0 commit comments

Comments
 (0)