Skip to content

Commit

Permalink
Accommodate gen4 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed May 16, 2024
1 parent 6a0eb44 commit 1abbba1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/device-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function generateDeviceSpecs() {
knownApps: knownAppsForPlatform(device.name),

// add the offsets to server and device keys in DCT
...(device.generation === 1 ? keysDctOffsets.generation1 : keysDctOffsets.laterGenerations),
...(device.generation <= 1 ? keysDctOffsets.generation1 : keysDctOffsets.laterGenerations),

// add the segments where DFU can read/write
...device.dfu.segments,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/flash-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function _get256Hash(module) {

function validateDFUSupport({ device, ui }) {
const platform = platformForId(device.platformId);
if (!device.isInDfuMode && (!semver.valid(device.firmwareVersion) || semver.lt(device.firmwareVersion, '2.0.0')) && platform.generation === 2) {
if (!device.isInDfuMode && (!semver.valid(device.firmwareVersion) || semver.lt(device.firmwareVersion, '2.0.0')) && platform.generation <= 2) {
ui.logDFUModeRequired({ showVersionWarning: true });
throw new Error('Put the device in DFU mode and try again');
}
Expand Down

0 comments on commit 1abbba1

Please sign in to comment.