Skip to content

Commit

Permalink
fixed typos, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mwittig committed Mar 30, 2019
1 parent 0097f38 commit b668d44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Board = (function(superClass) {
this._onAcknowledge = bind(this._onAcknowledge, this);
var GpioDriver, SerialPortDriver;
assert(driver === "serialport" || driver === "gpio");
Board.__super__.constructor.call(this);
switch (driver) {
case "serialport":
SerialPortDriver = require('./driver/serialport');
Expand Down
7 changes: 4 additions & 3 deletions src/board.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Board extends events.EventEmitter

constructor: (driver, driverOptions) ->
assert driver in ["serialport", "gpio"]
super()
# setup a new driver
switch driver
when "serialport"
Expand Down Expand Up @@ -61,11 +62,11 @@ class Board extends events.EventEmitter
@stopWatchdog()
@_watchdogTimeout = setTimeout( (=>
now = new Date().getTime()
# last received data is not very old, conncection looks ok:
# last received data is not very old, connection looks ok:
if now - @_lastDataTime < @timeout
@setupWatchdog()
return
# Try to send ping, if it failes, there is something wrong...
# Try to send ping, if it fails, there is something wrong...
@driver.write("PING\n").then( =>
@setupWatchdog()
).timeout(20*1000).catch( (err) =>
Expand Down Expand Up @@ -175,7 +176,7 @@ class Board extends events.EventEmitter
readDstAll: (pin) ->
reading = @writeAndWait("DST #{pin} all\n")
promise = reading
.then( (args) ->
.then( (args) ->
{
temperature: parseFloat(args[0])
})
Expand Down

0 comments on commit b668d44

Please sign in to comment.