Adding support for ordering the Tools > Boards menu by using LinkedHashMap to store the keys for the prefixed sub-maps. Re-ordering the boards in the boards.txt file. Adding an entry for the LilyPad Arduino w/ ATmega328. Updating readme.

This commit is contained in:
David A. Mellis 2009-05-30 08:56:03 +00:00
parent a7f9864f4a
commit 2357f22387
3 changed files with 142 additions and 119 deletions

View File

@ -557,10 +557,10 @@ public class Preferences {
static public void load(InputStream input, String prefix) throws IOException { static public void load(InputStream input, String prefix) throws IOException {
BufferedReader reader = BufferedReader reader =
new BufferedReader(new InputStreamReader(input)); new BufferedReader(new InputStreamReader(input));
Hashtable table = Preferences.table; Map table = Preferences.table;
if (prefix != null) { if (prefix != null) {
table = new Hashtable(); table = new LinkedHashMap();
prefixes.put(prefix, table); prefixes.put(prefix, table);
} }
@ -675,11 +675,11 @@ public class Preferences {
// preference files, look up the attribute in that file's Hashtable // preference files, look up the attribute in that file's Hashtable
// (don't override with or fallback to the main file). otherwise, // (don't override with or fallback to the main file). otherwise,
// look up the attribute in the main file's Hashtable. // look up the attribute in the main file's Hashtable.
Hashtable table = Preferences.table; Map table = Preferences.table;
if (attribute.indexOf('.') != -1) { if (attribute.indexOf('.') != -1) {
String prefix = attribute.substring(0, attribute.indexOf('.')); String prefix = attribute.substring(0, attribute.indexOf('.'));
if (prefixes.containsKey(prefix)) { if (prefixes.containsKey(prefix)) {
table = (Hashtable) prefixes.get(prefix); table = (Map) prefixes.get(prefix);
attribute = attribute.substring(attribute.indexOf('.') + 1); attribute = attribute.substring(attribute.indexOf('.') + 1);
} }
} }
@ -705,9 +705,9 @@ public class Preferences {
static public Iterator getSubKeys(String prefix) { static public Iterator getSubKeys(String prefix) {
if (!prefixes.containsKey(prefix)) if (!prefixes.containsKey(prefix))
return null; return null;
Set subkeys = new HashSet(); Set subkeys = new LinkedHashSet();
for (Enumeration e = ((Hashtable) prefixes.get(prefix)).keys(); e.hasMoreElements(); ) { for (Iterator i = ((Map) prefixes.get(prefix)).keySet().iterator(); i.hasNext(); ) {
String subkey = (String) e.nextElement(); String subkey = (String) i.next();
if (subkey.indexOf('.') != -1) if (subkey.indexOf('.') != -1)
subkey = subkey.substring(0, subkey.indexOf('.')); subkey = subkey.substring(0, subkey.indexOf('.'));
subkeys.add(subkey); subkeys.add(subkey);

View File

@ -1,41 +1,62 @@
############################################################## ##############################################################
atmega8.name=Arduino NG or older w/ ATmega8 atmega328.name=Arduino Duemilanove w/ ATmega328
atmega8.upload.protocol=stk500 atmega328.upload.protocol=stk500
atmega8.upload.maximum_size=7168 atmega328.upload.maximum_size=30720
atmega8.upload.speed=19200 atmega328.upload.speed=57600
atmega8.bootloader.low_fuses=0xdf atmega328.bootloader.low_fuses=0xFF
atmega8.bootloader.high_fuses=0xca atmega328.bootloader.high_fuses=0xDA
atmega8.bootloader.path=atmega8 atmega328.bootloader.extended_fuses=0x05
atmega8.bootloader.file=ATmegaBOOT.hex atmega328.bootloader.path=atmega
atmega8.bootloader.unlock_bits=0x3F atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
atmega8.bootloader.lock_bits=0x0F atmega328.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F
atmega8.build.mcu=atmega8 atmega328.build.mcu=atmega328p
atmega8.build.f_cpu=16000000L atmega328.build.f_cpu=16000000L
atmega8.build.core=arduino atmega328.build.core=arduino
############################################################## ##############################################################
atmega168.name=Arduino NG or older w/ ATmega168 diecimila.name=Arduino Diecimila or Duemilanove w/ ATmega168
atmega168.upload.protocol=stk500 diecimila.upload.protocol=stk500
atmega168.upload.maximum_size=14336 diecimila.upload.maximum_size=14336
atmega168.upload.speed=19200 diecimila.upload.speed=19200
atmega168.bootloader.low_fuses=0xff diecimila.bootloader.low_fuses=0xff
atmega168.bootloader.high_fuses=0xdd diecimila.bootloader.high_fuses=0xdd
atmega168.bootloader.extended_fuses=0x00 diecimila.bootloader.extended_fuses=0x00
atmega168.bootloader.path=atmega diecimila.bootloader.path=atmega
atmega168.bootloader.file=ATmegaBOOT_168_ng.hex diecimila.bootloader.file=ATmegaBOOT_168_diecimila.hex
atmega168.bootloader.unlock_bits=0x3F diecimila.bootloader.unlock_bits=0x3F
atmega168.bootloader.lock_bits=0x0F diecimila.bootloader.lock_bits=0x0F
atmega168.build.mcu=atmega168 diecimila.build.mcu=atmega168
atmega168.build.f_cpu=16000000L diecimila.build.f_cpu=16000000L
atmega168.build.core=arduino diecimila.build.core=arduino
##############################################################
mega.name=Arduino Mega
mega.upload.protocol=stk500
mega.upload.maximum_size=126976
mega.upload.speed=57600
mega.bootloader.low_fuses=0xFF
mega.bootloader.high_fuses=0xDA
mega.bootloader.extended_fuses=0xF5
mega.bootloader.path=atmega
mega.bootloader.file=ATmegaBOOT_168_atmega1280.hex
mega.bootloader.unlock_bits=0x3F
mega.bootloader.lock_bits=0x0F
mega.build.mcu=atmega1280
mega.build.f_cpu=16000000L
mega.build.core=arduino
############################################################## ##############################################################
@ -59,6 +80,26 @@ mini.build.core=arduino
############################################################## ##############################################################
nano.name=Arduino Nano
nano.upload.protocol=stk500
nano.upload.maximum_size=14336
nano.upload.speed=19200
nano.bootloader.low_fuses=0xff
nano.bootloader.high_fuses=0xdd
nano.bootloader.extended_fuses=0x00
nano.bootloader.path=atmega
nano.bootloader.file=ATmegaBOOT_168_diecimila.hex
nano.bootloader.unlock_bits=0x3F
nano.bootloader.lock_bits=0x0F
nano.build.mcu=atmega168
nano.build.f_cpu=16000000L
nano.build.core=arduino
##############################################################
bt.name=Arduino BT bt.name=Arduino BT
bt.upload.protocol=stk500 bt.upload.protocol=stk500
@ -80,47 +121,27 @@ bt.build.core=arduino
############################################################## ##############################################################
diecimila.name=Arduino Diecimila or Duemilanove w/ ATmega168 lilypad328.name=LilyPad Arduino w/ ATmega328
diecimila.upload.protocol=stk500 lilypad328.upload.protocol=stk500
diecimila.upload.maximum_size=14336 lilypad328.upload.maximum_size=30720
diecimila.upload.speed=19200 lilypad328.upload.speed=57600
diecimila.bootloader.low_fuses=0xff lilypad328.bootloader.low_fuses=0xFF
diecimila.bootloader.high_fuses=0xdd lilypad328.bootloader.high_fuses=0xDA
diecimila.bootloader.extended_fuses=0x00 lilypad328.bootloader.extended_fuses=0x05
diecimila.bootloader.path=atmega lilypad328.bootloader.path=atmega
diecimila.bootloader.file=ATmegaBOOT_168_diecimila.hex lilypad328.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
diecimila.bootloader.unlock_bits=0x3F lilypad328.bootloader.unlock_bits=0x3F
diecimila.bootloader.lock_bits=0x0F lilypad328.bootloader.lock_bits=0x0F
diecimila.build.mcu=atmega168 lilypad328.build.mcu=atmega328p
diecimila.build.f_cpu=16000000L lilypad328.build.f_cpu=8000000L
diecimila.build.core=arduino lilypad328.build.core=arduino
############################################################## ##############################################################
nano.name=Arduino Nano lilypad.name=LilyPad Arduino w/ ATmega168
nano.upload.protocol=stk500
nano.upload.maximum_size=14336
nano.upload.speed=19200
nano.bootloader.low_fuses=0xff
nano.bootloader.high_fuses=0xdd
nano.bootloader.extended_fuses=0x00
nano.bootloader.path=atmega
nano.bootloader.file=ATmegaBOOT_168_diecimila.hex
nano.bootloader.unlock_bits=0x3F
nano.bootloader.lock_bits=0x0F
nano.build.mcu=atmega168
nano.build.f_cpu=16000000L
nano.build.core=arduino
##############################################################
lilypad.name=LilyPad Arduino
lilypad.upload.protocol=stk500 lilypad.upload.protocol=stk500
lilypad.upload.maximum_size=14336 lilypad.upload.maximum_size=14336
@ -140,27 +161,7 @@ lilypad.build.core=arduino
############################################################## ##############################################################
pro.name=Arduino Pro or Pro Mini (8 MHz) w/ ATmega168 pro328.name=Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328
pro.upload.protocol=stk500
pro.upload.maximum_size=14336
pro.upload.speed=19200
pro.bootloader.low_fuses=0xc6
pro.bootloader.high_fuses=0xdd
pro.bootloader.extended_fuses=0x00
pro.bootloader.path=atmega
pro.bootloader.file=ATmegaBOOT_168_pro_8MHz.hex
pro.bootloader.unlock_bits=0x3F
pro.bootloader.lock_bits=0x0F
pro.build.mcu=atmega168
pro.build.f_cpu=8000000L
pro.build.core=arduino
##############################################################
pro328.name=Arduino Pro or Pro Mini (8 MHz) w/ ATmega328
pro328.upload.protocol=stk500 pro328.upload.protocol=stk500
pro328.upload.maximum_size=30720 pro328.upload.maximum_size=30720
@ -180,40 +181,60 @@ pro328.build.core=arduino
############################################################## ##############################################################
atmega328.name=Arduino Duemilanove w/ ATmega328 pro.name=Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega168
atmega328.upload.protocol=stk500 pro.upload.protocol=stk500
atmega328.upload.maximum_size=30720 pro.upload.maximum_size=14336
atmega328.upload.speed=57600 pro.upload.speed=19200
atmega328.bootloader.low_fuses=0xFF pro.bootloader.low_fuses=0xc6
atmega328.bootloader.high_fuses=0xDA pro.bootloader.high_fuses=0xdd
atmega328.bootloader.extended_fuses=0x05 pro.bootloader.extended_fuses=0x00
atmega328.bootloader.path=atmega pro.bootloader.path=atmega
atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex pro.bootloader.file=ATmegaBOOT_168_pro_8MHz.hex
atmega328.bootloader.unlock_bits=0x3F pro.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F pro.bootloader.lock_bits=0x0F
atmega328.build.mcu=atmega328p pro.build.mcu=atmega168
atmega328.build.f_cpu=16000000L pro.build.f_cpu=8000000L
atmega328.build.core=arduino pro.build.core=arduino
############################################################## ##############################################################
mega.name=Arduino Mega atmega168.name=Arduino NG or older w/ ATmega168
mega.upload.protocol=stk500 atmega168.upload.protocol=stk500
mega.upload.maximum_size=126976 atmega168.upload.maximum_size=14336
mega.upload.speed=57600 atmega168.upload.speed=19200
mega.bootloader.low_fuses=0xFF atmega168.bootloader.low_fuses=0xff
mega.bootloader.high_fuses=0xDA atmega168.bootloader.high_fuses=0xdd
mega.bootloader.extended_fuses=0xF5 atmega168.bootloader.extended_fuses=0x00
mega.bootloader.path=atmega atmega168.bootloader.path=atmega
mega.bootloader.file=ATmegaBOOT_168_atmega1280.hex atmega168.bootloader.file=ATmegaBOOT_168_ng.hex
mega.bootloader.unlock_bits=0x3F atmega168.bootloader.unlock_bits=0x3F
mega.bootloader.lock_bits=0x0F atmega168.bootloader.lock_bits=0x0F
atmega168.build.mcu=atmega168
atmega168.build.f_cpu=16000000L
atmega168.build.core=arduino
##############################################################
atmega8.name=Arduino NG or older w/ ATmega8
atmega8.upload.protocol=stk500
atmega8.upload.maximum_size=7168
atmega8.upload.speed=19200
atmega8.bootloader.low_fuses=0xdf
atmega8.bootloader.high_fuses=0xca
atmega8.bootloader.path=atmega8
atmega8.bootloader.file=ATmegaBOOT.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F
atmega8.build.mcu=atmega8
atmega8.build.f_cpu=16000000L
atmega8.build.core=arduino
mega.build.mcu=atmega1280
mega.build.f_cpu=16000000L
mega.build.core=arduino

View File

@ -46,7 +46,7 @@ Processing and Wiring.
UPDATES UPDATES
0016 - 2009.05.24 0016 - 2009.05.30
[documentation / examples] [documentation / examples]
* New communication examples (w/ corresponding Processing and Max/MSP code) by * New communication examples (w/ corresponding Processing and Max/MSP code) by
@ -54,6 +54,7 @@ UPDATES
[core / libraries] [core / libraries]
* Adding support for the Arduino Pro and Pro Mini 3.3V / 8 MHz w/ ATmega328. * Adding support for the Arduino Pro and Pro Mini 3.3V / 8 MHz w/ ATmega328.
* Adding support for the LilyPad Arduino w/ ATmega328.
* Adding write(str) and write(buf, size) methods to Print, Serial, and the * Adding write(str) and write(buf, size) methods to Print, Serial, and the
Ethernet library Client and Server classes. This allows for more efficient Ethernet library Client and Server classes. This allows for more efficient
(fewer packet) Ethernet communication. (Thanks to mikalhart.) (fewer packet) Ethernet communication. (Thanks to mikalhart.)
@ -66,6 +67,7 @@ UPDATES
* Adding ARDUINO version constant (thanks to prodding from mikalhart). * Adding ARDUINO version constant (thanks to prodding from mikalhart).
[environment] [environment]
* Ordering the items in the Tools > Board menu.
* Adding support for user libraries in the "libraries" sub-directory of the * Adding support for user libraries in the "libraries" sub-directory of the
Arduino sketchbook directory. Arduino sketchbook directory.
* Adding "Copy as HTML" command to the Tools menu. * Adding "Copy as HTML" command to the Tools menu.