From f724ef775e1c8772cdc4cba2b8b3b90c0273eaf6 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Sun, 15 Jan 2017 18:47:43 -0800 Subject: [PATCH] remove queue wrap of bus r/w --- lib/mcp23008-17.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/mcp23008-17.js b/lib/mcp23008-17.js index 0673d6e..2ed4a2f 100644 --- a/lib/mcp23008-17.js +++ b/lib/mcp23008-17.js @@ -13,9 +13,12 @@ class MCP23008 extends Device { this.ports = {} opts.portID = 'A' this.ports.A = new Port(opts) + console.log(this.ports.A) // if not specified there RPi is not managing the interrupt // pin number on RPi that is connected to and services the interrupt. 4/17/27/22 = 7/11/13/15 - this.ports.A.interPin = opts.interPin.A ? opts.interPin.A : opts.interPin + if (opts.interPin) { + this.ports.A.interPin = opts.interPin.A ? opts.interPin.A : opts.interPin + } } // end constructor init() { @@ -132,7 +135,9 @@ class MCP23017 extends MCP23008 { // add a second port opts.portID = 'B' this.ports.B = new Port(opts) - this.ports.B.interPin = opts.interPin.B ? opts.interPin.B : opts.interPin + if (opts.interPin) { + this.ports.B.interPin = opts.interPin.B ? opts.interPin.B : opts.interPin + } } pin(id, port) {