Skip to content

Commit dc8339d

Browse files
committed
Rewrite the startup of bit
1 parent b886b2f commit dc8339d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/board/Bit.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,15 @@
5454

5555
Bit.DEFAULT_SERVER = 'wss://ws.webduino.io:443';
5656

57-
proto.startup = async function () {
57+
proto.startup = function () {
5858
this._isReady = true;
59-
if (this._options.transport === 'serial') {
60-
// wait for physical board ready to receive data from serialPort
61-
await delay(0.5);
62-
this.send([0xf0, 0x0e, 0x0c, 0xf7]);
63-
}
6459
this.emit(BoardEvent.READY, this);
60+
setTimeout(function() {
61+
if (this._options.transport === 'serial') {
62+
// wait for physical board ready to receive data from serialPort
63+
this.send([0xf0, 0x0e, 0x0c, 0xf7]);
64+
}
65+
}.bind(this), 500);
6566
};
6667

6768

0 commit comments

Comments
 (0)