Skip to content

Commit 11e8091

Browse files
committed
Merge remote-tracking branch 'upstream/master' into buildfix
2 parents 58b8b3f + d115f44 commit 11e8091

File tree

82 files changed

+3164
-569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3164
-569
lines changed

app/src/processing/app/Base.java

+2
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,8 @@ public void actionPerformed(ActionEvent actionevent) {
14441444

14451445
// Cycle through all boards of this platform
14461446
for (TargetBoard board : targetPlatform.getBoards().values()) {
1447+
if (board.getPreferences().get("hide") != null)
1448+
continue;
14471449
JMenuItem item = createBoardMenusAndCustomMenus(boardsCustomMenus, menuItemsToClickAfterStartup,
14481450
buttonGroupsMap,
14491451
board, targetPlatform, targetPackage);

app/src/processing/app/Editor.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1306,15 +1306,15 @@ public void actionPerformed(ActionEvent e) {
13061306
JMenuItem copyForumItem = newJMenuItemShift(tr("Copy for Forum"), 'C');
13071307
copyForumItem.addActionListener(new ActionListener() {
13081308
public void actionPerformed(ActionEvent e) {
1309-
getCurrentTab().handleHTMLCopy();
1309+
getCurrentTab().handleDiscourseCopy();
13101310
}
13111311
});
13121312
menu.add(copyForumItem);
13131313

13141314
JMenuItem copyHTMLItem = newJMenuItemAlt(tr("Copy as HTML"), 'C');
13151315
copyHTMLItem.addActionListener(new ActionListener() {
13161316
public void actionPerformed(ActionEvent e) {
1317-
getCurrentTab().handleDiscourseCopy();
1317+
getCurrentTab().handleHTMLCopy();
13181318
}
13191319
});
13201320
menu.add(copyHTMLItem);
@@ -2106,6 +2106,7 @@ public boolean handleSaveAs() {
21062106

21072107
// Update editor window title in case of "Save as..."
21082108
updateTitle();
2109+
header.rebuild();
21092110
}
21102111

21112112
return true;

arduino-core/src/cc/arduino/Compiler.java

-52
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ public String build(CompilerProgressListener progListener, boolean exportHex) th
156156
runActions("hooks.savehex.postsavehex", prefs);
157157
}
158158

159-
size(prefs);
160-
161159
return sketch.getPrimaryFile().getFileName();
162160
}
163161

@@ -296,56 +294,6 @@ private void callArduinoBuilder(TargetBoard board, TargetPlatform platform, Targ
296294
}
297295
}
298296

