Skip to content

Commit 75cce81

Browse files
author
Alberto Iannaccone
committed
minor fix
1 parent 08b816c commit 75cce81

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/boardConfiguration.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { takeUntil, filter, first } from 'rxjs/operators';
3232
import { provisioningSketch } from './sketches/provisioning.ino';
3333

3434
const BAUDRATE = 9600;
35-
const UPLOAD_DONE_TIMER = 5000;
3635
export default class BoardConfiguration {
3736
constructor(daemon) {
3837
this.CONFIGURE_IN_PROGRESS = 'CONFIGURE_IN_PROGRESS';
@@ -72,7 +71,6 @@ export default class BoardConfiguration {
7271
let partialMessage = '';
7372
const gettingCsr = new Promise((resolve, reject) => {
7473
const parseCsrQuestions = message => {
75-
// TODO: store partial messages
7674
partialMessage += message;
7775

7876
if (partialMessage.indexOf('No ECCX08 present') !== -1) {
@@ -210,7 +208,7 @@ export default class BoardConfiguration {
210208
err: error.toString()
211209
});
212210
});
213-
timer(UPLOAD_DONE_TIMER).subscribe(() => this.daemon.openSerialMonitor(board.port, BAUDRATE));
211+
this.daemon.openSerialMonitor(board.port, BAUDRATE);
214212
});
215213

216214
this.daemon.uploadingError.pipe(first()).subscribe(upload => {

src/socket-daemon.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import Daemon from './daemon';
4040
const MIN_VERSION = '1.1.71';
4141
const browser = detect();
4242
const POLLING_INTERVAL = 2500;
43+
const UPLOAD_DONE_TIMER = 5000;
4344

4445
const PROTOCOL = {
4546
HTTP: 'http',
@@ -331,7 +332,7 @@ export default class SocketDaemon extends Daemon {
331332
}
332333
if (message.Flash === 'Ok' && message.ProgrammerStatus === 'Done') {
333334
// After the upload is completed the port goes down for a while, so we have to wait a few seconds
334-
return timer(10000).subscribe(() => this.uploading.next({ status: this.UPLOAD_DONE, msg: message.Flash }));
335+
return timer(UPLOAD_DONE_TIMER).subscribe(() => this.uploading.next({ status: this.UPLOAD_DONE, msg: message.Flash }));
335336
}
336337
switch (message.ProgrammerStatus) {
337338
case 'Starting':

0 commit comments

Comments
 (0)