Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/arduino/Arduino.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartino Facchin <m.facchin@arduino.cc>2016-11-28 17:09:46 +0300
committerMartino Facchin <m.facchin@arduino.cc>2016-11-28 17:09:46 +0300
commit1a97ec448182c57bc8fc0278075f429f3877b2a2 (patch)
tree4dc3bb1bc6d92db225c1f22ddfe468e455948ae1
parentdf0009601ef8747a307241fb4c3f1b94d9f96127 (diff)
Remove sketch size calculation from Java IDEide-1.5.x
It is now performed by arduino-builder (>= 1.3.22)
-rw-r--r--arduino-core/src/cc/arduino/Compiler.java52
1 files changed, 0 insertions, 52 deletions
diff --git a/arduino-core/src/cc/arduino/Compiler.java b/arduino-core/src/cc/arduino/Compiler.java
index 2f4a62fbe..f2af0f739 100644
--- a/arduino-core/src/cc/arduino/Compiler.java
+++ b/arduino-core/src/cc/arduino/Compiler.java
@@ -156,8 +156,6 @@ public class Compiler implements MessageConsumer {
runActions("hooks.savehex.postsavehex", prefs);
}
- size(prefs);
-
return sketch.getPrimaryFile().getFileName();
}
@@ -296,56 +294,6 @@ public class Compiler implements MessageConsumer {
}
}
- private void size(PreferencesMap prefs) throws RunnerException {
- String maxTextSizeString = prefs.get("upload.maximum_size");
- String maxDataSizeString = prefs.get("upload.maximum_data_size");
-
- if (maxTextSizeString == null) {
- return;
- }
-
- long maxTextSize = Integer.parseInt(maxTextSizeString);
- long maxDataSize = -1;
-
- if (maxDataSizeString != null) {
- maxDataSize = Integer.parseInt(maxDataSizeString);
- }
-
- Sizer sizer = new Sizer(prefs);
- long[] sizes;
- try {
- sizes = sizer.computeSize();
- } catch (RunnerException e) {
- System.err.println(I18n.format(tr("Couldn't determine program size: {0}"), e.getMessage()));
- return;
- }
-
- long textSize = sizes[0];
- long dataSize = sizes[1];
- System.out.println();
- System.out.println(I18n.format(tr("Sketch uses {0} bytes ({2}%%) of program storage space. Maximum is {1} bytes."), textSize, maxTextSize, textSize * 100 / maxTextSize));
- if (dataSize >= 0) {
- if (maxDataSize > 0) {
- 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));
- } else {
- System.out.println(I18n.format(tr("Global variables use {0} bytes of dynamic memory."), dataSize));
- }
- }
-
- if (textSize > maxTextSize) {
- throw new RunnerException(tr("Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it."));
- }
-
- if (maxDataSize > 0 && dataSize > maxDataSize) {
- throw new RunnerException(tr("Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint."));
- }
-
- int warnDataPercentage = Integer.parseInt(prefs.get("build.warn_data_percentage"));
- if (maxDataSize > 0 && dataSize > maxDataSize * warnDataPercentage / 100) {
- System.err.println(tr("Low memory available, stability problems may occur."));
- }
- }
-
private void saveHex(PreferencesMap prefs) throws RunnerException {
List<String> compiledSketches = new ArrayList<>(prefs.subTree("recipe.output.tmp_file", 1).values());
List<String> copyOfCompiledSketches = new ArrayList<>(prefs.subTree("recipe.output.save_file", 1).values());