Skip to content

Commit

Permalink
Improved error message in setting register field
Browse files Browse the repository at this point in the history
  • Loading branch information
Marus committed Jan 30, 2018
1 parent 2acdaec commit 3f814c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontend/peripheral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export class RegisterNode extends BaseNode {
return new Promise((resolve, reject) => {
var limit = Math.pow(2, width);
if(value > limit) {
return reject('Value entered is invalid. Maximum value for this field is ' + (limit - 1) + ' (0x' + hexFormat(limit-1, 0) + ')')
return reject(`Value entered is invalid. Maximum value for this field is ${limit - 1} (${hexFormat(limit-1, 0)})`);
}
else {
let mask = createMask(offset, width);
Expand Down

0 comments on commit 3f814c9

Please sign in to comment.