From 4889c00544dfe30f1d5b3d91c91afb78daf8d219 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Sun, 5 Nov 2023 19:52:52 -0600 Subject: [PATCH] device: Disable USB on boot 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 --- device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/device.c b/device.c index 469237e..95cded8 100644 --- a/device.c +++ b/device.c @@ -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)