Skip to content

Commit cb732b1

Browse files
author
Federico Fissore
committed
Merge branch 'ide-1.5.x' into ide-1.5.x-avr-toolchain
2 parents a111f82 + 5cf8671 commit cb732b1

File tree

18 files changed

+537
-428
lines changed

18 files changed

+537
-428
lines changed

app/lib/jssc-2.6.0.jar

-149 KB
Binary file not shown.

app/lib/jssc-2.8.0.jar

150 KB
Binary file not shown.

app/src/processing/app/Base.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static public void main(String args[]) throws Exception {
140140
portableFolder = null;
141141

142142
// run static initialization that grabs all the prefs
143-
Preferences.init(null);
143+
Preferences.init(args);
144144

145145
try {
146146
File versionFile = getContentFile("lib/version.txt");
@@ -343,31 +343,38 @@ public Base(String[] args) throws Exception {
343343
if (args[i].equals("--board")) {
344344
i++;
345345
if (i >= args.length)
346-
showError(null, "Argument required for --board", 3);
346+
showError(null, _("Argument required for --board"), 3);
347347
selectBoard = args[i];
348348
continue;
349349
}
350350
if (args[i].equals("--port")) {
351351
i++;
352352
if (i >= args.length)
353-
showError(null, "Argument required for --port", 3);
353+
showError(null, _("Argument required for --port"), 3);
354354
selectPort = args[i];
355355
continue;
356356
}
357357
if (args[i].equals("--curdir")) {
358358
i++;
359359
if (i >= args.length)
360-
showError(null, "Argument required for --curdir", 3);
360+
showError(null, _("Argument required for --curdir"), 3);
361361
currentDirectory = args[i];
362362
continue;
363363
}
364364
if (args[i].equals("--pref")) {
365365
i++;
366366
if (i >= args.length)
367-
showError(null, "Argument required for --pref", 3);
367+
showError(null, _("Argument required for --pref"), 3);
368368
processPrefArgument(args[i]);
369369
continue;
370370
}
371+
if (args[i].equals("--preferences-file")) {
372+
i++;
373+
if (i >= args.length)
374+
showError(null, _("Argument required for --preferences-file"), 3);
375+
// Argument should be already processed by Preferences.init(...)
376+
continue;
377+
}
371378
if (args[i].startsWith("--"))
372379
showError(null, I18n.format(_("unknown option: {0}"), args[i]), 3);
373380

app/src/processing/app/Preferences.java

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public String toString() {
218218
static File preferencesFile;
219219

220220

221-
static protected void init(String commandLinePrefs) {
221+
static protected void init(String args[]) {
222222

223223
// start by loading the defaults, in case something
224224
// important was deleted from the user prefs
@@ -250,41 +250,31 @@ static protected void init(String commandLinePrefs) {
250250
// clone the hash table
251251
defaults = new Hashtable<String, String>(table);
252252

253-
// Load a prefs file if specified on the command line
254-
if (commandLinePrefs != null) {
255-
try {
256-
load(new FileInputStream(commandLinePrefs));
257-
258-
} catch (Exception poe) {
259-
Base.showError(_("Error"),
260-
I18n.format(
261-
_("Could not read preferences from {0}"),
262-
commandLinePrefs
263-
), poe);
253+
// next load user preferences file
254+
preferencesFile = Base.getSettingsFile(PREFS_FILE);
255+
256+
// load a preferences file if specified on the command line
257+
if (args != null) {
258+
for (int i = 0; i < args.length - 1; i++) {
259+
if (args[i].equals("--preferences-file"))
260+
preferencesFile = new File(args[i + 1]);
264261
}
265-
} else if (!Base.isCommandLine()) {
266-
// next load user preferences file
267-
preferencesFile = Base.getSettingsFile(PREFS_FILE);
268-
if (!preferencesFile.exists()) {
269-
// create a new preferences file if none exists
270-
// saves the defaults out to the file
271-
save();
272-
273-
} else {
274-
// load the previous preferences file
275-
276-
try {
277-
load(new FileInputStream(preferencesFile));
278-
279-
} catch (Exception ex) {
280-
Base.showError(_("Error reading preferences"),
281-
I18n.format(
282-
_("Error reading the preferences file. " +
283-
"Please delete (or move)\n" +
284-
"{0} and restart Arduino."),
285-
preferencesFile.getAbsolutePath()
286-
), ex);
287-
}
262+
}
263+
264+
if (!preferencesFile.exists()) {
265+
// create a new preferences file if none exists
266+
// saves the defaults out to the file
267+
save();
268+
} else {
269+
// load the previous preferences file
270+
try {
271+
load(new FileInputStream(preferencesFile));
272+
} catch (Exception ex) {
273+
Base.showError(_("Error reading preferences"),
274+
I18n.format(_("Error reading the preferences file. "
275+
+ "Please delete (or move)\n"
276+
+ "{0} and restart Arduino."),
277+
preferencesFile.getAbsolutePath()), ex);
288278
}
289279
}
290280

build/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<include name="app/lib/jmdns-3.4.1.jar" />
4747
<include name="app/lib/jna.jar" />
4848
<include name="app/lib/jsch-0.1.50.jar" />
49-
<include name="app/lib/jssc-2.6.0.jar" />
49+
<include name="app/lib/jssc-2.8.0.jar" />
5050
<include name="app/lib/ant.jar" />
5151
<include name="app/lib/ant-launcher.jar" />
5252
</fileset>

build/macosx/template.app/Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<!-- In 0149, removed /System/Library/Java from the CLASSPATH because
7777
it can cause problems if users have installed weird files there.
7878
http://dev.processing.org/bugs/show_bug.cgi?id=1045 -->
79-
<string>$JAVAROOT/pde.jar:$JAVAROOT/core.jar:$JAVAROOT/antlr.jar:$JAVAROOT/ecj.jar:$JAVAROOT/registry.jar:$JAVAROOT/quaqua.jar:$JAVAROOT/jssc-2.6.0.jar:$JAVAROOT/commons-codec-1.7.jar:$JAVAROOT/commons-exec-1.1.jar:$JAVAROOT/commons-httpclient-3.1.jar:$JAVAROOT/commons-logging-1.0.4.jar:$JAVAROOT/jmdns-3.4.1.jar:$JAVAROOT/jsch-0.1.50.jar</string>
79+
<string>$JAVAROOT/pde.jar:$JAVAROOT/core.jar:$JAVAROOT/antlr.jar:$JAVAROOT/ecj.jar:$JAVAROOT/registry.jar:$JAVAROOT/quaqua.jar:$JAVAROOT/jssc-2.8.0.jar:$JAVAROOT/commons-codec-1.7.jar:$JAVAROOT/commons-exec-1.1.jar:$JAVAROOT/commons-httpclient-3.1.jar:$JAVAROOT/commons-logging-1.0.4.jar:$JAVAROOT/jmdns-3.4.1.jar:$JAVAROOT/jsch-0.1.50.jar</string>
8080

8181
<key>JVMArchs</key>
8282
<array>

build/shared/manpage.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ OPTIONS
9292
not given, verbose mode is disabled regardless of the current
9393
preferences.
9494

95+
*--preferences-file* __filename__::
96+
Read and store preferences from the specified __filename__ instead
97+
of the default one.
98+
9599
*--pref* __name__=__value__::
96100
Sets the preference __name__ to the given __value__.
97101

build/shared/revisions.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ ARDUINO 1.5.6 BETA
44
[ide]
55
* Implemented 1.5 library specification Rev.2
66
(https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification)
7+
* Replaced RXTX library with JSSC (Alexey Sokolov)
8+
http://code.google.com/p/java-simple-serial-connector/
79
* Improved command-line parsing (Matthijs Kooijman)
810

911
[libraries]
1012
* TFT: warning messages in PImage class and strings inside examples now stored in flash to save RAM.
1113
* Ethernet: added operator == for EthernetClient class (Norbert Truchsess)
1214

1315
[core]
16+
* avr: Pile of HardwareSerial improvements (Matthijs Kooijman)
17+
- Remove duplicate code from HardwareSerial::begin() methods
18+
- Simplify HardwareSerial::begin() (Rob Tillaart)
19+
- Use constants for register bit positions in HardwareSerial
20+
- Fix HardwareSerial::flush() when interrupts are kept disabled for a while
21+
- Fix lockup when writing to HardwareSerial with interrupts disabled
22+
- Disable the UDRE interrupt sooner in HardwareSerial (Nathan Blackwell)
23+
- Put each HardwareSerial instance in its own .cpp file in order to save memory
24+
for unused UARTS
25+
- In HardwareSerial::write, bypass the queue when it's empty in order to
26+
improve throughput when using high baudrates (KurtE)
1427
* sam: Fixed wrap-around bug in delay() (Mark Tillotson)
1528
* sam: Fixed regression in analogRead() (fails to read multiple channels) (Mark Tillotson)
1629
* sam: Optimized delayMicroseconds() (Rob Tillaart) #1121

hardware/arduino/avr/cores/arduino/Arduino.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ void yield(void);
8888
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
8989
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
9090

91+
// avr-libc defines _NOP() since 1.6.2
92+
#ifndef _NOP
93+
#define _NOP() do { __asm__ volatile ("nop"); } while (0)
94+
#endif
9195

9296
typedef unsigned int word;
9397

@@ -196,6 +200,10 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
196200
#include "WCharacter.h"
197201
#include "WString.h"
198202
#include "HardwareSerial.h"
203+
#include "USBAPI.h"
204+
#if defined(HAVE_HWSERIAL0) && defined(HAVE_CDCSERIAL)
205+
#error "Targets with both UART0 and CDC serial not supported"
206+
#endif
199207

200208
uint16_t makeWord(uint16_t w);
201209
uint16_t makeWord(byte h, byte l);

0 commit comments

Comments
 (0)