Skip to content

Commit

Permalink
don't try to read before writing
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-haynes committed Nov 19, 2019
1 parent 6f4e9f8 commit 677e23a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/gpio/rpio.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const RPIO = stampit
);
},
write(gpioValue) {
return Promise.try(() => this.rpio.read())
.catch(() => this.open())
return Promise.resolve(this.open())
.then(() => this.rpio.write(this.pIndex, gpioValue));
},
});
Expand Down

0 comments on commit 677e23a

Please sign in to comment.