initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
/** Serialize J-Link GDB Server starts so two probes on USB do not race. */
|
||||
let spawnChain = Promise.resolve();
|
||||
|
||||
const withGdbSpawn = async fn => {
|
||||
const run = spawnChain.then(() => fn());
|
||||
spawnChain = run
|
||||
.then(() => wait(450))
|
||||
.catch(() => wait(450));
|
||||
return run;
|
||||
};
|
||||
|
||||
module.exports = { withGdbSpawn };
|
||||
Reference in New Issue
Block a user