Skip to content

Commit

Permalink
lib/index.js: update calls to x._port.write, etc.
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed Jun 23, 2017
1 parent 676c956 commit be6050b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class Pin extends Emitter {

if (state.isPwm || state.isServo) {
if (state.index === 15) {
state.pin._port.sock.write(new Buffer([Port.CMD.ANALOG_WRITE, value >> 8, value & 0xff]));
state.pin.port.sock.write(new Buffer([Port.CMD.ANALOG_WRITE, value >> 8, value & 0xff]));
} else {
state.pin.pwmDutyCycle(value);
}
Expand Down Expand Up @@ -487,7 +487,7 @@ class Pin extends Emitter {
if (state.isAnalogInput) {
adcReadRequests.push({
command: new Buffer([Port.CMD.ANALOG_READ, index]),
port: state.pin._port,
port: state.pin.port,
size,
callback,
});
Expand All @@ -504,9 +504,9 @@ class Pin extends Emitter {
}

const poll = _ => {
state.pin._port.cork();
state.pin._port.sock.write(state.commands.read);
state.pin._port.enqueue({
state.pin.port.cork();
state.pin.port.sock.write(state.commands.read);
state.pin.port.enqueue({
size,
callback(error, data) {
/* istanbul ignore if */
Expand All @@ -524,7 +524,7 @@ class Pin extends Emitter {
data = null;
},
});
state.pin._port.uncork();
state.pin.port.uncork();
};

poll();
Expand Down

0 comments on commit be6050b

Please sign in to comment.