Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
338 changes: 169 additions & 169 deletions Changelog.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
LicenseID: LicenseRef-Nordic-4-Clause

ExtractedText: <text>

Copyright (c) 2015 Nordic Semiconductor ASA
All rights reserved.

SPDX-License-Identifier: Nordic-4-Clause

Use in source and binary forms, redistribution in binary form only, with
or without modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -33,3 +36,4 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</text>
1,294 changes: 1,079 additions & 215 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"prepare": "husky install"
},
"devDependencies": {
"@nordicsemiconductor/pc-nrfconnect-shared": "^219.0.0"
"@nordicsemiconductor/pc-nrfconnect-shared": "^231.0.0"
},
"eslintConfig": {
"extends": "./node_modules/@nordicsemiconductor/pc-nrfconnect-shared/config/eslintrc"
Expand Down
37 changes: 22 additions & 15 deletions src/actions/fileActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const updateCoreInfo = (): AppThunk<RootState> => (dispatch, getState) => {
startAddresses.find(
s =>
s >= networkCore.romBaseAddr &&
s <= networkCore.romBaseAddr + networkCore.romSize
s <= networkCore.romBaseAddr + networkCore.romSize,
)
) {
dispatch(setDeviceDefinition(nRF5340DefaultDevice));
Expand All @@ -81,7 +81,7 @@ const updateCoreInfo = (): AppThunk<RootState> => (dispatch, getState) => {
romSize: Math.max(lastEndAddress, 0x100000), // 1 MB
},
},
})
}),
);
}
};
Expand All @@ -90,9 +90,12 @@ export const removeFile =
(filePath: string): AppThunk<RootState> =>
(dispatch, getState) => {
const { loaded, memMaps } = getState().app.file;
const newLoaded = { ...loaded };

const newLoaded = Object.fromEntries(
Object.entries(loaded).filter(([key]) => key !== filePath),
);

const newMemMaps = memMaps.filter(element => element[0] !== filePath);
delete newLoaded[filePath];

dispatch(fileParse({ loaded: newLoaded, memMaps: newMemMaps }));
dispatch(updateCoreInfo());
Expand Down Expand Up @@ -135,10 +138,12 @@ const parseZipFile =
stat(filePath, (statsError, result) => {
if (statsError) {
logger.error(
`Could not open ZIP file: ${describeError(statsError)}`
`Could not open ZIP file: ${describeError(statsError)}`,
);
dispatch(
ErrorDialogActions.showDialog(describeError(statsError))
ErrorDialogActions.showDialog(
describeError(statsError),
),
);
removeMruFile(filePath);
return reject();
Expand All @@ -163,10 +168,12 @@ const parseHexFile =
stat(filePath, (statsError, result) => {
if (statsError) {
logger.error(
`Could not open HEX file: ${describeError(statsError)}`
`Could not open HEX file: ${describeError(statsError)}`,
);
dispatch(
ErrorDialogActions.showDialog(describeError(statsError))
ErrorDialogActions.showDialog(
describeError(statsError),
),
);
removeMruFile(filePath);
return reject();
Expand All @@ -180,14 +187,14 @@ const parseHexFile =
logger.info('Parsing HEX file: ', filePath);
logger.info(
'File was last modified at ',
stats.mtime.toLocaleString()
stats.mtime.toLocaleString(),
);
if (readError) {
logger.error(
`Could not open HEX file: ${describeError(readError)}`
`Could not open HEX file: ${describeError(readError)}`,
);
dispatch(
ErrorDialogActions.showDialog(describeError(readError))
ErrorDialogActions.showDialog(describeError(readError)),
);
removeMruFile(filePath);
return reject();
Expand Down Expand Up @@ -268,7 +275,7 @@ export const openFileDialog = (): AppThunk => dispatch => {
.showOpenDialog(getCurrentWindow(), dialogOptions)
.then(
({ filePaths }: { filePaths: string[] }) =>
filePaths && dispatch(openFile(...filePaths))
filePaths && dispatch(openFile(...filePaths)),
);
};

Expand All @@ -288,11 +295,11 @@ export const refreshAllFiles =
logger.info('Does not need to be reloaded: ', filePath);
} catch (error) {
logger.error(
`Could not open HEX file: ${describeError(error)}`
`Could not open HEX file: ${describeError(error)}`,
);
dispatch(
ErrorDialogActions.showDialog(describeError(error))
ErrorDialogActions.showDialog(describeError(error)),
);
}
})
}),
).then(() => Promise.resolve());
Loading