8000 Auto-select boards config with `hardwareId` if present by davegarthsimpson · Pull Request #1885 · arduino/arduino-ide · GitHub
[go: up one dir, main page]

Skip to content

Auto-select boards config with hardwareId if present 8000 #1885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
naming and param fixup
  • Loading branch information
davegarthsimpson committed Feb 22, 2023
commit 8a3591f2ad53ad0e109d70315d799fa96e7cd1f1
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class BoardsServiceProvider
const lastBoardsConfigOnUpload = this.lastBoardsConfigOnUpload;

if (boardOnAppearedPort && lastBoardsConfigOnUpload.selectedBoard) {
const boardIsSameHardware = Board.sameDistinctHardwareAs(
const boardIsSameHardware = Board.hardwareIdEquals(
boardOnAppearedPort,
lastBoardsConfigOnUpload.selectedBoard
);
8000 Expand Down Expand Up @@ -338,7 +338,7 @@ export class BoardsServiceProvider
? selectedBoard
: this._availableBoards.find(
(availableBoard) =>
Board.sameDistinctHardwareAs(availableBoard, selectedBoard) ||
Board.hardwareIdEquals(availableBoard, selectedBoard) ||
Board.sameAs(availableBoard, selectedBoard)
);
if (
Expand Down Expand Up @@ -370,7 +370,7 @@ export class BoardsServiceProvider
({ state }) => state !== AvailableBoard.State.incomplete
)) {
if (
(Board.sameDistinctHardwareAs(
(Board.hardwareIdEquals(
this.latestValidBoardsConfig.selectedBoard,
board
) ||
Expand Down
5 changes: 1 addition & 4 deletions arduino-ide-extension/src/common/protocol/boards-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,7 @@ export namespace Board {
return left.name === right.name && left.fqbn === right.fqbn;
}

export function sameDistinctHardwareAs(
left: Board,
right: string | Board
): boolean {
export function hardwareIdEquals(left: Board, right: Board): boolean {
if (Board.is(right) && left.port && right.port) {
const { hardwareId: leftHardwareId } = left.port;
const { hardwareId: rightHardwareId } = right.port;
Expand Down
0