From cc91b34f3a0c93b353262951b2ed92989aa844d0 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)