Skip to content

Commit 67991ff

Browse files
committed
Update Arduino Output plugin for Linux compatibility
1 parent fb830a0 commit 67991ff

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Plugins/ArduinoOutput/ArduinoOutput.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,20 @@ Array<String> ArduinoOutput::getDevices()
6262

6363
for (int i = 0; i < devices.size(); i++)
6464
{
65+
66+
#ifdef WIN32
6567
if (devices[i].getDeviceName().compare(0, 7, "Arduino") == 0)
6668
{
6769
out.add (devices[i].getDevicePath());
6870
}
71+
#else
72+
if (devices[i].getDeviceName().compare(0, 6, "ttyACM") == 0 ||
73+
devices[i].getDeviceName().compare(0, 6, "ttyUSB") == 0 ||
74+
devices[i].getDeviceName().compare(0, 7, "Arduino") == 0)
75+
{
76+
out.add (devices[i].getDevicePath());
77+
}
78+
#endif
6979

7080
}
7181

@@ -105,7 +115,12 @@ void ArduinoOutput::setDevice (String devName, bool initializing)
105115
LOGC ("Sending firmware version request...");
106116
arduino.sendFirmwareVersionRequest();
107117

118+
#ifdef WIN32
119+
// Windows seems to work faster, but Linux needs more time
108120
timer.waitForMillisecondCounter (currentTime + 500);
121+
#else
122+
timer.waitForMillisecondCounter (currentTime + 3000);
123+
#endif
109124

110125
LOGC ("Updating...");
111126
arduino.update();

0 commit comments

Comments
 (0)