memLayout() bank descriptot cleanup
This commit is contained in:
+6
-2
@@ -323,12 +323,16 @@ function memLayout(callback) {
|
||||
let lines = device.split('\n');
|
||||
const sizeString = util.getValue(lines, 'Size');
|
||||
const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024;
|
||||
let bank = util.getValue(lines, 'Bank Locator');
|
||||
if (bank.toLowerCase().indexOf('bad') >= 0) {
|
||||
bank = '';
|
||||
}
|
||||
if (parseInt(util.getValue(lines, 'Size'), 10) > 0) {
|
||||
const totalWidth = util.toInt(util.getValue(lines, 'Total Width'));
|
||||
const dataWidth = util.toInt(util.getValue(lines, 'Data Width'));
|
||||
result.push({
|
||||
size,
|
||||
bank: util.getValue(lines, 'Bank Locator'),
|
||||
bank,
|
||||
type: util.getValue(lines, 'Type:'),
|
||||
ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
|
||||
clockSpeed: (util.getValue(lines, 'Configured Clock Speed:') ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10) : (util.getValue(lines, 'Speed:') ? parseInt(util.getValue(lines, 'Speed:'), 10) : null)),
|
||||
@@ -343,7 +347,7 @@ function memLayout(callback) {
|
||||
} else {
|
||||
result.push({
|
||||
size: 0,
|
||||
bank: util.getValue(lines, 'Bank Locator'),
|
||||
bank,
|
||||
type: 'Empty',
|
||||
ecc: null,
|
||||
clockSpeed: 0,
|
||||
|
||||
Reference in New Issue
Block a user