Skip to content

Commit

Permalink
device: Disable USB on boot
Browse files Browse the repository at this point in the history
Leaving USB connected might cause hickups on the USB bus, and causes
power measurements to report incorrect data. Turn it off once the image
has been downloaded.

Signed-off-by: Bjorn Andersson <[email protected]>
  • Loading branch information
quic-bjorande committed Nov 28, 2023
1 parent 81e4687 commit cc91b34
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions device.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ void device_boot(struct device *device, const void *data, size_t len)
fastboot_set_active(device->fastboot, device->set_active);
fastboot_download(device->fastboot, data, len);
device->boot(device);

if (device->status_enabled && !device->usb_always_on) {
warnx("disabling USB, use ^A V to enable");
device_usb(device, false);
}
}

void device_send_break(struct device *device)
Expand Down

0 comments on commit cc91b34

Please sign in to comment.