Gpio must be constructed with new

This commit is contained in:
mmcw-dev 2019-02-23 20:52:47 -05:00
parent 9f4a773d2e
commit 2ad2aa57ab
1 changed files with 2 additions and 2 deletions

View File

@ -135,8 +135,8 @@ intval._declarePins = function () {
let pin let pin
for (let p in PINS) { for (let p in PINS) {
pin = PINS[p] pin = PINS[p]
if (pin.edge) intval._pin[p] = Gpio(pin.pin, pin.dir, pin.edge) if (pin.edge) intval._pin[p] = new Gpio(pin.pin, pin.dir, pin.edge)
if (!pin.edge) intval._pin[p] = Gpio(pin.pin, pin.dir) if (!pin.edge) intval._pin[p] = new Gpio(pin.pin, pin.dir)
log.info('_declarePins', { pin : pin.pin, dir : pin.dir, edge : pin.edge }) log.info('_declarePins', { pin : pin.pin, dir : pin.dir, edge : pin.edge })
} }
intval._pin.release.watch(intval._watchRelease) intval._pin.release.watch(intval._watchRelease)