Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(async device => {
const transport = new WebUSB(device);
const processor = new CortexM(transport);
await processor.connect();
await processor.halt();
const registers = Array.from({ length: count }, (_, index) => index);
const values = await processor.readCoreRegisters(registers);
await processor.resume();
await processor.disconnect();
const result = values.map(register => ("00000000" + register.toString(16)).slice(-8));
return result;
});
}