Add missing param emitConnect.

This commit is contained in:
Edgar O Silva 2013-11-12 12:34:15 -06:00
parent 5fa0177d90
commit 1fd0a13347
2 changed files with 6 additions and 6 deletions

6
dist/digital-pin.js vendored
View File

@ -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 {

View File

@ -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