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

Diff for: app/src/processing/app/Base.java

+1
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);

Diff for: app/src/processing/app/Editor.java

+7
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 {

Diff for: arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java

+21-8
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() {

Diff for: arduino-core/src/processing/app/BaseNoGui.java

+2-2
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

Diff for: arduino-core/src/processing/app/debug/Compiler.java

+12-7
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;

Diff for: arduino-core/src/processing/app/helpers/NetUtils.java

+28-1
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;

Diff for: build/build.xml

+1-1
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>

Diff for: build/shared/revisions.txt

+10
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]

Diff for: hardware/arduino/avr/platform.txt

+3-5
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"

Diff for: hardware/arduino/sam/platform.txt

+3-6
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"

Diff for: libraries/Bridge/examples/Bridge/Bridge.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include <YunServer.h>
2727
#include <YunClient.h>
2828

29-
// Listen on default port 5555, the webserver on the Yún
30-
// will forward there all the HTTP requests for us.
29+
// Listen to the default port 5555, the Yún webserver
30+
// will forward there all the HTTP requests you send
3131
YunServer server;
3232

3333
void setup() {

Diff for: libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'~' followed by '1' -> Set the UART speed to 115200 baud
1616
'~' followed by '2' -> Set the UART speed to 250000 baud
1717
'~' followed by '3' -> Set the UART speed to 500000 baud
18-
'~' followeb by '~' -> Sends the bridge's shutdown command to
18+
'~' followed by '~' -> Sends the bridge's shutdown command to
1919
obtain the console.
2020
2121
The circuit:

Diff for: libraries/Bridge/src/YunClient.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int YunClient::connect(const char *host, uint16_t port) {
160160
if (connected())
161161
return 1;
162162

163-
opened = false;
163+
stop();
164164
handle = 0;
165165
return 0;
166166
}

Diff for: libraries/Ethernet/src/EthernetClient.h

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class EthernetClient : public Client {
2424
virtual void stop();
2525
virtual uint8_t connected();
2626
virtual operator bool();
27+
virtual bool operator==(const bool value) { return bool() == value; }
28+
virtual bool operator!=(const bool value) { return bool() != value; }
2729
virtual bool operator==(const EthernetClient&);
2830
virtual bool operator!=(const EthernetClient& rhs) { return !this->operator==(rhs); };
2931

Diff for: libraries/LiquidCrystal/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=LiquidCrystal
22
version=1.0
3-
author=
3+
author=Arduino, Adafruit
44
maintainer=Arduino <[email protected]>
55
sentence=Allows communication with alphanumerical liquid crystal displays (LCDs). For all Arduino boards.
66
paragraph=This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. The library works with in either 4 or 8 bit mode (i.e. using 4 or 8 data lines in addition to the rs, enable, and, optionally, the rw control lines).

Diff for: libraries/SD/library.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name=SD
22
version=1.0
3-
author=
4-
maintainer=
3+
author=Arduino, SparkFun
4+
maintainer=Arduino <[email protected]>
55
sentence=Enables reading and writing on SD cards. For all Arduino boards.
66
paragraph=Once an SD memory card is connected to the SPI interfare of the Arduino board you are enabled to create files and read/write on them. You can also move through directories on the SD card.
77
category=Data Storage

Diff for: libraries/Stepper/library.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name=Stepper
22
version=1.0
3-
author=
4-
maintainer=
3+
author=Arduino
4+
maintainer=Arduino <[email protected]>
55
sentence=Allows Arduino boards to control a variety of stepper motors. For all Arduino boards.
66
paragraph=This library allows you to control unipolar or bipolar stepper motors. To use it you will need a stepper motor, and the appropriate hardware to control it.
77
category=Device Control

Diff for: libraries/TFT/library.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name=TFT
22
version=1.0
3-
author=
4-
maintainer=
3+
author=Arduino, Adafruit
4+
maintainer=Arduino <[email protected]>
55
sentence=Allows drawing text, images, and shapes on the Arduino TFT graphical display. For all Arduino boards.
66
paragraph=This library is compatible with most of the TFT display based on the ST7735 chipset
77
category=Display

0 commit comments

Comments
 (0)