Skip to content

Commit eeeab6f

Browse files
committed
Merge pull request #1 from arduino/master
Update to latest commit from upstream
2 parents cf3e948 + b1b83c0 commit eeeab6f

File tree

18 files changed

+101
-41
lines changed

18 files changed

+101
-41
lines changed

app/src/processing/app/Base.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,7 @@ public void actionPerformed(ActionEvent actionevent) {
11871187
Action subAction = new AbstractAction(_(boardCustomMenu.get(customMenuOption))) {
11881188
public void actionPerformed(ActionEvent e) {
11891189
Preferences.set("custom_" + menuId, ((TargetBoard)getValue("board")).getId() + "_" + getValue("custom_menu_option"));
1190+
onBoardOrPortChange();
11901191
}
11911192
};
11921193
subAction.putValue("board", board);

app/src/processing/app/Editor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import com.jcraft.jsch.JSchException;
2828

29+
import jssc.SerialPortException;
2930
import processing.app.debug.*;
3031
import processing.app.forms.PasswordAuthorizationDialog;
3132
import processing.app.helpers.OSUtils;
@@ -2572,6 +2573,12 @@ public void handleSerial() {
25722573
statusError(_("Unable to connect: is the sketch using the bridge?"));
25732574
} catch (JSchException e) {
25742575
statusError(_("Unable to connect: wrong password?"));
2576+
} catch (SerialException e) {
2577+
String errorMessage = e.getMessage();
2578+
if (e.getCause() != null && e.getCause() instanceof SerialPortException) {
2579+
errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")";
2580+
}
2581+
statusError(errorMessage);
25752582
} catch (Exception e) {
25762583
statusError(e);
25772584
} finally {

arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,32 @@ public NetworkDiscovery() {
5858

5959
@Override
6060
public List<BoardPort> discovery() {
61-
List<BoardPort> ports = clonePortsList();
62-
Iterator<BoardPort> iterator = ports.iterator();
63-
while (iterator.hasNext()) {
61+
List<BoardPort> boardPorts = clonePortsList();
62+
Iterator<BoardPort> boardPortIterator = boardPorts.iterator();
63+
while (boardPortIterator.hasNext()) {
6464
try {
65-
BoardPort board = iterator.next();
66-
if (!NetUtils.isReachable(InetAddress.getByName(board.getAddress()), Integer.parseInt(board.getPrefs().get("port")))) {
67-
iterator.remove();
65+
BoardPort board = boardPortIterator.next();
66+
67+
InetAddress inetAddress = InetAddress.getByName(board.getAddress());
68+
int broadcastedPort = Integer.valueOf(board.getPrefs().get("port"));
69+
70+
List<Integer> ports = new LinkedList<Integer>();
71+
ports.add(broadcastedPort);
72+
73+
//dirty code: allows non up to date yuns to be discovered. Newer yuns will broadcast port 22
74+
if (broadcastedPort == 80) {
75+
ports.add(0, 22);
76+
}
77+
78+
boolean reachable = NetUtils.isReachable(inetAddress, ports);
79+
if (!reachable) {
80+
boardPortIterator.remove();
6881
}
6982
} catch (UnknownHostException e) {
70-
iterator.remove();
83+
boardPortIterator.remove();
7184
}
7285
}
73-
return ports;
86+
return boardPorts;
7487
}
7588

7689
private List<BoardPort> clonePortsList() {

arduino-core/src/processing/app/BaseNoGui.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
public class BaseNoGui {
3838

3939
/** Version string to be used for build */
40-
public static final int REVISION = 10600;
40+
public static final int REVISION = 10601;
4141
/** Extended version string displayed on GUI */
42-
static String VERSION_NAME = "1.6.0";
42+
static String VERSION_NAME = "1.6.1";
4343

4444
static File buildFolder;
4545

arduino-core/src/processing/app/debug/Compiler.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.io.PrintWriter;
3535
import java.util.ArrayList;
3636
import java.util.Arrays;
37+
import java.util.Collections;
3738
import java.util.LinkedList;
3839
import java.util.List;
3940
import java.util.Map;
@@ -399,13 +400,17 @@ public boolean compile(boolean _verbose) throws RunnerException, PreferencesMapE
399400
progressListener.progress(60);
400401
compileLink();
401402

402-
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
403-
progressListener.progress(70);
404-
runRecipe("recipe.objcopy.eep.pattern");
405-
406-
// 6. build the .hex file
407-
progressListener.progress(80);
408-
runRecipe("recipe.objcopy.output.pattern");
403+
// 5. run objcopy to generate output files
404+
progressListener.progress(75);
405+
List<String> objcopyPatterns = new ArrayList<String>();
406+
for (String key : prefs.keySet()) {
407+
if (key.startsWith("recipe.objcopy.") && key.endsWith(".pattern"))
408+
objcopyPatterns.add(key);
409+
}
410+
Collections.sort(objcopyPatterns);
411+
for (String recipe : objcopyPatterns) {
412+
runRecipe(recipe);
413+
}
409414

410415
progressListener.progress(90);
411416
return true;

arduino-core/src/processing/app/helpers/NetUtils.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,41 @@
44
import java.net.InetAddress;
55
import java.net.InetSocketAddress;
66
import java.net.Socket;
7+
import java.util.Arrays;
8+
import java.util.List;
79

810
public abstract class NetUtils {
911

12+
private static boolean isReachableByEcho(InetAddress address) {
13+
try {
14+
return address.isReachable(100);
15+
} catch (IOException e) {
16+
return false;
17+
}
18+
}
19+
1020
public static boolean isReachable(InetAddress address, int port) {
21+
return isReachable(address, Arrays.asList(port));
22+
}
23+
24+
public static boolean isReachable(InetAddress address, List<Integer> ports) {
25+
if (isReachableByEcho(address)) {
26+
return true;
27+
}
28+
29+
boolean reachable = false;
30+
for (Integer port : ports) {
31+
reachable = reachable || isPortOpen(address, port);
32+
}
33+
34+
return reachable;
35+
}
36+
37+
private static boolean isPortOpen(InetAddress address, int port) {
1138
Socket socket = null;
1239
try {
1340
socket = new Socket();
14-
socket.connect(new InetSocketAddress(address, port), 100);
41+
socket.connect(new InetSocketAddress(address, port), 300);
1542
return true;
1643
} catch (IOException e) {
1744
return false;

build/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<!--echo message="os.version = ${os.version}" /-->
66

77
<!-- Sets properties for macosx/windows/linux depending on current system -->
8-
<condition property="platform" value="macosx-java-latest"><os family="mac" /></condition>
98
<condition property="platform" value="macosx">
109
<and>
1110
<os family="mac" />
1211
<matches string="${os.version}" pattern="^10.[56]." />
1312
</and>
1413
</condition>
14+
<condition property="platform" value="macosx-java-latest"><os family="mac" /></condition>
1515
<condition property="platform" value="windows"><os family="windows" /></condition>
1616
<condition property="platform" value="linux32"><os family="unix" arch="i386" /></condition>
1717
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>

build/shared/revisions.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11

2+
ARDUINO 1.6.1
3+
4+
[ide]
5+
* Improved Yun detection for upload via network (Ron Guest)
6+
* In platforms.txt "objcopy" recipe is no more tied to the "hex" format (Arnav Gupta)
7+
* /dev/cu.* serial ports are now filtered from the port list on MacOSX
8+
* Ports in ports list are now grouped by type
9+
* Upgraded avr-gcc toolchains to 3.4.5
10+
* Fixed wrong parsing of boards.txt when using submenu and boards id with underscores
11+
212
ARDUINO 1.6.0 - 2015.02.09
313

414
[ide]

hardware/arduino/avr/platform.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
77

88
name=Arduino AVR Boards
9-
version=1.6.0
9+
version=1.6.1
1010

1111
# AVR compile variables
1212
# ---------------------
@@ -61,11 +61,9 @@ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compil
6161
## Combine gc-sections, archives, and objects
6262
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
6363

64-
## Create eeprom
64+
## Create output files (.eep and .hex)
6565
recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
66-
67-
## Create hex
68-
recipe.objcopy.output.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
66+
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
6967

7068
## Compute size
7169
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"

hardware/arduino/sam/platform.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
66

77
name=Arduino ARM (32-bits) Boards
8-
version=1.6.0
8+
version=1.6.1
99

1010
# SAM3 compile variables
1111
# ----------------------
@@ -65,11 +65,8 @@ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compil
6565
## Combine gc-sections, archives, and objects
6666
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
6767

68-
## Create eeprom
69-
recipe.objcopy.eep.pattern=
70-
71-
## Create hex
72-
recipe.objcopy.output.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
68+
## Create output (.bin file)
69+
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
7370

7471
## Compute size
7572
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"

0 commit comments

Comments
 (0)