Merge pull request #81 from gfwilliams/master

If DFU update fails, automatically try again but with a delay between writes
This commit is contained in:
Rob Moran
2024-01-11 09:33:07 +00:00
committed by GitHub

View File

@@ -548,7 +548,14 @@ export class SecureDfu extends EventDispatcher {
resolve(device);
});
})
.catch(error => reject(error));
.catch(error => {
if (this.delay === 0) {
this.log("DFU update failed, but delay=0. Trying again with delay=10...");
this.delay = 10;
return this.update(device, init, firmware);
}
reject(error);
});
});
}
}