Skip to content

Commit

Permalink
serial: add delay to hard_reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Aug 7, 2024
1 parent 4eddbb5 commit ca2fd9e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/store/serial/serial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {
type QuicHeader,
type QuicPacket,
} from "./quic";
import { ArrayWriter, concatUint8Array, stringToUint8Array } from "../util";
import {
ArrayWriter,
asyncDelay,
concatUint8Array,
stringToUint8Array,
} from "../util";
import { Log } from "@/log";
import { CBOR } from "./cbor";
import { WebSerial } from "./webserial";
Expand Down Expand Up @@ -175,7 +180,9 @@ export class Serial {
const target = await this.get(QuicVal.Target, 500)
.then((p) => p.name)
.catch(() => undefined);
await asyncDelay(100);
await this.write(stringToUint8Array(HARD_REBOOT_MAGIC));
await asyncDelay(100);
await this.write(stringToUint8Array("\r\nbl\r\n"));
await this.close();

Expand Down

0 comments on commit ca2fd9e

Please sign in to comment.