Skip to content

Commit 56678b8

Browse files
committed
Add the options, initialReset and handleDigitalPins
1 parent 913a9b1 commit 56678b8

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

src/board/Bit.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
login: 'admin',
3232
password: 'password',
3333
autoReconnect: false,
34-
multi: false
34+
multi: false,
35+
initialReset: false,
36+
handleDigitalPins: true
3537
};
3638
}
3739

src/board/Smart.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
login: 'admin',
3030
password: 'password',
3131
autoReconnect: false,
32-
multi: false
32+
multi: false,
33+
initialReset: false,
34+
handleDigitalPins: true
3335
};
3436
}
3537

src/core/Board.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
switch (command) {
260260
case DIGITAL_MESSAGE:
261261
this._logger.info('processMultiByteCommand digital:', channel, commandData[1], commandData[2]);
262-
this.processDigitalMessage(channel, commandData[1], commandData[2]);
262+
this._options.handleDigitalPins && this.processDigitalMessage(channel, commandData[1], commandData[2]);
263263
break;
264264
case REPORT_VERSION:
265265
this._firmwareVersion = commandData[1] + commandData[2] / 10;
@@ -456,7 +456,14 @@
456456
}
457457

458458
if (!this._isReady) {
459-
this.enableDigitalPins();
459+
if (this._options.initialReset) {
460+
this.systemReset();
461+
}
462+
if (this._options.handleDigitalPins) {
463+
this.enableDigitalPins();
464+
} else {
465+
this.startup();
466+
}
460467
}
461468
};
462469

src/core/WebArduino.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
login: 'admin',
3535
password: 'password',
3636
autoReconnect: false,
37-
multi: false
37+
multi: false,
38+
initialReset: false,
39+
handleDigitalPins: true
3840
};
3941
}
4042

0 commit comments

Comments
 (0)