Quick hack to allow bigger code on the atmega168 (if build.mcu == atmega168, the upload.maximum_size gets doubled).

This commit is contained in:
David A. Mellis 2006-08-30 11:47:34 +00:00
parent 70b2be7831
commit 7fe87fe724
1 changed files with 5 additions and 2 deletions

View File

@ -1652,16 +1652,19 @@ public class Sketch {
protected void size(String buildPath, String suggestedClassName)
throws RunnerException {
long size = 0;
long maxsize = Preferences.getInteger("upload.maximum_size");
if (Preferences.get("build.mcu").equals("atmega168"))
maxsize *= 2;
Sizer sizer = new Sizer(buildPath, suggestedClassName);
try {
size = sizer.computeSize();
System.out.println("Binary sketch size: " + size + " bytes (of a " +
Preferences.get("upload.maximum_size") + " byte maximum)");
maxsize + " byte maximum)");
} catch (RunnerException e) {
System.err.println("Couldn't determine program size: " + e.getMessage());
}
if (size > Preferences.getInteger("upload.maximum_size"))
if (size > maxsize)
throw new RunnerException(
"Sketch too big; try deleting code, removing floats, or see " +
"http://www.arduino.cc/en/Main/FAQ for more advice.");