File tree 1 file changed +2
-6
lines changed
arduino-core/src/cc/arduino/packages/discoverers/serial
1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -162,19 +162,18 @@ public synchronized void forceRefresh() {
162
162
Map <String , Object > boardData = platform .resolveDeviceByVendorIdProductId (port , BaseNoGui .packages );
163
163
164
164
BoardPort boardPort = null ;
165
- boolean updatingInfos = false ;
166
165
int i = 0 ;
167
166
// create new board or update existing
168
167
for (BoardPort board : boardPorts ) {
169
168
if (board .toString ().equals (newPort )) {
170
- updatingInfos = true ;
171
169
boardPort = boardPorts .get (i );
172
170
break ;
173
171
}
174
172
i ++;
175
173
}
176
- if (! updatingInfos ) {
174
+ if (boardPort == null ) {
177
175
boardPort = new BoardPort ();
176
+ boardPorts .add (boardPort );
178
177
}
179
178
boardPort .setAddress (port );
180
179
boardPort .setProtocol ("serial" );
@@ -216,9 +215,6 @@ public synchronized void forceRefresh() {
216
215
}
217
216
218
217
boardPort .setLabel (label );
219
- if (!updatingInfos ) {
220
- boardPorts .add (boardPort );
221
- }
222
218
}
223
219
setSerialBoardPorts (boardPorts );
224
220
}
You can’t perform that action at this time.
0 commit comments