diff --git a/src/api/comms/serial/SerialAPI.ts b/src/api/comms/serial/SerialAPI.ts index af45faca..0d699258 100644 --- a/src/api/comms/serial/SerialAPI.ts +++ b/src/api/comms/serial/SerialAPI.ts @@ -130,6 +130,15 @@ const enumerate = async ( for (const device of serialDevices) { const vID = parseInt(`0x${device.vendorId}`, 16); const pID = parseInt(`0x${device.productId}`, 16); + const Bdevice = Hardware.bootloader.find(h => h.usb.productId === pID && h.usb.vendorId === vID); + if (Bdevice) { + // Special treatment for Raise Bootloader + const newPort: ExtendedPort = { ...device, device: { ...Bdevice } }; + log.info("Detected Bootloader: ", newPort, Bdevice, true); + foundDevices.push(newPort); + // eslint-disable-next-line no-continue + continue; + } if (vID === searchDevice.vendorId && pID === searchDevice.productId && !existingIDs.includes(device.serialNumber)) { const supported = await checkProperties(device.path); const Hdevice = Hardware.serial.find( @@ -154,12 +163,13 @@ const enumerate = async ( for (const device of serialDevices) { const vID = parseInt(`0x${device.vendorId}`, 16); const pID = parseInt(`0x${device.productId}`, 16); - if (vID === 0x1209 && pID === 0x2200) { + const Bdevice = Hardware.bootloader.find(h => h.usb.productId === pID && h.usb.vendorId === vID); + if (Bdevice) { // Special treatment for Raise Bootloader - const Hdevice = Hardware.bootloader.find(h => h.usb.productId === pID && h.usb.vendorId === vID); - const newPort: ExtendedPort = { ...device, device: { ...Hdevice } }; - log.info("Newly created port: ", newPort, Hdevice, true); + const newPort: ExtendedPort = { ...device, device: { ...Bdevice } }; + log.info("Detected Bootloader: ", newPort, Bdevice, true); foundDevices.push(newPort); + // eslint-disable-next-line no-continue continue; } if ([0x35ef, 0x1209].includes(vID) && !existingIDs.includes(device.serialNumber.toLowerCase())) {