Add scripts for getting/setting firmware variables (#734)
This commit is contained in:
Executable
+11
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const uhk = require('./uhk');
|
||||||
|
const device = uhk.getUhkDevice();
|
||||||
|
const sendData = new Buffer([uhk.usbCommands.getVariable, +process.argv[2]]);
|
||||||
|
|
||||||
|
console.log(sendData);
|
||||||
|
device.write(uhk.getTransferData(sendData));
|
||||||
|
const receivedBuffer = Buffer.from(device.readSync());
|
||||||
|
console.log(receivedBuffer[1]);
|
||||||
|
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const uhk = require('./uhk');
|
||||||
|
const device = uhk.getUhkDevice();
|
||||||
|
const sendData = new Buffer([uhk.usbCommands.setVariable, +process.argv[2], +process.argv[3]]);
|
||||||
|
|
||||||
|
console.log(sendData);
|
||||||
|
device.write(uhk.getTransferData(sendData));
|
||||||
|
|
||||||
|
|
||||||
@@ -450,6 +450,14 @@ uhk = exports = module.exports = moduleExports = {
|
|||||||
getSlaveI2cErrors : 0x0f,
|
getSlaveI2cErrors : 0x0f,
|
||||||
setI2cBaudRate : 0x10,
|
setI2cBaudRate : 0x10,
|
||||||
switchKeymap : 0x11,
|
switchKeymap : 0x11,
|
||||||
|
getVariable : 0x12,
|
||||||
|
setVariable : 0x13,
|
||||||
|
},
|
||||||
|
usbVariables: {
|
||||||
|
testSwitches : 0x00,
|
||||||
|
testUsbStack : 0x01,
|
||||||
|
debounceTimePress : 0x02,
|
||||||
|
debounceTimeRelease : 0x03,
|
||||||
},
|
},
|
||||||
enumerationModes: {
|
enumerationModes: {
|
||||||
bootloader: 0,
|
bootloader: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user