Skip to content

Commit eff4918

Browse files
author
Federico Fissore
committed
Manual merge
2 parents 9555bcf + 70df7ff commit eff4918

File tree

7 files changed

+29
-26
lines changed

7 files changed

+29
-26
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@ test-bin
3535
.DS_Store
3636
hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/passwords.h
3737
avr-toolchain-*.zip
38-

app/src/cc/arduino/packages/uploaders/SerialUploader.java

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
125125
throw new RunnerException(e);
126126
}
127127

128-
// Remove the magic baud rate (1200bps) to avoid
129-
// future unwanted board resets
130128
try {
131129
if (uploadResult && doTouch) {
132130
String uploadPort = Preferences.get("serial.port");
@@ -136,25 +134,13 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
136134
// sketch port never comes back). Doing this saves users from accidentally
137135
// opening Serial Monitor on the soon-to-be-orphaned bootloader port.
138136
Thread.sleep(1000);
139-
long timeout = System.currentTimeMillis() + 2000;
140-
while (timeout > System.currentTimeMillis()) {
137+
long started = System.currentTimeMillis();
138+
while (System.currentTimeMillis() - started < 2000) {
141139
List<String> portList = Serial.list();
142-
if (portList.contains(uploadPort)) {
143-
try {
144-
Serial.touchPort(uploadPort, 9600);
145-
break;
146-
} catch (SerialException e) {
147-
// Port already in use
148-
}
149-
}
140+
if (portList.contains(uploadPort))
141+
break;
150142
Thread.sleep(250);
151143
}
152-
} else {
153-
try {
154-
Serial.touchPort(uploadPort, 9600);
155-
} catch (SerialException e) {
156-
throw new RunnerException(e);
157-
}
158144
}
159145
}
160146
} catch (InterruptedException ex) {

app/src/processing/app/Sketch.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,9 +2066,10 @@ static public String sanitizeName(String origName) {
20662066
for (int i = 0; i < c.length; i++) {
20672067
if (((c[i] >= '0') && (c[i] <= '9')) ||
20682068
((c[i] >= 'a') && (c[i] <= 'z')) ||
2069-
((c[i] >= 'A') && (c[i] <= 'Z'))) {
2069+
((c[i] >= 'A') && (c[i] <= 'Z')) ||
2070+
((i > 0) && (c[i] == '-')) ||
2071+
((i > 0) && (c[i] == '.'))) {
20702072
buffer.append(c[i]);
2071-
20722073
} else {
20732074
buffer.append('_');
20742075
}

app/src/processing/app/SketchCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public SketchCode(File file, String extension) {
8787

8888
protected void makePrettyName() {
8989
prettyName = file.getName();
90-
int dot = prettyName.indexOf('.');
90+
int dot = prettyName.lastIndexOf('.');
9191
prettyName = prettyName.substring(0, dot);
9292
}
9393

app/src/processing/app/packages/Library.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private static Library createLibrary(File libFolder) throws IOException {
6565

6666
// Compatibility with 1.5 rev.1 libraries:
6767
// "email" field changed to "maintainer"
68-
if (!properties.containsKey("maintainer"))
68+
if (!properties.containsKey("maintainer") &&
69+
properties.containsKey("email"))
6970
properties.put("maintainer", properties.get("email"));
7071

7172
// Compatibility with 1.5 rev.1 libraries:
@@ -121,8 +122,11 @@ private static Library createLibrary(File libFolder) throws IOException {
121122
String category = properties.get("category");
122123
if (category == null)
123124
category = "Uncategorized";
124-
if (!CATEGORIES.contains(category))
125+
if (!CATEGORIES.contains(category)) {
125126
category = "Uncategorized";
127+
System.out.println("WARNING: Category '" + category + "' in library " +
128+
properties.get("name") + " is not valid. Setting to 'Uncategorized'");
129+
}
126130

127131
String license = properties.get("license");
128132
if (license == null)

build/build.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
<equals arg1="${platform}" arg2="linux64"/>
3838
</condition>
3939

40+
<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition>
41+
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/>
42+
4043
<!-- Libraries required for running arduino -->
4144
<fileset dir=".." id="runtime.jars">
4245
<include name="core/core.jar" />

libraries/Esplora/examples/Beginners/EsploraJoystickMouse/EsploraJoystickMouse.ino

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
1818
Created on 22 Dec 2012
1919
by Tom Igoe
20+
Updated 8 March 2014
21+
by Scott Fitzgerald
22+
23+
http://arduino.cc/en/Reference/EsploraReadJoystickSwitch
2024
2125
This example is in the public domain.
2226
*/
@@ -41,10 +45,16 @@ void loop()
4145
Serial.print("\tButton: "); // print a tab character and a label for the button
4246
Serial.print(button); // print the button value
4347

44-
int mouseX = map( xValue, -512, 512, 10, -10); // map the X value to a range of movement for the mouse X
45-
int mouseY = map( yValue, -512, 512, -10, 10); // map the Y value to a range of movement for the mouse Y
48+
int mouseX = map(xValue, -512, 512, 10, -10); // map the X value to a range of movement for the mouse X
49+
int mouseY = map(yValue, -512, 512, -10, 10); // map the Y value to a range of movement for the mouse Y
4650
Mouse.move(mouseX, mouseY, 0); // move the mouse
4751

52+
if (button == 0) { // if the joystick button is pressed
53+
Mouse.press(); // send a mouse click
54+
} else {
55+
Mouse.release(); // if it's not pressed, release the mouse button
56+
}
57+
4858
delay(10); // a short delay before moving again
4959
}
5060

0 commit comments

Comments
 (0)