Skip to content

Commit

Permalink
avoid exceptions when cape_universal is enabled on the bbb
Browse files Browse the repository at this point in the history
  • Loading branch information
fivdi committed Jun 5, 2016
1 parent 25b72a7 commit e8c3be8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Unpublished
===========
* avoid exceptions when cape_universal is enabled on the bbb [#50](https://github.com/fivdi/onoff/issues/50)

1.1.0 - May 04 2016
===================
* activeLow option
Expand Down
7 changes: 6 additions & 1 deletion onoff.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ Gpio.prototype.options = function () {
Gpio.prototype.unexport = function () {
this.unwatchAll();
fs.closeSync(this.valueFd);
fs.writeFileSync(GPIO_ROOT_PATH + 'unexport', this.gpio);
try {
fs.writeFileSync(GPIO_ROOT_PATH + 'unexport', this.gpio);
} catch (ignore) {
// Flow of control always arrives here when cape_universal is enabled on
// the bbb.
}
};

0 comments on commit e8c3be8

Please sign in to comment.