Fx missing param in setModeCallback.
This commit is contained in:
parent
11fda85e56
commit
5fa0177d90
|
@ -153,16 +153,16 @@
|
|||
}
|
||||
if (mode === 'w') {
|
||||
return FS.writeFile(this._directionPath(), GPIO_DIRECTION_WRITE, function(err) {
|
||||
return _this._setModeCallback();
|
||||
return _this._setModeCallback(err);
|
||||
});
|
||||
} else if (mode === 'r') {
|
||||
return FS.writeFile(this._directionPath(), GPIO_DIRECTION_READ, function(err) {
|
||||
return _this._setModeCallback();
|
||||
return _this._setModeCallback(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
DigitalPin.prototype._setModeCallback = function() {
|
||||
DigitalPin.prototype._setModeCallback = function(err) {
|
||||
if (err) {
|
||||
return this.self.emit('error', "Setting up pin direction failed");
|
||||
} else {
|
||||
|
|
|
@ -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() )
|
||||
FS.writeFile(@_directionPath(), GPIO_DIRECTION_WRITE, (err) => @_setModeCallback(err) )
|
||||
else if mode =='r'
|
||||
FS.writeFile(@_directionPath(), GPIO_DIRECTION_READ, (err) => @_setModeCallback() )
|
||||
FS.writeFile(@_directionPath(), GPIO_DIRECTION_READ, (err) => @_setModeCallback(err) )
|
||||
|
||||
_setModeCallback: () ->
|
||||
_setModeCallback: (err) ->
|
||||
if (err)
|
||||
@self.emit('error', "Setting up pin direction failed")
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue