Skip to content

Commit

Permalink
Fixed run config and target selection
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Oct 1, 2024
1 parent 64d27cb commit 1dbcd2c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
14 changes: 12 additions & 2 deletions src/commands/launchTargetPath.mts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class LaunchTargetPathCommand extends CommandWithResult<string> {
chip === "rp2040"
? "thumbv6m-none-eabi"
: chip === "rp2350"
? "thumbv8m.main-none-eabi"
? "thumbv8m.main-none-eabihf"
: "riscv32imac-unknown-none-elf";

return joinPosix(
Expand Down Expand Up @@ -179,10 +179,20 @@ export class LaunchTargetPathReleaseCommand extends CommandWithResult<string> {
| undefined;

if (cargoToml?.package?.name) {
const chip = rustProjectGetSelectedChip(
workspace.workspaceFolders[0].uri.fsPath
);
const toolchain =
chip === "rp2040"
? "thumbv6m-none-eabi"
: chip === "rp2350"
? "thumbv8m.main-none-eabihf"
: "riscv32imac-unknown-none-elf";

return joinPosix(
workspace.workspaceFolders[0].uri.fsPath.replaceAll("\\", "/"),
"target",
"thumbv6m-none-eabi",
toolchain,
"release",
cargoToml.package.name
);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/switchBoard.mts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default class SwitchBoardCommand extends Command {
board === "RP2040"
? "thumbv6m-none-eabi"
: board === "RP2350"
? "thumbv8m.main-none-eabi"
? "thumbv8m.main-none-eabihf"
: "riscv32imac-unknown-none-elf";

await workspace
Expand Down
4 changes: 2 additions & 2 deletions src/utils/projectGeneration/projectRust.mts
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ async function generateVSCodeConfig(projectRoot: string): Promise<boolean> {
},
{
label: "Run Project",
type: "process",
type: "shell",
dependsOn: "Compile Project",
command: `\${command:${extensionName}.${GetPicotoolPathCommand.id}}`,
args: [
"load",
"-x",
"${command:raspberry-pi-pico.launchTargetPath}",
"${command:raspberry-pi-pico.launchTargetPathRelease}",
"-t",
"elf",
"-f",
Expand Down

0 comments on commit 1dbcd2c

Please sign in to comment.