299-
private void size(PreferencesMap prefs) throws RunnerException {
300-
String maxTextSizeString = prefs.get("upload.maximum_size");
301-
String maxDataSizeString = prefs.get("upload.maximum_data_size");
302-
303-
if (maxTextSizeString == null) {
304-
return;
305-
}
306-
307-
long maxTextSize = Integer.parseInt(maxTextSizeString);
308-
long maxDataSize = -1;
309-
310-
if (maxDataSizeString != null) {
311-
maxDataSize = Integer.parseInt(maxDataSizeString);
312-
}
313-
314-
Sizer sizer = new Sizer(prefs);
315-
long[] sizes;
316-
try {
317-
sizes = sizer.computeSize();
318-
} catch (RunnerException e) {
319-
System.err.println(I18n.format(tr("Couldn't determine program size: {0}"), e.getMessage()));
320-
return;
321-
}
322-
323-
long textSize = sizes[0];
324-
long dataSize = sizes[1];
325-
System.out.println();
326-
System.out.println(I18n.format(tr("Sketch uses {0} bytes ({2}%%) of program storage space. Maximum is {1} bytes."), textSize, maxTextSize, textSize * 100 / maxTextSize));
327-
if (dataSize >= 0) {
328-
if (maxDataSize > 0) {
329-
System.out.println(I18n.format(tr("Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes."), dataSize, maxDataSize, dataSize * 100 / maxDataSize, maxDataSize - dataSize));
330-
} else {
331-
System.out.println(I18n.format(tr("Global variables use {0} bytes of dynamic memory."), dataSize));
332-
}
333-
}
334-
335-
if (textSize > maxTextSize) {
336-
throw new RunnerException(tr("Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it."));
337-
}
338-
339-
if (maxDataSize > 0 && dataSize > maxDataSize) {
340-
throw new RunnerException(tr("Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint."));
341-
}
342-
343-
int warnDataPercentage = Integer.parseInt(prefs.get("build.warn_data_percentage"));
344-
if (maxDataSize > 0 && dataSize > maxDataSize * warnDataPercentage / 100) {
345-
System.err.println(tr("Low memory available, stability problems may occur."));
346-
}
347-
}
348-
349297
private void saveHex(PreferencesMap prefs) throws RunnerException {
350298
List<String> compiledSketches = new ArrayList<>(prefs.subTree("recipe.output.tmp_file", 1).values());
351299
List<String> copyOfCompiledSketches = new ArrayList<>(prefs.subTree("recipe.output.save_file", 1).values());

arduino-core/src/cc/arduino/packages/Uploader.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ protected boolean executeUploadCommand(String command[]) throws Exception {
132132
new MessageSiphon(process.getErrorStream(), this, 100);
133133

134134
// wait for the process to finish, but not forever
135-
// kill the flasher process after 2 minutes to avoid 100% cpu spinning
136-
if (!process.waitFor(2, TimeUnit.MINUTES)) {
135+
// kill the flasher process after 5 minutes to avoid 100% cpu spinning
136+
if (!process.waitFor(5, TimeUnit.MINUTES)) {
137137
process.destroyForcibly();
138138
}
139139
if (!process.isAlive()) {

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

+14-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
public class BaseNoGui {
3939

4040
/** Version string to be used for build */
41-
public static final int REVISION = 10614;
41+
public static final int REVISION = 10800;
4242
/** Extended version string displayed on GUI */
43-
public static final String VERSION_NAME = "1.6.14";
43+
public static final String VERSION_NAME = "1.8.0";
4444
public static final String VERSION_NAME_LONG;
4545

4646
// Current directory to use for relative paths specified on the
@@ -884,11 +884,22 @@ static public String sanitizeName(String origName) {
884884
}
885885

886886
/**
887-
* Spew the contents of a String object out to a file.
887+
* Save the content of a String into a file
888+
* - Save the content into a temp file
889+
* - Find the canonical path of the file (if it's a symlink, follow it)
890+
* - Remove the original file
891+
* - Move temp file to original path
892+
* This ensures that the file is not getting truncated if the disk is full
888893
*/
889894
static public void saveFile(String str, File file) throws IOException {
890895
File temp = File.createTempFile(file.getName(), null, file.getParentFile());
891896
PApplet.saveStrings(temp, new String[] { str });
897+
898+
try {
899+
file = file.getCanonicalFile();
900+
} catch (IOException e) {
901+
}
902+
892903
if (file.exists()) {
893904
boolean result = file.delete();
894905
if (!result) {

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

+16-1
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,29 @@ public synchronized Map<String, Object> resolveDeviceByVendorIdProductId(String
236236
List<String> vids = new LinkedList<>(board.getPreferences().subTree("vid", 1).values());
237237
if (!vids.isEmpty()) {
238238
List<String> pids = new LinkedList<>(board.getPreferences().subTree("pid", 1).values());
239+
List<String> descriptors = new LinkedList<>(board.getPreferences().subTree("descriptor", 1).values());
239240
for (int i = 0; i < vids.size(); i++) {
240241
String vidPid = vids.get(i) + "_" + pids.get(i);
241242
if (vid_pid_iSerial.toUpperCase().contains(vidPid.toUpperCase())) {
243+
if (!descriptors.isEmpty()) {
244+
boolean matched = false;
245+
for (int j = 0; j < descriptors.size(); j++) {
246+
if (vid_pid_iSerial.toUpperCase().contains(descriptors.get(j).toUpperCase())) {
247+
matched = true;
248+
break;
249+
}
250+
}
251+
if (matched == false) {
252+
continue;
253+
}
254+
}
242255
Map<String, Object> boardData = new HashMap<>();
243256
boardData.put("board", board);
244257
boardData.put("vid", vids.get(i));
245258
boardData.put("pid", pids.get(i));
246-
boardData.put("iserial", vid_pid_iSerial.substring(vidPid.length()+1));
259+
String extrafields = vid_pid_iSerial.substring(vidPid.length()+1);
260+
String[] parts = extrafields.split("_");
261+
boardData.put("iserial", parts[0]);
247262
return boardData;
248263
}
249264
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -298,5 +298,6 @@ public void saveAs(File newFile) throws IOException {
298298

299299
BaseNoGui.saveFile(storage.getText(), newFile);
300300
renamedTo(newFile);
301+
storage.clearModified();
301302
}
302303
}

0 commit comments

Comments
 (0)