refactor(usb-deployer): use named settle constant and fix comment

This commit is contained in:
a2nr 2026-07-17 10:38:40 +07:00
parent 852fccacdf
commit 8adc28b745
1 changed files with 2 additions and 3 deletions

View File

@ -210,7 +210,7 @@ export class USBHardwareDeployer implements HardwareDeployer {
if (!this.port) throw new Error('Belum terhubung ke perangkat');
console.log('[USB] resetArduino: DTR/RTS pulse');
/* DTR low + RTS low → 10ms → both high → wait 50ms for optiboot */
/* DTR low + RTS low → 10ms → both high → wait for optiboot */
await this.port.setSignals({
dataTerminalReady: false,
requestToSend: false
@ -220,8 +220,7 @@ export class USBHardwareDeployer implements HardwareDeployer {
dataTerminalReady: true,
requestToSend: true
});
/* Wait for optiboot to initialize (~100ms is safe, gives us ~900ms for sync) */
await sleep(100);
await sleep(BOOTLOADER_SETTLE_MS);
console.log('[USB] resetArduino: DTR pulse done');
}