From 4e2d86742463a8e7d0f7651105c70a8d51f60c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sun, 29 Oct 2017 18:17:48 +0100 Subject: [PATCH] Extract the USB product ID for getBlhostCmd() --- scripts/shared.js | 4 ++-- scripts/update-slave-firmware.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/shared.js b/scripts/shared.js index 7d7f896..9c4bc69 100644 --- a/scripts/shared.js +++ b/scripts/shared.js @@ -17,7 +17,7 @@ function checkFirmwareImage(imagePath, extension) { } } -function getBlhostCmd() { +function getBlhostCmd(pid) { let blhostPath; switch (process.platform) { case 'linux': @@ -35,7 +35,7 @@ function getBlhostCmd() { break; } - return `../../../lib/bootloader/bin/Tools/blhost/${blhostPath} --usb 0x1d50,0x6121`; + return `../../../lib/bootloader/bin/Tools/blhost/${blhostPath} --usb 0x1d50,${pid}`; } function execRetry(command) { diff --git a/scripts/update-slave-firmware.js b/scripts/update-slave-firmware.js index b8b9575..a3c2e99 100755 --- a/scripts/update-slave-firmware.js +++ b/scripts/update-slave-firmware.js @@ -12,7 +12,7 @@ program const firmwareImage = program.args[0]; const usbDir = '../../../lib/agent/packages/usb'; -const blhostUsb = getBlhostCmd(); +const blhostUsb = getBlhostCmd(0x6121); const blhostBuspal = blhostUsb + ' --buspal i2c,0x10,100k'; checkFirmwareImage(firmwareImage, extension);