1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Don't report memory usage if it's unknown

This commit is contained in:
Loren M. Lang
2013-04-22 18:13:31 -07:00
parent 7c87db3532
commit c35e57ab4e

View File

@ -1631,14 +1631,16 @@ public class Sketch {
System.out.println(I18n System.out.println(I18n
.format(_("Binary sketch size: {0} bytes (of a {1} byte maximum) - {2}% used"), .format(_("Binary sketch size: {0} bytes (of a {1} byte maximum) - {2}% used"),
textSize, maxTextSize, textSize * 100 / maxTextSize)); textSize, maxTextSize, textSize * 100 / maxTextSize));
if(maxDataSize > 0) { if(dataSize >= 0) {
System.out.println(I18n if(maxDataSize > 0) {
.format(_("Memory usage: {0} bytes (of a {1} byte maximum) - {2}% used"), System.out.println(I18n
dataSize, maxDataSize, dataSize * 100 / maxDataSize)); .format(_("Memory usage: {0} bytes (of a {1} byte maximum) - {2}% used"),
} else { dataSize, maxDataSize, dataSize * 100 / maxDataSize));
System.out.println(I18n } else {
.format(_("Memory usage: {0} bytes"), System.out.println(I18n
dataSize)); .format(_("Memory usage: {0} bytes"),
dataSize));
}
} }
} catch (RunnerException e) { } catch (RunnerException e) {
System.err.println(I18n.format(_("Couldn't determine program size: {0}"), System.err.println(I18n.format(_("Couldn't determine program size: {0}"),