File tree 2 files changed +9
-16
lines changed
2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ import (
40
40
"github.com/arduino/arduino-create-agent/systray"
41
41
"github.com/arduino/arduino-create-agent/tools"
42
42
"github.com/arduino/arduino-create-agent/updater"
43
+ "github.com/arduino/arduino-create-agent/upload"
43
44
v2 "github.com/arduino/arduino-create-agent/v2"
44
45
paths "github.com/arduino/go-paths-helper"
45
46
cors "github.com/gin-contrib/cors"
@@ -360,7 +361,14 @@ func loop() {
360
361
// launch our dummy data routine
361
362
//go d.run()
362
363
363
- go discoverLoop ()
364
+ go func () {
365
+ for {
366
+ if ! upload .Busy {
367
+ updateSerialPortList ()
368
+ }
369
+ time .Sleep (2 * time .Second )
370
+ }
371
+ }()
364
372
365
373
r := gin .New ()
366
374
Original file line number Diff line number Diff line change @@ -22,9 +22,6 @@ import (
22
22
"strconv"
23
23
"strings"
24
24
"sync"
25
- "time"
26
-
27
- "github.com/arduino/arduino-create-agent/upload"
28
25
)
29
26
30
27
type writeRequest struct {
@@ -135,18 +132,6 @@ func (sp *SerialPortList) List() {
135
132
}
136
133
}
137
134
138
- // discoverLoop periodically update the list of ports found
139
- func discoverLoop () {
140
- go func () {
141
- for {
142
- if ! upload .Busy {
143
- updateSerialPortList ()
144
- }
145
- time .Sleep (2 * time .Second )
146
- }
147
- }()
148
- }
149
-
150
135
var serialEnumeratorLock sync.Mutex
151
136
152
137
func updateSerialPortList () {
You can’t perform that action at this time.
0 commit comments