Skip to content

Commit

Permalink
Merge pull request #843 from NordicSemiconductor/feat/skip-device-set…
Browse files Browse the repository at this point in the history
…up-when-protected

Feat: allows to skip device setup when jlink device is protected
  • Loading branch information
kylebonnici authored Dec 4, 2023
2 parents c4957a7 + 81d7006 commit 177a3cc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ This project does _not_ adhere to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html) but contrary to it
every new version is a new major version.

## 137.0.0 - 2023-12-04

### Added

- `jprogDeviceSetup` take in aan optional boolean to skip the device setup if
device is protected. Default remain to show dialog. Apps will need to opt-in

## 136.0.0 - 2023-12-01

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nordicsemiconductor/pc-nrfconnect-shared",
"version": "136.0.0",
"version": "137.0.0",
"description": "Shared commodities for developing pc-nrfconnect-* packages",
"repository": {
"type": "git",
Expand Down
13 changes: 12 additions & 1 deletion src/Device/jprogOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ const firmwareOptions = (

export const jprogDeviceSetup = (
firmware: JprogEntry[],
needSerialport = false
needSerialport = false,
hideDeviceSetupWhenProtected = false
): DeviceSetup => ({
supportsProgrammingMode: device =>
(needSerialport === !!device.traits.serialPorts || !needSerialport) &&
Expand Down Expand Up @@ -176,6 +177,16 @@ export const jprogDeviceSetup = (
});
}

if (
hideDeviceSetupWhenProtected &&
readbackProtection === 'protected'
) {
return Promise.resolve({
device,
validFirmware: true,
});
}

return Promise.resolve({
device,
validFirmware: false,
Expand Down

0 comments on commit 177a3cc

Please sign in to comment.