From 48e221cca00c9f925ff57588dd782842705f7a23 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 20 Oct 2018 17:29:36 -0700 Subject: altoslib: When flashing hardware, pull USB data from device if needed If we fail to extract USB vid/pid and product values from the device ROM, use the data discovered over USB when the device was originally discovered. Also, use the USB product to select appropriate .ihx files instead of only using the USB vid/pid. This will help people avoid using the wrong file when reflashing devices. Signed-off-by: Keith Packard --- altoslib/AltosFlash.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'altoslib/AltosFlash.java') diff --git a/altoslib/AltosFlash.java b/altoslib/AltosFlash.java index e6b05713..434a0265 100644 --- a/altoslib/AltosFlash.java +++ b/altoslib/AltosFlash.java @@ -331,9 +331,13 @@ public class AltosFlash extends AltosProgrammer { rom_config = romconfig; } - public AltosRomconfig target_romconfig() throws InterruptedException { + public AltosRomconfig target_romconfig(AltosUsbId usb_id, String usb_product) throws InterruptedException { if (!check_rom_config()) return null; + if (rom_config.usb_id == null) + rom_config.usb_id = usb_id; + if (rom_config.usb_product == null) + rom_config.usb_product = usb_product; return rom_config; } -- cgit v1.2.3