Make the firmware updater scripts take module slot parameters instead of I2C addresses. Rename scripts from *slave* to *module*.

This commit is contained in:
László Monda
2017-11-08 18:27:45 +01:00
parent 9a5862b57c
commit 04b43896c5
8 changed files with 98 additions and 65 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env node
const uhk = require('./uhk');
const program = require('commander');
program
.usage(`moduleSlot`)
.parse(process.argv)
const moduleSlot = program.args[0];
const moduleSlotId = uhk.checkModuleSlot(moduleSlot, uhk.moduleSlotToId);
const device = uhk.getUhkDevice();
let transfer = new Buffer([uhk.usbCommands.jumpToModuleBootloader, moduleSlotId]);
device.write(uhk.getTransferData(transfer));
const response = Buffer.from(device.readSync());