From c78c1efe1868d90c9d5632035d2bcb2e65b1913c Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 6 Oct 2007 20:26:45 +0000 Subject: [PATCH] Now have uploading working with the Boards menu. Improved serial port error messages. --- app/AvrdudeUploader.java | 15 ++-- app/Compiler.java | 10 +-- app/Editor.java | 72 +++++++++---------- app/EditorStatus.java | 6 +- app/Library.java | 8 +-- app/LibraryManager.java | 3 +- app/Preferences.java | 65 ++++++++++++++++- app/Serial.java | 31 ++++---- app/SerialException.java | 39 ++++++++++ app/Sketch.java | 15 ++-- app/Uploader.java | 35 +++++---- app/tools/ExportFolder.java | 3 +- .../macosx/Arduino.xcodeproj/project.pbxproj | 5 ++ build/shared/lib/preferences.txt | 41 +---------- hardware/boards.txt | 9 ++- 15 files changed, 218 insertions(+), 139 deletions(-) create mode 100644 app/SerialException.java diff --git a/app/AvrdudeUploader.java b/app/AvrdudeUploader.java index 81831c275..6fdb3e021 100755 --- a/app/AvrdudeUploader.java +++ b/app/AvrdudeUploader.java @@ -44,19 +44,19 @@ public class AvrdudeUploader extends Uploader { // 0x000000); force it to continue uploading anyway commandDownloader.add("-F"); - String programmer = Preferences.get("upload.programmer"); + String protocol = Preferences.get("boards." + Preferences.get("board") + ".upload.protocol"); // avrdude wants "stk500v1" to distinguish it from stk500v2 - if (programmer.equals("stk500")) - programmer = "stk500v1"; - commandDownloader.add("-c" + programmer); - if (Preferences.get("upload.programmer").equals("dapa")) { + if (protocol.equals("stk500")) + protocol = "stk500v1"; + commandDownloader.add("-c" + protocol); + if (protocol.equals("dapa")) { // avrdude doesn't need to be told the address of the parallel port //commandDownloader.add("-dlpt=" + Preferences.get("parallel.port")); } else { commandDownloader.add("-P" + Preferences.get("serial.port")); commandDownloader.add( - "-b" + Preferences.getInteger("serial.download_rate")); + "-b" + Preferences.getInteger("boards." + Preferences.get("board") + ".upload.speed")); } if (Preferences.getBoolean("upload.erase")) commandDownloader.add("-e"); @@ -151,7 +151,8 @@ public class AvrdudeUploader extends Uploader { } // XXX: quick hack to chop the "atmega" off of "atmega8" and "atmega168", // then shove an "m" at the beginning. won't work for attiny's, etc. - commandDownloader.add("-pm" + Preferences.get("build.mcu").substring(6)); + commandDownloader.add("-pm" + + Preferences.get("boards." + Preferences.get("board") + ".build.mcu").substring(6)); commandDownloader.addAll(params); return executeUploadCommand(commandDownloader); diff --git a/app/Compiler.java b/app/Compiler.java index 4733a72d3..5ab96f635 100644 --- a/app/Compiler.java +++ b/app/Compiler.java @@ -104,8 +104,8 @@ public class Compiler implements MessageConsumer { "-Os", // optimize for size "-I" + target.getPath(), "-w", // surpress all warnings - "-mmcu=" + Preferences.get("build.mcu"), - "-DF_CPU=" + Preferences.get("build.f_cpu"), + "-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"), + "-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"), }; // use lib directories as include paths @@ -130,8 +130,8 @@ public class Compiler implements MessageConsumer { "-I" + target.getPath(), "-w", // surpress all warnings "-fno-exceptions", - "-mmcu=" + Preferences.get("build.mcu"), - "-DF_CPU=" + Preferences.get("build.f_cpu"), + "-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"), + "-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"), }; // use lib directories as include paths @@ -145,7 +145,7 @@ public class Compiler implements MessageConsumer { String preCommandLinker[] = new String[] { avrBasePath + "avr-gcc", " ", - "-mmcu=" + Preferences.get("build.mcu"), + "-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"), "-o", " ", }; diff --git a/app/Editor.java b/app/Editor.java index 22b1bcd87..c670d83a8 100644 --- a/app/Editor.java +++ b/app/Editor.java @@ -783,24 +783,19 @@ public class Editor extends JFrame */ menu.addSeparator(); - mcuMenu = new JMenu("Microcontroller (MCU)"); - String curr_mcu = Preferences.get("build.mcu"); - ButtonGroup mcuGroup = new ButtonGroup(); - McuMenuListener mml = new McuMenuListener(); + JMenu boardsMenu = new JMenu("Board"); + ButtonGroup boardGroup = new ButtonGroup(); + for (Iterator i = Preferences.getSubKeys("boards"); i.hasNext(); ) { + String board = (String) i.next(); + Action action = new BoardMenuAction(board); + item = new JRadioButtonMenuItem(action); + if (board.equals(Preferences.get("board"))) + item.setSelected(true); + boardGroup.add(item); + boardsMenu.add(item); + } + menu.add(boardsMenu); - item = new JCheckBoxMenuItem("atmega8", "atmega8".equals(curr_mcu)); - item.addActionListener(mml); - mcuGroup.add(item); - mcuMenu.add(item); - - item = new JCheckBoxMenuItem("atmega168", "atmega168".equals(curr_mcu)); - item.addActionListener(mml); - mcuGroup.add(item); - mcuMenu.add(item); - - - menu.add(mcuMenu); - serialMenu = new JMenu("Serial Port"); populateSerialMenu(); menu.add(serialMenu); @@ -913,7 +908,7 @@ public class Editor extends JFrame protected void showBootloaderMenuItemsForCurrentMCU() { boolean onATmega8 = - Preferences.get("build.mcu").equals("atmega8"); + Preferences.get("boards." + Preferences.get("board") + ".build.mcu").equals("atmega8"); burnBootloader8Item.setVisible(onATmega8); if (burnBootloader8ParallelItem != null) @@ -926,21 +921,16 @@ public class Editor extends JFrame if (burnBootloader168NGParallelItem != null) burnBootloader168NGParallelItem.setVisible(!onATmega8); } - - class McuMenuListener implements ActionListener { - McuMenuListener() {} + class BoardMenuAction extends AbstractAction { + private String board; + public BoardMenuAction(String board) { + super(Preferences.get("boards." + board + ".name")); + this.board = board; + } public void actionPerformed(ActionEvent actionevent) { - for (int i = 0; i < mcuMenu.getItemCount(); i++) - if (mcuMenu.getItem(i) instanceof JCheckBoxMenuItem) - ((JCheckBoxMenuItem) mcuMenu.getItem(i)).setState(false); - - ((JCheckBoxMenuItem) actionevent.getSource()).setState(true); - Preferences.set("build.mcu", - ((JCheckBoxMenuItem) actionevent.getSource()).getLabel()); - - showBootloaderMenuItemsForCurrentMCU(); - + //System.out.println("Switching to " + board); + Preferences.set("board", board); try { LibraryManager libraryManager = new LibraryManager(); libraryManager.rebuildAllBuilt(); @@ -1448,7 +1438,8 @@ public class Editor extends JFrame try { if (!sketch.handleRun(new Target( System.getProperty("user.dir") + File.separator + "hardware" + - File.separator + "cores", Preferences.get("build.target")))) + File.separator + "cores", + Preferences.get("boards." + Preferences.get("board") + ".build.core")))) return; //runtime = new Runner(sketch, Editor.this); @@ -1539,11 +1530,15 @@ public class Editor extends JFrame public void handleSerial() { if (!debugging) { - console.clear(); - buttons.activate(EditorButtons.SERIAL); - serialPort = new Serial(true); - debugging = true; - status.serial(); + try { + serialPort = new Serial(true); + console.clear(); + buttons.activate(EditorButtons.SERIAL); + debugging = true; + status.serial(); + } catch(SerialException e) { + error(e); + } } else { doStop(); } @@ -2057,7 +2052,8 @@ public class Editor extends JFrame //sketch.exportLibrary() : sketch.exportApplet(); boolean success = sketch.exportApplet(new Target( System.getProperty("user.dir") + File.separator + "hardware" + - File.separator + "cores", Preferences.get("build.target"))); + File.separator + "cores", + Preferences.get("boards." + Preferences.get("board") + ".build.core"))); if (success) { message("Done uploading."); } else { diff --git a/app/EditorStatus.java b/app/EditorStatus.java index ba8cc46b3..b7be1cdf7 100644 --- a/app/EditorStatus.java +++ b/app/EditorStatus.java @@ -526,7 +526,11 @@ public class EditorStatus extends JPanel implements ActionListener { int rate = Integer.parseInt(rateString); Preferences.set("serial.debug_rate", rateString); editor.serialPort.dispose(); - editor.serialPort = new Serial(true); + try { + editor.serialPort = new Serial(true); + } catch (SerialException err) { + editor.error(err); + } } } } diff --git a/app/Library.java b/app/Library.java index 57850bc55..9cd30767a 100755 --- a/app/Library.java +++ b/app/Library.java @@ -335,8 +335,8 @@ public class Library implements MessageConsumer{ "-g", "-Os", "-Wall", - "-mmcu=" + Preferences.get("build.mcu"), - "-DF_CPU=" + Preferences.get("build.f_cpu"), + "-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"), + "-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"), "-I" + libManager.getTarget().getPath(), "-I" + getFolder(), }; @@ -348,8 +348,8 @@ public class Library implements MessageConsumer{ "-Os", "-Wall", "-fno-exceptions", - "-mmcu=" + Preferences.get("build.mcu"), - "-DF_CPU=" + Preferences.get("build.f_cpu"), + "-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"), + "-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"), "-I" + libManager.getTarget().getPath(), "-I" + getFolder(), }; diff --git a/app/LibraryManager.java b/app/LibraryManager.java index 090feb390..871f7fb1b 100755 --- a/app/LibraryManager.java +++ b/app/LibraryManager.java @@ -49,7 +49,8 @@ public class LibraryManager { "libraries"); target = new Target( System.getProperty("user.dir") + File.separator + "hardware" + - File.separator + "cores", Preferences.get("build.target")); + File.separator + "cores", + Preferences.get("boards." + Preferences.get("board") + ".build.core")); refreshLibraries(); } diff --git a/app/Preferences.java b/app/Preferences.java index 29916afba..311afd291 100644 --- a/app/Preferences.java +++ b/app/Preferences.java @@ -139,8 +139,13 @@ public class Preferences { // data model - - static Hashtable table = new Hashtable();; + // we have multiple preference files, one main one and a few subsidiary + // ones with prefixes. the preferences from the main file go in table + // and are saved back to the main file. the preferences from the + // subsidiary files are stored in prefixes (which maps a prefix string to + // a Hashtable mapping unprefixed keys to values) and are not saved. + static Hashtable table = new Hashtable(); + static Hashtable prefixes = new Hashtable(); static File preferencesFile; @@ -203,6 +208,18 @@ public class Preferences { " and restart Arduino.", ex); } } + + try { + load(new FileInputStream(new File( + System.getProperty("user.dir") + + File.separator + "hardware" + + File.separator + "boards.txt")), + "boards"); + } catch (Exception ex) { + Base.showError("Error reading board definitions", + "Error reading the board definitions file. " + + "Please re-download or re-unzip Arduino.\n", ex); + } } @@ -521,10 +538,19 @@ public class Preferences { // ................................................................. - static public void load(InputStream input) throws IOException { + load(input, null); + } + + static public void load(InputStream input, String prefix) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(input)); + Hashtable table = Preferences.table; + + if (prefix != null) { + table = new Hashtable(); + prefixes.put(prefix, table); + } //table = new Hashtable(); String line = null; @@ -633,6 +659,18 @@ public class Preferences { //} static public String get(String attribute /*, String defaultValue */) { + // if the attribute starts with a prefix used by one of our subsidiary + // preference files, look up the attribute in that file's Hashtable + // (don't override with or fallback to the main file). otherwise, + // look up the attribute in the main file's Hashtable. + Hashtable table = Preferences.table; + if (attribute.indexOf('.') != -1) { + String prefix = attribute.substring(0, attribute.indexOf('.')); + if (prefixes.containsKey(prefix)) { + table = (Hashtable) prefixes.get(prefix); + attribute = attribute.substring(attribute.indexOf('.') + 1); + } + } return (String) table.get(attribute); /* //String value = (properties != null) ? @@ -643,6 +681,27 @@ public class Preferences { defaultValue : value; */ } + + /** + * Get the top-level key prefixes defined in the subsidiary file loaded with + * the given prefix. For example, if the file contains: + * foo.count=1 + * bar.count=2 + * baz.count=3 + * this will return { "foo", "bar", "baz" }. + */ + static public Iterator getSubKeys(String prefix) { + if (!prefixes.containsKey(prefix)) + return null; + Set subkeys = new HashSet(); + for (Enumeration e = ((Hashtable) prefixes.get(prefix)).keys(); e.hasMoreElements(); ) { + String subkey = (String) e.nextElement(); + if (subkey.indexOf('.') != -1) + subkey = subkey.substring(0, subkey.indexOf('.')); + subkeys.add(subkey); + } + return subkeys.iterator(); + } static public void set(String attribute, String value) { diff --git a/app/Serial.java b/app/Serial.java index 2d80271be..0baab4546 100755 --- a/app/Serial.java +++ b/app/Serial.java @@ -59,7 +59,7 @@ public class Serial implements SerialPortEventListener { int bufferIndex; int bufferLast; - public Serial(boolean monitor) { + public Serial(boolean monitor) throws SerialException { this(Preferences.get("serial.port"), Preferences.getInteger("serial.debug_rate"), Preferences.get("serial.parity").charAt(0), @@ -68,7 +68,7 @@ public class Serial implements SerialPortEventListener { this.monitor = monitor; } - public Serial() { + public Serial() throws SerialException { this(Preferences.get("serial.port"), Preferences.getInteger("serial.debug_rate"), Preferences.get("serial.parity").charAt(0), @@ -76,20 +76,20 @@ public class Serial implements SerialPortEventListener { new Float(Preferences.get("serial.stopbits")).floatValue()); } - public Serial(int irate) { + public Serial(int irate) throws SerialException { this(Preferences.get("serial.port"), irate, Preferences.get("serial.parity").charAt(0), Preferences.getInteger("serial.databits"), new Float(Preferences.get("serial.stopbits")).floatValue()); } - public Serial(String iname, int irate) { + public Serial(String iname, int irate) throws SerialException { this(iname, irate, Preferences.get("serial.parity").charAt(0), Preferences.getInteger("serial.databits"), new Float(Preferences.get("serial.stopbits")).floatValue()); } - public Serial(String iname) { + public Serial(String iname) throws SerialException { this(iname, Preferences.getInteger("serial.debug_rate"), Preferences.get("serial.parity").charAt(0), Preferences.getInteger("serial.databits"), @@ -97,7 +97,8 @@ public class Serial implements SerialPortEventListener { } public Serial(String iname, int irate, - char iparity, int idatabits, float istopbits) { + char iparity, int idatabits, float istopbits) + throws SerialException { //if (port != null) port.close(); //this.parent = parent; //parent.attach(this); @@ -115,6 +116,7 @@ public class Serial implements SerialPortEventListener { if (istopbits == 2) stopbits = SerialPort.STOPBITS_2; try { + port = null; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = @@ -134,14 +136,17 @@ public class Serial implements SerialPortEventListener { } } } - + } catch (PortInUseException e) { + throw new SerialException("Serial port '" + iname + "' already in use. Try quiting any programs that may be using it."); } catch (Exception e) { - errorMessage("", e); - //exception = e; - //e.printStackTrace(); - port = null; - input = null; - output = null; + throw new SerialException("Error opening serial port '" + iname + "'.", e); +// //errorMessage("", e); +// //exception = e; +// //e.printStackTrace(); + } + + if (port == null) { + throw new SerialException("Serial port '" + iname + "' not found. Did you select the right one from the Tools > Serial Port menu?"); } } diff --git a/app/SerialException.java b/app/SerialException.java new file mode 100644 index 000000000..525c24078 --- /dev/null +++ b/app/SerialException.java @@ -0,0 +1,39 @@ +/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Copyright (c) 2007 David A. Mellis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package processing.app; + +public class SerialException extends Exception { + public SerialException() { + super(); + } + + public SerialException(String message) { + super(message); + } + + public SerialException(String message, Throwable cause) { + super(message, cause); + } + + public SerialException(Throwable cause) { + super(cause); + } +} diff --git a/app/Sketch.java b/app/Sketch.java index 2623baabf..2e99f5468 100644 --- a/app/Sketch.java +++ b/app/Sketch.java @@ -1592,9 +1592,7 @@ 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; + long maxsize = Preferences.getInteger("boards." + Preferences.get("board") + ".upload.maximum_size"); Sizer sizer = new Sizer(buildPath, suggestedClassName); try { size = sizer.computeSize(); @@ -1606,8 +1604,7 @@ public class Sketch { 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."); + "Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it."); } protected String upload(String buildPath, String suggestedClassName) @@ -1617,11 +1614,7 @@ public class Sketch { // download the program // - if ("uisp".equals(Preferences.get("upload.application"))) { - uploader = new UispUploader(); - } else { - uploader = new AvrdudeUploader(); - } + uploader = new AvrdudeUploader(); // macos9 now officially broken.. see PdeCompilerJavac //PdeCompiler compiler = // ((PdeBase.platform == PdeBase.MACOS9) ? @@ -1691,6 +1684,8 @@ public class Sketch { if (Preferences.getBoolean("editor.external")) { // nuke previous files and settings load(); + } else { + current.program = editor.getText(); } zipFileContents = new Hashtable(); diff --git a/app/Uploader.java b/app/Uploader.java index 129955605..a4ebbf364 100755 --- a/app/Uploader.java +++ b/app/Uploader.java @@ -62,26 +62,31 @@ public abstract class Uploader implements MessageConsumer { public abstract boolean burnBootloaderParallel(String target) throws RunnerException; - protected void flushSerialBuffer() { + protected void flushSerialBuffer() throws RunnerException { // Cleanup the serial buffer - Serial serialPort = new Serial(); - byte[] readBuffer; - while(serialPort.available() > 0) { - readBuffer = serialPort.readBytes(); + try { + Serial serialPort = new Serial(); + byte[] readBuffer; + while(serialPort.available() > 0) { + readBuffer = serialPort.readBytes(); + try { + Thread.sleep(100); + } catch (InterruptedException e) {} + } + + serialPort.setDTR(false); + try { Thread.sleep(100); } catch (InterruptedException e) {} + + serialPort.setDTR(true); + + serialPort.dispose(); + } catch(Exception e) { + e.printStackTrace(); + throw new RunnerException(e.getMessage()); } - - serialPort.setDTR(false); - - try { - Thread.sleep(100); - } catch (InterruptedException e) {} - - serialPort.setDTR(true); - - serialPort.dispose(); } protected boolean executeUploadCommand(Collection commandDownloader) diff --git a/app/tools/ExportFolder.java b/app/tools/ExportFolder.java index 2ce364947..25ca32145 100755 --- a/app/tools/ExportFolder.java +++ b/app/tools/ExportFolder.java @@ -78,7 +78,8 @@ public class ExportFolder { // success may not be that useful, usually an ex is thrown success = editor.sketch.exportApplet(new Target( System.getProperty("user.dir") + File.separator + "hardware" + - File.separator + "cores", Preferences.get("build.target"))); + File.separator + "cores", + Preferences.get("boards." + Preferences.get("board") + ".build.core"))); if (!success) break; //System.out.println("success was " + success); } diff --git a/build/macosx/Arduino.xcodeproj/project.pbxproj b/build/macosx/Arduino.xcodeproj/project.pbxproj index 2bc12a7e2..afb389c22 100644 --- a/build/macosx/Arduino.xcodeproj/project.pbxproj +++ b/build/macosx/Arduino.xcodeproj/project.pbxproj @@ -170,6 +170,7 @@ /* End PBXApplicationTarget section */ /* Begin PBXBuildFile section */ + 33055EFF0CB8187700824CD9 /* SerialException.java in Sources */ = {isa = PBXBuildFile; fileRef = 33055EFE0CB8187600824CD9 /* SerialException.java */; }; 332D4DB609CF147F00BF81F6 /* Sizer.java in Sources */ = {isa = PBXBuildFile; fileRef = 332D4DB509CF147F00BF81F6 /* Sizer.java */; }; 335A28F50C8CCB0A00D8A7F4 /* quaqua.jar in CopyFiles */ = {isa = PBXBuildFile; fileRef = 335A28F30C8CCAF700D8A7F4 /* quaqua.jar */; }; 335A28FE0C8CCB4000D8A7F4 /* libquaqua.jnilib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 335A28F20C8CCAF700D8A7F4 /* libquaqua.jnilib */; }; @@ -441,6 +442,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 33055EFE0CB8187600824CD9 /* SerialException.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = SerialException.java; sourceTree = ""; }; 332D4DB509CF147F00BF81F6 /* Sizer.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Sizer.java; sourceTree = ""; }; 335A28F20C8CCAF700D8A7F4 /* libquaqua.jnilib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libquaqua.jnilib; sourceTree = ""; }; 335A28F30C8CCAF700D8A7F4 /* quaqua.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = quaqua.jar; sourceTree = ""; }; @@ -702,6 +704,7 @@ 33FFFE220965BD100016AC38 /* app */ = { isa = PBXGroup; children = ( + 33055EFE0CB8187600824CD9 /* SerialException.java */, 33F944E00C2B33560093EB9C /* AvrdudeUploader.java */, 33F9446B0C2B2F6F0093EB9C /* UispUploader.java */, 33BEE0CD09D7446100430D5B /* Library.java */, @@ -739,6 +742,7 @@ 33FFFE740965BD110016AC38 /* Uploader.java */, 332D4DB509CF147F00BF81F6 /* Sizer.java */, ); + includeInIndex = 0; name = app; path = ../../app; sourceTree = SOURCE_ROOT; @@ -1097,6 +1101,7 @@ 335A291F0C8CCC0900D8A7F4 /* PShape.java in Sources */, 335A29200C8CCC0900D8A7F4 /* PTriangle.java in Sources */, 335A29240C8CCC5E00D8A7F4 /* DiscourseFormat.java in Sources */, + 33055EFF0CB8187700824CD9 /* SerialException.java in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/build/shared/lib/preferences.txt b/build/shared/lib/preferences.txt index dc87adcc0..c1a193dab 100755 --- a/build/shared/lib/preferences.txt +++ b/build/shared/lib/preferences.txt @@ -271,53 +271,18 @@ linestatus.height = 20 upload.verbose=false upload.erase=false upload.verify=false -upload.programmer=stk500 -upload.maximum_size=7168 # set the parallel port defaults (used if upload.programmer=dapa) parallel.port=0x378 # set the serial port defaults +serial.port=COM1 serial.databits=8 serial.stopbits=1 serial.parity=N -serial.port=COM1 -serial.download_rate=19200 serial.debug_rate=9600 serial.burn_rate=115200 -bootloader.atmega8.low_fuses=0xdf -bootloader.atmega8.high_fuses=0xca -bootloader.atmega8.path=bootloader -bootloader.atmega8.file=ATmegaBOOT.hex -bootloader.atmega8.unlock_bits=0xFF -bootloader.atmega8.lock_bits=0xCF -bootloader.atmega8.programmer=stk500 -bootloader.atmega8.communication=serial - -bootloader.atmega168-ng.low_fuses=0xff -bootloader.atmega168-ng.high_fuses=0xdd -bootloader.atmega168-ng.extended_fuses=0x00 -bootloader.atmega168-ng.path=bootloader168 -bootloader.atmega168-ng.file=ATmegaBOOT_168_ng.hex -bootloader.atmega168-ng.unlock_bits=0x3F -bootloader.atmega168-ng.lock_bits=0x0F -bootloader.atmega168-ng.programmer=avrispmkii -bootloader.atmega168-ng.communication=usb - -bootloader.atmega168-diecimila.low_fuses=0xff -bootloader.atmega168-diecimila.high_fuses=0xdd -bootloader.atmega168-diecimila.extended_fuses=0x00 -bootloader.atmega168-diecimila.path=bootloader168 -bootloader.atmega168-diecimila.file=ATmegaBOOT_168_diecimila.hex -bootloader.atmega168-diecimila.unlock_bits=0x3F -bootloader.atmega168-diecimila.lock_bits=0x0F -bootloader.atmega168-diecimila.programmer=avrispmkii -bootloader.atmega168-diecimila.communication=usb - -# set the build defaults -build.mcu=atmega168 -build.f_cpu=16000000L -build.extension=c -build.target=arduino build.verbose=false + +board=diecimila \ No newline at end of file diff --git a/hardware/boards.txt b/hardware/boards.txt index dfed0a71e..0cf5b7f10 100644 --- a/hardware/boards.txt +++ b/hardware/boards.txt @@ -2,8 +2,9 @@ atmega8.name=Arduino NG or older w/ ATmega8 -atmega8.upload.programmer=stk500 +atmega8.upload.protocol=stk500 atmega8.upload.maximum_size=7168 +atmega8.upload.speed=19200 atmega8.bootloader.low_fuses=0xdf atmega8.bootloader.high_fuses=0xca @@ -20,8 +21,9 @@ atmega8.build.core=arduino atmega168.name=Arduino Mini or NG w/ ATmega168 -atmega168.upload.programmer=stk500 +atmega168.upload.protocol=stk500 atmega168.upload.maximum_size=14336 +atmega168.upload.speed=19200 atmega168.bootloader.low_fuses=0xff atmega168.bootloader.high_fuses=0xdd @@ -39,8 +41,9 @@ atmega168.build.core=arduino diecimila.name=Arduino Diecimila -diecimila.upload.programmer=stk500 +diecimila.upload.protocol=stk500 diecimila.upload.maximum_size=14336 +diecimila.upload.speed=19200 diecimila.bootloader.low_fuses=0xff diecimila.bootloader.high_fuses=0xdd