Skip to content

Commit

Permalink
Merge pull request arduino#1 from arduino/master
Browse files Browse the repository at this point in the history
Update to latest commit from upstream
  • Loading branch information
Vishan07 committed Feb 27, 2015
2 parents cf3e948 + b1b83c0 commit eeeab6f
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 41 deletions.
1 change: 1 addition & 0 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,7 @@ public void actionPerformed(ActionEvent actionevent) {
Action subAction = new AbstractAction(_(boardCustomMenu.get(customMenuOption))) {
public void actionPerformed(ActionEvent e) {
Preferences.set("custom_" + menuId, ((TargetBoard)getValue("board")).getId() + "_" + getValue("custom_menu_option"));
onBoardOrPortChange();
}
};
subAction.putValue("board", board);
Expand Down
7 changes: 7 additions & 0 deletions app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import com.jcraft.jsch.JSchException;

import jssc.SerialPortException;
import processing.app.debug.*;
import processing.app.forms.PasswordAuthorizationDialog;
import processing.app.helpers.OSUtils;
Expand Down Expand Up @@ -2572,6 +2573,12 @@ public void handleSerial() {
statusError(_("Unable to connect: is the sketch using the bridge?"));
} catch (JSchException e) {
statusError(_("Unable to connect: wrong password?"));
} catch (SerialException e) {
String errorMessage = e.getMessage();
if (e.getCause() != null && e.getCause() instanceof SerialPortException) {
errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")";
}
statusError(errorMessage);
} catch (Exception e) {
statusError(e);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,32 @@ public NetworkDiscovery() {

@Override
public List<BoardPort> discovery() {
List<BoardPort> ports = clonePortsList();
Iterator<BoardPort> iterator = ports.iterator();
while (iterator.hasNext()) {
List<BoardPort> boardPorts = clonePortsList();
Iterator<BoardPort> boardPortIterator = boardPorts.iterator();
while (boardPortIterator.hasNext()) {
try {
BoardPort board = iterator.next();
if (!NetUtils.isReachable(InetAddress.getByName(board.getAddress()), Integer.parseInt(board.getPrefs().get("port")))) {
iterator.remove();
BoardPort board = boardPortIterator.next();

InetAddress inetAddress = InetAddress.getByName(board.getAddress());
int broadcastedPort = Integer.valueOf(board.getPrefs().get("port"));

List<Integer> ports = new LinkedList<Integer>();
ports.add(broadcastedPort);

//dirty code: allows non up to date yuns to be discovered. Newer yuns will broadcast port 22
if (broadcastedPort == 80) {
ports.add(0, 22);
}

boolean reachable = NetUtils.isReachable(inetAddress, ports);
if (!reachable) {
boardPortIterator.remove();
}
} catch (UnknownHostException e) {
iterator.remove();
boardPortIterator.remove();
}
}
return ports;
return boardPorts;
}

private List<BoardPort> clonePortsList() {
Expand Down
4 changes: 2 additions & 2 deletions arduino-core/src/processing/app/BaseNoGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
public class BaseNoGui {

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

static File buildFolder;

Expand Down
19 changes: 12 additions & 7 deletions arduino-core/src/processing/app/debug/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -399,13 +400,17 @@ public boolean compile(boolean _verbose) throws RunnerException, PreferencesMapE
progressListener.progress(60);
compileLink();

// 5. extract EEPROM data (from EEMEM directive) to .eep file.
progressListener.progress(70);
runRecipe("recipe.objcopy.eep.pattern");

// 6. build the .hex file
progressListener.progress(80);
runRecipe("recipe.objcopy.output.pattern");
// 5. run objcopy to generate output files
progressListener.progress(75);
List<String> objcopyPatterns = new ArrayList<String>();
for (String key : prefs.keySet()) {
if (key.startsWith("recipe.objcopy.") && key.endsWith(".pattern"))
objcopyPatterns.add(key);
}
Collections.sort(objcopyPatterns);
for (String recipe : objcopyPatterns) {
runRecipe(recipe);
}

progressListener.progress(90);
return true;
Expand Down
29 changes: 28 additions & 1 deletion arduino-core/src/processing/app/helpers/NetUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,41 @@
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.Arrays;
import java.util.List;

public abstract class NetUtils {

private static boolean isReachableByEcho(InetAddress address) {
try {
return address.isReachable(100);
} catch (IOException e) {
return false;
}
}

public static boolean isReachable(InetAddress address, int port) {
return isReachable(address, Arrays.asList(port));
}

public static boolean isReachable(InetAddress address, List<Integer> ports) {
if (isReachableByEcho(address)) {
return true;
}

boolean reachable = false;
for (Integer port : ports) {
reachable = reachable || isPortOpen(address, port);
}

return reachable;
}

private static boolean isPortOpen(InetAddress address, int port) {
Socket socket = null;
try {
socket = new Socket();
socket.connect(new InetSocketAddress(address, port), 100);
socket.connect(new InetSocketAddress(address, port), 300);
return true;
} catch (IOException e) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<!--echo message="os.version = ${os.version}" /-->

<!-- Sets properties for macosx/windows/linux depending on current system -->
<condition property="platform" value="macosx-java-latest"><os family="mac" /></condition>
<condition property="platform" value="macosx">
<and>
<os family="mac" />
<matches string="${os.version}" pattern="^10.[56]." />
</and>
</condition>
<condition property="platform" value="macosx-java-latest"><os family="mac" /></condition>
<condition property="platform" value="windows"><os family="windows" /></condition>
<condition property="platform" value="linux32"><os family="unix" arch="i386" /></condition>
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>
Expand Down
10 changes: 10 additions & 0 deletions build/shared/revisions.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

ARDUINO 1.6.1

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

ARDUINO 1.6.0 - 2015.02.09

[ide]
Expand Down
8 changes: 3 additions & 5 deletions hardware/arduino/avr/platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

name=Arduino AVR Boards
version=1.6.0
version=1.6.1

# AVR compile variables
# ---------------------
Expand Down Expand Up @@ -61,11 +61,9 @@ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compil
## Combine gc-sections, archives, and objects
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

## Create eeprom
## Create output files (.eep and .hex)
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"

## Create hex
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"
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"

## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
Expand Down
9 changes: 3 additions & 6 deletions hardware/arduino/sam/platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

name=Arduino ARM (32-bits) Boards
version=1.6.0
version=1.6.1

# SAM3 compile variables
# ----------------------
Expand Down Expand Up @@ -65,11 +65,8 @@ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compil
## Combine gc-sections, archives, and objects
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

## Create eeprom
recipe.objcopy.eep.pattern=

## Create hex
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"
## Create output (.bin file)
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"

## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
Expand Down
4 changes: 2 additions & 2 deletions libraries/Bridge/examples/Bridge/Bridge.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <YunServer.h>
#include <YunClient.h>

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

void setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'~' followed by '1' -> Set the UART speed to 115200 baud
'~' followed by '2' -> Set the UART speed to 250000 baud
'~' followed by '3' -> Set the UART speed to 500000 baud
'~' followeb by '~' -> Sends the bridge's shutdown command to
'~' followed by '~' -> Sends the bridge's shutdown command to
obtain the console.
The circuit:
Expand Down
2 changes: 1 addition & 1 deletion libraries/Bridge/src/YunClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int YunClient::connect(const char *host, uint16_t port) {
if (connected())
return 1;

opened = false;
stop();
handle = 0;
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions libraries/Ethernet/src/EthernetClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class EthernetClient : public Client {
virtual void stop();
virtual uint8_t connected();
virtual operator bool();
virtual bool operator==(const bool value) { return bool() == value; }
virtual bool operator!=(const bool value) { return bool() != value; }
virtual bool operator==(const EthernetClient&);
virtual bool operator!=(const EthernetClient& rhs) { return !this->operator==(rhs); };

Expand Down
2 changes: 1 addition & 1 deletion libraries/LiquidCrystal/library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=LiquidCrystal
version=1.0
author=
author=Arduino, Adafruit
maintainer=Arduino <[email protected]>
sentence=Allows communication with alphanumerical liquid crystal displays (LCDs). For all Arduino boards.
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).
Expand Down
4 changes: 2 additions & 2 deletions libraries/SD/library.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name=SD
version=1.0
author=
maintainer=
author=Arduino, SparkFun
maintainer=Arduino <[email protected]>
sentence=Enables reading and writing on SD cards. For all Arduino boards.
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.
category=Data Storage
Expand Down
4 changes: 2 additions & 2 deletions libraries/Stepper/library.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name=Stepper
version=1.0
author=
maintainer=
author=Arduino
maintainer=Arduino <[email protected]>
sentence=Allows Arduino boards to control a variety of stepper motors. For all Arduino boards.
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.
category=Device Control
Expand Down
4 changes: 2 additions & 2 deletions libraries/TFT/library.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name=TFT
version=1.0
author=
maintainer=
author=Arduino, Adafruit
maintainer=Arduino <[email protected]>
sentence=Allows drawing text, images, and shapes on the Arduino TFT graphical display. For all Arduino boards.
paragraph=This library is compatible with most of the TFT display based on the ST7735 chipset
category=Display
Expand Down

0 comments on commit eeeab6f

Please sign in to comment.