From 1fd0a13347811b34194fa7f24381e45ae8185395 Mon Sep 17 00:00:00 2001 From: Edgar O Silva Date: Tue, 12 Nov 2013 12:34:15 -0600 Subject: [PATCH] Add missing param emitConnect. --- dist/digital-pin.js | 6 +++--- src/digital-pin.coffee | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/digital-pin.js b/dist/digital-pin.js index 3213457..ea68e1a 100644 --- a/dist/digital-pin.js +++ b/dist/digital-pin.js @@ -153,16 +153,16 @@ } if (mode === 'w') { return FS.writeFile(this._directionPath(), GPIO_DIRECTION_WRITE, function(err) { - return _this._setModeCallback(err); + return _this._setModeCallback(err, emitConnect); }); } else if (mode === 'r') { return FS.writeFile(this._directionPath(), GPIO_DIRECTION_READ, function(err) { - return _this._setModeCallback(err); + return _this._setModeCallback(err, emitConnect); }); } }; - DigitalPin.prototype._setModeCallback = function(err) { + DigitalPin.prototype._setModeCallback = function(err, emitConnect) { if (err) { return this.self.emit('error', "Setting up pin direction failed"); } else { diff --git a/src/digital-pin.coffee b/src/digital-pin.coffee index e61d20f..7b9c0f5 100644 --- a/src/digital-pin.coffee +++ b/src/digital-pin.coffee @@ -112,11 +112,11 @@ namespace 'Cylon.IO', -> # Sets the mode for the GPIO pin by writing the correct values to the pin reference files _setMode: (mode, emitConnect = false) -> if mode == 'w' - FS.writeFile(@_directionPath(), GPIO_DIRECTION_WRITE, (err) => @_setModeCallback(err) ) + FS.writeFile(@_directionPath(), GPIO_DIRECTION_WRITE, (err) => @_setModeCallback(err, emitConnect) ) else if mode =='r' - FS.writeFile(@_directionPath(), GPIO_DIRECTION_READ, (err) => @_setModeCallback(err) ) + FS.writeFile(@_directionPath(), GPIO_DIRECTION_READ, (err) => @_setModeCallback(err, emitConnect) ) - _setModeCallback: (err) -> + _setModeCallback: (err, emitConnect) -> if (err) @self.emit('error', "Setting up pin direction failed") else