Skip to content

Commit

Permalink
Nitpicking trailing commas
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Mar 14, 2016
1 parent 061e2c4 commit 01f6acb
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions lib/firmata.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ MIDI_RESPONSE[ANALOG_MESSAGE] = function(board) {
board.emit("analog-read-" + pin, value);
board.emit("analog-read", {
pin: pin,
value: value
value: value,
});
};

Expand All @@ -156,7 +156,7 @@ MIDI_RESPONSE[DIGITAL_MESSAGE] = function(board) {
board.emit("digital-read-" + pinNumber, pin.value);
board.emit("digital-read", {
pin: pinNumber,
value: pin.value
value: pin.value,
});
}
}
Expand Down Expand Up @@ -227,7 +227,7 @@ SYSEX_RESPONSE[CAPABILITY_RESPONSE] = function(board) {
supportedModes: supportedModes(capability),
mode: undefined,
value: 0,
report: 1
report: 1,
});
capability = 0;
n = 0;
Expand Down Expand Up @@ -427,8 +427,8 @@ function Board(port, options, callback) {
samplingInterval: 19,
serialport: {
baudRate: 57600,
bufferSize: 1
}
bufferSize: 1,
},
};

var settings = Object.assign({}, defaults, options);
Expand All @@ -448,37 +448,37 @@ function Board(port, options, callback) {
SERIAL: 0x0A,
IGNORE: 0x7F,
PING_READ: 0x75,
UNKOWN: 0x10
UNKOWN: 0x10,
};

this.I2C_MODES = {
WRITE: 0,
READ: 1,
CONTINUOUS_READ: 2,
STOP_READING: 3
STOP_READING: 3,
};

this.STEPPER = {
TYPE: {
DRIVER: 1,
TWO_WIRE: 2,
FOUR_WIRE: 4
FOUR_WIRE: 4,
},
RUNSTATE: {
STOP: 0,
ACCEL: 1,
DECEL: 2,
RUN: 3
RUN: 3,
},
DIRECTION: {
CCW: 0,
CW: 1
}
CW: 1,
},
};

this.SERIAL_MODES = {
CONTINUOUS_READ: 0x00,
STOP_READING: 0x01
STOP_READING: 0x01,
};

// ids for hardware and software serial ports on the board
Expand All @@ -490,7 +490,7 @@ function Board(port, options, callback) {
SW_SERIAL0: 0x08,
SW_SERIAL1: 0x09,
SW_SERIAL2: 0x10,
SW_SERIAL3: 0x11
SW_SERIAL3: 0x11,
};

// map to the pin resolution value in the capability query response
Expand All @@ -502,7 +502,7 @@ function Board(port, options, callback) {
RES_RX2: 0x04,
RES_TX2: 0x05,
RES_RX3: 0x06,
RES_TX3: 0x07
RES_TX3: 0x07,
};

this.HIGH = 1;
Expand Down Expand Up @@ -792,7 +792,7 @@ Board.prototype.servoConfig = function(pin, min, max) {
(min >> 7) & 0x7F,
max & 0x7F,
(max >> 7) & 0x7F,
END_SYSEX
END_SYSEX,
];

this.pins[pin].mode = this.MODES.SERVO;
Expand Down Expand Up @@ -1010,7 +1010,7 @@ Board.prototype.i2cConfig = function(options) {
START_SYSEX,
I2C_CONFIG,
delay & 0xFF, (delay >> 8) & 0xFF,
END_SYSEX
END_SYSEX,
]);

return this;
Expand Down Expand Up @@ -1128,7 +1128,7 @@ Board.prototype.i2cWriteReg = function(address, register, byte) {
register & 0x7F, (register >> 7) & 0x7F,
// byte
byte & 0x7F, (byte >> 7) & 0x7F,
END_SYSEX
END_SYSEX,
]);

return this;
Expand All @@ -1149,7 +1149,7 @@ Board.prototype.sendI2CReadRequest = function(address, numBytes, callback) {
address,
this.I2C_MODES.READ << 3,
numBytes & 0x7F, (numBytes >> 7) & 0x7F,
END_SYSEX
END_SYSEX,
]);
this.once("I2C-reply-" + address + "-0" , callback);
};
Expand Down Expand Up @@ -1506,7 +1506,7 @@ Board.prototype.pingRead = function(opts, callback) {
timeoutArray[1] & 0x7F, (timeoutArray[1] >> 7) & 0x7F,
timeoutArray[2] & 0x7F, (timeoutArray[2] >> 7) & 0x7F,
timeoutArray[3] & 0x7F, (timeoutArray[3] >> 7) & 0x7F,
END_SYSEX
END_SYSEX,
];
this.transport.write(new Buffer(data));
this.once("ping-read-" + pin, callback);
Expand Down Expand Up @@ -1537,7 +1537,7 @@ Board.prototype.stepperConfig = function(deviceNum, type, stepsPerRev, dirOrMoto
type,
stepsPerRev & 0x7F, (stepsPerRev >> 7) & 0x7F,
dirOrMotor1Pin,
stepOrMotor2Pin
stepOrMotor2Pin,
];
if (type === this.STEPPER.TYPE.FOUR_WIRE) {
data.push(motor3Pin, motor4Pin);
Expand Down Expand Up @@ -1647,7 +1647,7 @@ Board.prototype.serialWrite = function(portId, inBytes) {
var data = [
START_SYSEX,
SERIAL_MESSAGE,
SERIAL_WRITE | portId
SERIAL_WRITE | portId,
];
for (var i = 0, len = inBytes.length; i < len; i++) {
data.push(inBytes[i] & 0x007F);
Expand Down Expand Up @@ -1702,7 +1702,7 @@ Board.prototype.serialStop = function(portId) {
SERIAL_MESSAGE,
SERIAL_READ | portId,
this.SERIAL_MODES.STOP_READING,
END_SYSEX
END_SYSEX,
];
this.transport.write(new Buffer(data));

Expand All @@ -1719,7 +1719,7 @@ Board.prototype.serialClose = function(portId) {
START_SYSEX,
SERIAL_MESSAGE,
SERIAL_CLOSE | portId,
END_SYSEX
END_SYSEX,
];
this.transport.write(new Buffer(data));
};
Expand All @@ -1736,7 +1736,7 @@ Board.prototype.serialFlush = function(portId) {
START_SYSEX,
SERIAL_MESSAGE,
SERIAL_FLUSH | portId,
END_SYSEX
END_SYSEX,
];
this.transport.write(new Buffer(data));
};
Expand All @@ -1757,7 +1757,7 @@ Board.prototype.serialListen = function(portId) {
START_SYSEX,
SERIAL_MESSAGE,
SERIAL_LISTEN | portId,
END_SYSEX
END_SYSEX,
];
this.transport.write(new Buffer(data));
};
Expand Down

0 comments on commit 01f6acb

Please sign in to comment.