svn merge -r 72:HEAD svn+ssh://mellis@svn.berlios.de/svnroot/repos/arduino/tags/0004 - used Base.java from tags/0004 but changed version back to 0003.

This commit is contained in:
David A. Mellis 2006-01-12 23:24:12 +00:00
parent 5ede9c8d2e
commit b7728ae604
49 changed files with 2425 additions and 1770 deletions

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@
along with this program; if not, write to the Free Software Foundation, along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id:$ $Id$
*/ */
package processing.app; package processing.app;

View File

@ -82,7 +82,7 @@ public class Editor extends JFrame
EditorHeader header; EditorHeader header;
EditorStatus status; EditorStatus status;
EditorConsole console; EditorConsole console;
Serial serialPort;
JSplitPane splitPane; JSplitPane splitPane;
JPanel consolePanel; JPanel consolePanel;
@ -107,12 +107,13 @@ public class Editor extends JFrame
JMenuItem saveMenuItem; JMenuItem saveMenuItem;
JMenuItem saveAsMenuItem; JMenuItem saveAsMenuItem;
//ButtonGroup serialGroup;
JMenu serialSubMenu; JMenu serialSubMenu;
JMenu serialRateSubMenu; JMenu serialRateSubMenu;
SerialMenuListener serialMenuListener;
// //
boolean debugging;
boolean running; boolean running;
boolean presenting; boolean presenting;
@ -655,9 +656,10 @@ public class Editor extends JFrame
JMenuItem item; JMenuItem item;
JMenuItem rbMenuItem; JMenuItem rbMenuItem;
JMenuItem cbMenuItem; JMenuItem cbMenuItem;
SerialMenuListener sml = new SerialMenuListener();
SerialRateMenuListener srml = new SerialRateMenuListener(); SerialRateMenuListener srml = new SerialRateMenuListener();
// Enumeration portRates = {"9600","19200","38400","57600","115200"}; // Enumeration portRates = {"9600","19200","38400","57600","115200"};
serialMenuListener = new SerialMenuListener();
JMenu menu = new JMenu("Tools"); JMenu menu = new JMenu("Tools");
@ -675,55 +677,17 @@ public class Editor extends JFrame
serialSubMenu = new JMenu("Serial port"); serialSubMenu = new JMenu("Serial port");
item = newJMenuItem("Update List", 'E', false); // item = newJMenuItem("Update List", 'E', false);
item.addActionListener(new ActionListener() { // item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { // public void actionPerformed(ActionEvent e) {
// if (debug) displayResult("Serial Port List Updated"); // // if (debug) displayResult("Serial Port List Updated");
//updateSerial(); // //updateSerial();
} // }
}); // });
//serialGroup = new ButtonGroup();
populateSerialMenu();
menu.add(serialSubMenu);
ButtonGroup group = new ButtonGroup();
// getting list of ports
try
{
for (Enumeration enumeration = CommPortIdentifier.getPortIdentifiers(); enumeration.hasMoreElements();)
{
CommPortIdentifier commportidentifier = (CommPortIdentifier)enumeration.nextElement();
if (commportidentifier.getPortType() == CommPortIdentifier.PORT_SERIAL)
{
String curr_port = commportidentifier.getName();
rbMenuItem = new JCheckBoxMenuItem(curr_port, curr_port.equals(Preferences.get("serial.port")));
rbMenuItem.addActionListener(sml);
group.add(rbMenuItem);
serialSubMenu.add(rbMenuItem);
}
}
}
catch (Exception exception)
{
System.out.println("error retrieving port list");
exception.printStackTrace();
}
if (serialSubMenu.getItemCount() == 0) {
serialSubMenu.setEnabled(false);
}
//serialSubMenu.addSeparator();
//serialSubMenu.add(item);
menu.add(serialSubMenu);
// End of The serial options // End of The serial options
@ -735,7 +699,7 @@ public class Editor extends JFrame
//serialSubMenu.add(item); //serialSubMenu.add(item);
//serialSubMenu.addSeparator(); //serialSubMenu.addSeparator();
group = new ButtonGroup(); ButtonGroup group = new ButtonGroup();
int curr_rate = Preferences.getInteger("serial.download_rate"); int curr_rate = Preferences.getInteger("serial.download_rate");
@ -755,9 +719,55 @@ public class Editor extends JFrame
serialRateSubMenu.add(rbMenuItem); serialRateSubMenu.add(rbMenuItem);
menu.add(serialRateSubMenu); menu.add(serialRateSubMenu);
menu.addMenuListener(new MenuListener() {
public void menuCanceled(MenuEvent e) {}
public void menuDeselected(MenuEvent e) {}
public void menuSelected(MenuEvent e) {
populateSerialMenu();
}
});
return menu; return menu;
} }
protected void populateSerialMenu() {
// getting list of ports
JMenuItem rbMenuItem;
serialSubMenu.removeAll();
try
{
for (Enumeration enumeration = CommPortIdentifier.getPortIdentifiers(); enumeration.hasMoreElements();)
{
CommPortIdentifier commportidentifier = (CommPortIdentifier)enumeration.nextElement();
if (commportidentifier.getPortType() == CommPortIdentifier.PORT_SERIAL)
{
String curr_port = commportidentifier.getName();
rbMenuItem = new JCheckBoxMenuItem(curr_port, curr_port.equals(Preferences.get("serial.port")));
rbMenuItem.addActionListener(serialMenuListener);
//serialGroup.add(rbMenuItem);
serialSubMenu.add(rbMenuItem);
}
}
}
catch (Exception exception)
{
System.out.println("error retrieving port list");
exception.printStackTrace();
}
if (serialSubMenu.getItemCount() == 0) {
serialSubMenu.setEnabled(false);
}
//serialSubMenu.addSeparator();
//serialSubMenu.add(item);
}
protected JMenu buildHelpMenu() { protected JMenu buildHelpMenu() {
@ -1292,6 +1302,17 @@ public class Editor extends JFrame
} }
public void handleSerial() {
if (!debugging) {
console.clear();
serialPort = new Serial(true);
debugging = true;
} else {
doStop();
}
}
public void handleStop() { // called by menu or buttons public void handleStop() { // called by menu or buttons
if (presenting) { if (presenting) {
doClose(); doClose();
@ -1305,6 +1326,10 @@ public class Editor extends JFrame
* Stop the applet but don't kill its window. * Stop the applet but don't kill its window.
*/ */
public void doStop() { public void doStop() {
if (debugging) {
serialPort.dispose();
debugging = false;
}
if (runtime != null) runtime.stop(); if (runtime != null) runtime.stop();
if (watcher != null) watcher.stop(); if (watcher != null) watcher.stop();
message(EMPTY); message(EMPTY);
@ -1695,8 +1720,8 @@ public class Editor extends JFrame
* hitting export twice, quickly, and horking things up. * hitting export twice, quickly, and horking things up.
*/ */
synchronized public void handleExport() { synchronized public void handleExport() {
//if(debugging) if(debugging)
//doStop(); doStop();
console.clear(); console.clear();
//String what = sketch.isLibrary() ? "Applet" : "Library"; //String what = sketch.isLibrary() ? "Applet" : "Library";
//message("Exporting " + what + "..."); //message("Exporting " + what + "...");

View File

@ -37,7 +37,7 @@ import javax.swing.event.*;
public class EditorButtons extends JComponent implements MouseInputListener { public class EditorButtons extends JComponent implements MouseInputListener {
static final String title[] = { static final String title[] = {
"Compile", "Stop", "New", "Open", "Save", "Export" "Compile", "Stop", "New", "Open", "Save", "Export", "Serial Monitor"
}; };
static final int BUTTON_COUNT = title.length; static final int BUTTON_COUNT = title.length;
@ -52,6 +52,7 @@ public class EditorButtons extends JComponent implements MouseInputListener {
static final int OPEN = 3; static final int OPEN = 3;
static final int SAVE = 4; static final int SAVE = 4;
static final int EXPORT = 5; static final int EXPORT = 5;
static final int SERIAL = 6;
static final int INACTIVE = 0; static final int INACTIVE = 0;
static final int ROLLOVER = 1; static final int ROLLOVER = 1;
@ -103,6 +104,7 @@ public class EditorButtons extends JComponent implements MouseInputListener {
which[buttonCount++] = OPEN; which[buttonCount++] = OPEN;
which[buttonCount++] = SAVE; which[buttonCount++] = SAVE;
which[buttonCount++] = EXPORT; which[buttonCount++] = EXPORT;
which[buttonCount++] = SERIAL;
currentRollover = -1; currentRollover = -1;
@ -339,6 +341,7 @@ public class EditorButtons extends JComponent implements MouseInputListener {
case NEW: editor.handleNew(e.isShiftDown()); break; case NEW: editor.handleNew(e.isShiftDown()); break;
case SAVE: editor.handleSave(); break; case SAVE: editor.handleSave(); break;
case EXPORT: editor.handleExport(); break; case EXPORT: editor.handleExport(); break;
case SERIAL: editor.handleSerial(); break;
} }
currentSelection = -1; currentSelection = -1;
} }

View File

@ -59,59 +59,41 @@ public class Serial implements SerialPortEventListener {
int bufferIndex; int bufferIndex;
int bufferLast; int bufferLast;
// defaults
static String dname = Preferences.get("serial.port"); //"COM1";
static int drate = 9600;
static char dparity = 'N';
static int ddatabits = 8;
static float dstopbits = 1;
/*
public void setProperties(Properties props) {
dname =
props.getProperty("serial.port", dname);
drate =
Integer.parseInt(props.getProperty("serial.rate", "9600"));
dparity =
props.getProperty("serial.parity", "N").charAt(0);
ddatabits =
Integer.parseInt(props.getProperty("serial.databits", "8"));
dstopbits =
new Float(props.getProperty("serial.stopbits", "1")).floatValue();
}
*/
public void setProperties() {
//System.out.println("setting serial properties");
dname = Preferences.get("serial.port");
drate = Preferences.getInteger("serial.debug_rate");
dparity = Preferences.get("serial.parity").charAt(0);
ddatabits = Preferences.getInteger("serial.databits");
dstopbits = new Float(Preferences.get("serial.stopbits")).floatValue();
}
public Serial(boolean monitor) { public Serial(boolean monitor) {
this(dname, drate, dparity, ddatabits, dstopbits); this(Preferences.get("serial.port"),
Preferences.getInteger("serial.debug_rate"),
Preferences.get("serial.parity").charAt(0),
Preferences.getInteger("serial.databits"),
new Float(Preferences.get("serial.stopbits")).floatValue());
this.monitor = monitor; this.monitor = monitor;
} }
public Serial() { public Serial() {
//setProperties(); this(Preferences.get("serial.port"),
this(dname, drate, dparity, ddatabits, dstopbits); Preferences.getInteger("serial.debug_rate"),
Preferences.get("serial.parity").charAt(0),
Preferences.getInteger("serial.databits"),
new Float(Preferences.get("serial.stopbits")).floatValue());
} }
public Serial(int irate) { public Serial(int irate) {
this(dname, irate, dparity, ddatabits, dstopbits); 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) {
this(iname, irate, dparity, ddatabits, dstopbits); 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) {
this(iname, drate, dparity, ddatabits, dstopbits); this(iname, Preferences.getInteger("serial.debug_rate"),
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,

View File

@ -20,7 +20,7 @@
along with this program; if not, write to the Free Software Foundation, along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id:$ $Id$
*/ */
package processing.app; package processing.app;

View File

@ -21,7 +21,7 @@
along with this program; if not, write to the Free Software Foundation, along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id:$ $Id$
*/ */
package processing.app; package processing.app;

View File

@ -21,7 +21,7 @@
along with this program; if not, write to the Free Software Foundation, along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id:$ $Id$
*/ */
package processing.app; package processing.app;

View File

@ -4,7 +4,7 @@ package antlr;
* Project led by Terence Parr at http://www.jGuru.com * Project led by Terence Parr at http://www.jGuru.com
* Software rights: http://www.antlr.org/RIGHTS.html * Software rights: http://www.antlr.org/RIGHTS.html
* *
* $Id: ExtendedCommonASTWithHiddenTokens.java,v 1.1.1.1 2005/06/22 22:18:14 h Exp $ * $Id$
*/ */
import java.io.*; import java.io.*;

View File

@ -15,7 +15,7 @@ import javax.swing.text.Segment;
* C token marker. * C token marker.
* *
* @author Slava Pestov * @author Slava Pestov
* @version $Id: CTokenMarker.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
*/ */
public class CTokenMarker extends TokenMarker public class CTokenMarker extends TokenMarker
{ {

View File

@ -19,7 +19,7 @@ import java.util.StringTokenizer;
* The default input handler. It maps sequences of keystrokes into actions * The default input handler. It maps sequences of keystrokes into actions
* and inserts key typed events into the text area. * and inserts key typed events into the text area.
* @author Slava Pestov * @author Slava Pestov
* @version $Id: DefaultInputHandler.java,v 1.2 2005/05/11 08:34:16 benfry Exp $ * @version $Id$
*/ */
public class DefaultInputHandler extends InputHandler public class DefaultInputHandler extends InputHandler
{ {

View File

@ -24,7 +24,7 @@ import java.util.*;
* to the implementations of this class to do so. * to the implementations of this class to do so.
* *
* @author Slava Pestov * @author Slava Pestov
* @version $Id: InputHandler.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
* @see org.gjt.sp.jedit.textarea.DefaultInputHandler * @see org.gjt.sp.jedit.textarea.DefaultInputHandler
*/ */
public abstract class InputHandler extends KeyAdapter public abstract class InputHandler extends KeyAdapter

View File

@ -52,7 +52,7 @@ import java.util.Vector;
* + "}");</pre> * + "}");</pre>
* *
* @author Slava Pestov * @author Slava Pestov
* @version $Id: JEditTextArea.java,v 1.5 2005/05/10 00:29:05 benfry Exp $ * @version $Id$
*/ */
public class JEditTextArea extends JComponent public class JEditTextArea extends JComponent
{ {

View File

@ -20,7 +20,7 @@ import javax.swing.text.Segment;
* This class is used by <code>CTokenMarker</code> to map keywords to ids. * This class is used by <code>CTokenMarker</code> to map keywords to ids.
* *
* @author Slava Pestov, Mike Dillon * @author Slava Pestov, Mike Dillon
* @version $Id: KeywordMap.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
*/ */
public class KeywordMap public class KeywordMap
{ {

View File

@ -18,7 +18,7 @@ import javax.swing.undo.UndoableEdit;
* system. * system.
* *
* @author Slava Pestov * @author Slava Pestov
* @version $Id: SyntaxDocument.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
*/ */
public class SyntaxDocument extends PlainDocument public class SyntaxDocument extends PlainDocument
{ {

View File

@ -16,7 +16,7 @@ import java.util.StringTokenizer;
* A simple text style class. It can specify the color, italic flag, * A simple text style class. It can specify the color, italic flag,
* and bold flag of a run of text. * and bold flag of a run of text.
* @author Slava Pestov * @author Slava Pestov
* @version $Id: SyntaxStyle.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
*/ */
public class SyntaxStyle public class SyntaxStyle
{ {

View File

@ -18,7 +18,7 @@ import java.awt.*;
* subsystem. * subsystem.
* *
* @author Slava Pestov * @author Slava Pestov
* @version $Id: SyntaxUtilities.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
*/ */
public class SyntaxUtilities public class SyntaxUtilities
{ {

View File

@ -23,7 +23,7 @@ import java.awt.*;
* The text area repaint manager. It performs double buffering and paints * The text area repaint manager. It performs double buffering and paints
* lines of text. * lines of text.
* @author Slava Pestov * @author Slava Pestov
* @version $Id: TextAreaPainter.java,v 1.3 2005/05/10 01:17:21 benfry Exp $ * @version $Id$
*/ */
public class TextAreaPainter extends JComponent implements TabExpander public class TextAreaPainter extends JComponent implements TabExpander
{ {

View File

@ -14,7 +14,7 @@ import javax.swing.text.*;
/** /**
* Class with several utility functions used by the text area component. * Class with several utility functions used by the text area component.
* @author Slava Pestov * @author Slava Pestov
* @version $Id: TextUtilities.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
*/ */
public class TextUtilities public class TextUtilities
{ {

View File

@ -17,7 +17,7 @@ package processing.app.syntax;
* token in the text, and a pointer to the next token in the list. * token in the text, and a pointer to the next token in the list.
* *
* @author Slava Pestov * @author Slava Pestov
* @version $Id: Token.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
*/ */
public class Token public class Token
{ {

View File

@ -23,7 +23,7 @@ import java.util.*;
* cached. * cached.
* *
* @author Slava Pestov * @author Slava Pestov
* @version $Id: TokenMarker.java,v 1.1 2005/04/09 02:30:37 benfry Exp $ * @version $Id$
* *
* @see org.gjt.sp.jedit.syntax.Token * @see org.gjt.sp.jedit.syntax.Token
*/ */

View File

@ -121,4 +121,4 @@ the code, but all the other annoying crap that the build scripts do)
then maybe we could switch to it. It's all about reaching some kind then maybe we could switch to it. It's all about reaching some kind
of critical mass. of critical mass.
$Id:$ $Id$

View File

@ -30,7 +30,7 @@ else
mkdir -p work/examples mkdir -p work/examples
#need to replace this with the linux native library for RXTX #need to replace this with the linux native library for RXTX
cp ../../lib/librxtxSerial.so work/ cp dist/librxtxSerial.so work/
cp dist/arduino work/ cp dist/arduino work/

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>arduino</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>arduino.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>text/plain</string>
</array>
<key>CFBundleTypeName</key>
<string>Arduino Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
<key>CFBundleIconFile</key>
<string>arduino.icns</string>
<key>CFBundleIdentifier</key>
<string>de.berlios.arduino</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Arduino</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>Pde1</string>
<key>CFBundleVersion</key>
<string>0.3</string>
<key>Java</key>
<dict>
<key>ClassPath</key>
<string>$JAVAROOT/pde.jar:lib/core.jar:$JAVAROOT/antlr.jar:$JAVAROOT/oro.jar:$JAVAROOT/registry.jar:lib/build:$JAVAROOT/RXTXcomm.jar</string>
<key>JVMVersion</key>
<string>1.4+</string>
<key>MainClass</key>
<string>processing.app.Base</string>
<key>Properties</key>
<dict>
<key>apple.awt.Antialiasing</key>
<string>true</string>
<key>apple.awt.TextAntialiasing</key>
<string>true</string>
<key>apple.awt.showGrowBox</key>
<string>true</string>
<key>apple.awt.use-file-dialog-packages</key>
<string>false</string>
<key>apple.laf.useScreenMenuBar</key>
<string>true</string>
<key>com.apple.hwaccel</key>
<string>true</string>
<key>com.apple.smallTabs</key>
<string>true</string>
</dict>
<key>VMOptions</key>
<string>-Xms128M -Xmx256M</string>
</dict>
</dict>
</plist>

View File

@ -1 +0,0 @@
APPLsnip

View File

@ -1,419 +0,0 @@
# Hey Emacs, this is a -*- makefile -*-
#
# WinAVR Sample makefile written by Eric B. Weddington, Jörg Wunsch, et al.
# Released to the Public Domain
# Please read the make user manual!
#
# Additional material for this makefile was submitted by:
# Tim Henigan
# Peter Fleury
# Reiner Patommel
# Sander Pool
# Frederik Rouleau
# Markus Pfaff
#
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
#
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
# 4.07 or greater).
#
# make program = Download the hex file to the device, using avrdude. Please
# customize the avrdude settings below first!
#
# make filename.s = Just compile filename.c into the assembler code only
#
# To rebuild project do "make clean" then "make all".
#
# MCU name
MCU = atmega8
# Output format. (can be srec, ihex, binary)
FORMAT = ihex
# Target file name (without extension).
TARGET = prog
# List C source files here. (C dependencies are automatically generated.)
#SRC = pins_arduino.c wiring.c ../avrlib/uart.c ../avrlib/buffer.c ../avrlib/timer.c ../avrlib/a2d.c $(TARGET).c
SRC = pins_arduino.c wiring.c ../avrlib/uart.c ../avrlib/buffer.c ../avrlib/timer.c $(TARGET).c
# List Assembler source files here.
# Make them always end in a capital .S. Files ending in a lowercase .s
# will not be considered source files but generated files (assembler
# output from the compiler), and will be deleted upon "make clean"!
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
ASRC =
# Optimization level, can be [0, 1, 2, 3, s].
# 0 = turn off optimization. s = optimize for size.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
# List any extra directories to look for include files here.
# Each directory must be seperated by a space.
EXTRAINCDIRS = ../avrlib
# Compiler flag to set the C Standard level.
# c89 - "ANSI" C
# gnu89 - c89 plus GCC extensions
# c99 - ISO C99 standard (not yet fully implemented)
# gnu99 - c99 plus GCC extensions
CSTANDARD = -std=gnu99
# Place -D or -U options here
CDEFS = -D F_CPU=16000000L
# Place -I options here
CINCS =
# Compiler flags.
# -g: generate debugging information
# -O*: optimization level
# -f...: tuning, see GCC manual and avr-libc documentation
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
CFLAGS = -g
CFLAGS += $(CDEFS) $(CINCS)
CFLAGS += -O$(OPT)
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -Wall -Wstrict-prototypes
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
CFLAGS += $(CSTANDARD)
# Assembler flags.
# -Wa,...: tell GCC to pass this to the assembler.
# -ahlms: create listing
# -gstabs: have the assembler create line number information; note that
# for use in COFF files, additional information about filenames
# and function names needs to be present in the assembler source
# files -- see avr-libc docs [FIXME: not yet described there]
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
#Additional libraries.
# Minimalistic printf version
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
# Floating point printf version (requires MATH_LIB = -lm below)
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
PRINTF_LIB =
# Minimalistic scanf version
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
SCANF_LIB =
MATH_LIB = -lm
# External memory options
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
# used for variables (.data/.bss) and heap (malloc()).
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
# only used for heap (malloc()).
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
EXTMEMOPTS =
# Linker flags.
# -Wl,...: tell GCC to pass this to linker.
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
# Programming support using avrdude. Settings and variables.
# Programming hardware: alf avr910 avrisp bascom bsd
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
#
# Type: avrdude -c ?
# to get a full listing.
#
AVRDUDE_PROGRAMMER = stk500
# com1 = serial port. Use lpt1 to connect to parallel port.
AVRDUDE_PORT = com1 # programmer connected to serial device
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
# Uncomment the following if you want avrdude's erase cycle counter.
# Note that this counter needs to be initialized first using -Yn,
# see avrdude manual.
#AVRDUDE_ERASE_COUNTER = -y
# Uncomment the following if you do /not/ wish a verification to be
# performed after programming the device.
#AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
#AVRDUDE_VERBOSE = -v -v
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
# ---------------------------------------------------------------------------
# Define directories, if needed.
DIRAVR = ../../tools/avr
DIRAVRBIN = $(DIRAVR)/bin
# Define programs and commands.
SHELL = sh
CC = ${DIRAVRBIN}/avr-gcc
OBJCOPY = ${DIRAVRBIN}/avr-objcopy
OBJDUMP = ${DIRAVRBIN}/avr-objdump
SIZE = ${DIRAVRBIN}/avr-size
NM = ${DIRAVRBIN}/avr-nm
AVRDUDE = avrdude
REMOVE = rm -f
COPY = cp
# Define Messages
# English
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = -------- end --------
MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_FLASH = Creating load file for Flash:
MSG_EEPROM = Creating load file for EEPROM:
MSG_EXTENDED_LISTING = Creating Extended Listing:
MSG_SYMBOL_TABLE = Creating Symbol Table:
MSG_LINKING = Linking:
MSG_COMPILING = Compiling:
MSG_ASSEMBLING = Assembling:
MSG_CLEANING = Cleaning project:
# Define all object files.
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
# Define all listing files.
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
# Compiler flags to generate dependency files.
GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,dep/$(@F).d
# Combine all necessary flags and optional flags.
# Add target processor to flags.
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target.
all: begin gccversion sizebefore build sizeafter finished end
build: elf hex eep lss sym
elf: $(TARGET).elf
hex: $(TARGET).hex
eep: $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym
# Eye candy.
# AVR Studio 3.x does not check make's exit code but relies on
# the following magic strings to be generated by the compile job.
begin:
@echo
@echo $(MSG_BEGIN)
finished:
@echo $(MSG_ERRORS_NONE)
end:
@echo $(MSG_END)
@echo
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
ELFSIZE = $(SIZE) -A $(TARGET).elf
sizebefore:
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
sizeafter:
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
# Display compiler version information.
gccversion :
@$(CC) --version
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
COFFCONVERT=$(OBJCOPY) --debugging \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000
coff: $(TARGET).elf
@echo
@echo $(MSG_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
extcoff: $(TARGET).elf
@echo
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
@echo
@echo $(MSG_FLASH) $@
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
%.eep: %.elf
@echo
@echo $(MSG_EEPROM) $@
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
# Create extended listing file from ELF output file.
%.lss: %.elf
@echo
@echo $(MSG_EXTENDED_LISTING) $@
$(OBJDUMP) -h -S $< > $@
# Create a symbol table from ELF output file.
%.sym: %.elf
@echo
@echo $(MSG_SYMBOL_TABLE) $@
$(NM) -n $< > $@
# Link: create ELF output file from object files.
.SECONDARY : $(TARGET).elf
.PRECIOUS : $(OBJ)
%.elf: $(OBJ)
@echo
@echo $(MSG_LINKING) $@
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
# Compile: create object files from C source files.
%.o : %.c
@echo
@echo $(MSG_COMPILING) $<
$(CC) -c $(ALL_CFLAGS) $< -o $@
# Compile: create assembler files from C source files.
%.s : %.c
$(CC) -S $(ALL_CFLAGS) $< -o $@
# Assemble: create object files from assembler source files.
%.o : %.S
@echo
@echo $(MSG_ASSEMBLING) $<
$(CC) -c $(ALL_ASFLAGS) $< -o $@
# Target: clean project.
clean: begin clean_list finished end
clean_list :
@echo
@echo $(MSG_CLEANING)
$(REMOVE) $(TARGET).hex
$(REMOVE) $(TARGET).eep
$(REMOVE) $(TARGET).obj
$(REMOVE) $(TARGET).cof
$(REMOVE) $(TARGET).elf
$(REMOVE) $(TARGET).map
$(REMOVE) $(TARGET).obj
$(REMOVE) $(TARGET).a90
$(REMOVE) $(TARGET).sym
$(REMOVE) $(TARGET).lnk
$(REMOVE) $(TARGET).lss
$(REMOVE) $(OBJ)
$(REMOVE) $(LST)
$(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d)
$(REMOVE) dep/*
# Include the dependency files.
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
# Listing of phony targets.
.PHONY : all begin finish end sizebefore sizeafter gccversion \
build elf hex eep lss sym coff extcoff \
clean clean_list program

View File

@ -1,38 +0,0 @@
# Arduino Makefile (for Mac OS X)
# Nick Zambetti and David A. Mellis
# $Id: makefile.osx,v 1.6 2005/05/23 17:19:56 mellis Exp $
# By default, this makefile uses the serial device specified by
# Wiring (either in the Tools | Serial Port menu or the Wiring
# preferences file in the sketchbook directory) and passed as
# an argument to make. To override this value, uncomment the
# following line and change the value to the desired device.
# SERIAL=/dev/tty.usbserial-1B1
# The Wiring Lite IDE runs the "compile" rule when you click the play button.
compile:
rm -rf tmp
mkdir tmp
cat ../core/wiringlite.inc > tmp/prog.c
cat build/*.c >> tmp/prog.c
cp ../core/* tmp/
../tools/gnumake -s -C tmp
# The IDE runs the "program" rule when you hit the export button.
# The string after the colon determines the method used to
# program the microcontroller: program-using-bootloader or
# program-with-isp.
program: program-using-bootloader
# This rule is for uploading code using a bootloader already on
# the microcontroller. It should run at the baud rate specified
# in the bootloader's code, current 9600 baud.
program-using-bootloader:
../../tools/avr/bin/uisp -dprog=stk500 -dspeed=9600 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --upload
# This rule is for uploading code using an in-system programmer,
# e.g. the one sold by Atmel. In this case, you want to erase the
# microcontroller, upload the code, and then verify it.
# Atmel's isp follows the stk500 protocol and works at 115200 baud.
program-with-isp:
../../tools/avr/bin/uisp -dprog=stk500 -dspeed=115200 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --erase --upload --verify

View File

@ -25,7 +25,7 @@ else
mkdir -p work/lib/build mkdir -p work/lib/build
mkdir -p work/examples mkdir -p work/examples
cp ../../lib/librxtxSerial.jnilib work/ cp dist/librxtxSerial.jnilib work/
cp -pR dist/drivers work/ cp -pR dist/drivers work/
# to have a copy of this guy around for messing with # to have a copy of this guy around for messing with

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -1,6 +1,6 @@
# Arduino Makefile (for Windows 2000) # Arduino Makefile (for Windows 2000)
# Nick Zambetti and David A. Mellis # Nick Zambetti and David A. Mellis
# $Id: makefile.w2k,v 1.1 2005/05/23 17:19:56 mellis Exp $ # $Id$
# Windows 2000 seems to need backslashes in certain commands # Windows 2000 seems to need backslashes in certain commands
# (e.g. bin\rm in the compile rule below) where Windows XP # (e.g. bin\rm in the compile rule below) where Windows XP

View File

@ -1,6 +1,6 @@
# Arduino Makefile (for Windows XP) # Arduino Makefile (for Windows XP)
# Nick Zambetti and David A. Mellis # Nick Zambetti and David A. Mellis
# $Id: makefile.win,v 1.9 2005/05/23 18:21:46 mellis Exp $ # $Id$
# By default, this makefile uses the serial device specified by # By default, this makefile uses the serial device specified by
# Wiring (either in the Tools | Serial Port menu or the Wiring # Wiring (either in the Tools | Serial Port menu or the Wiring

View File

@ -1 +0,0 @@
serial.jar

Binary file not shown.

View File

@ -4,7 +4,8 @@ language.
Arduino is an open source project, owned by nobody and supported by many. Arduino is an open source project, owned by nobody and supported by many.
For more information, see the website at: http://arduino.berlios.de/ For more information, see the website at: http://arduino.berlios.de/ or the
forums at arduino.berlios.de/cgi-bin/yabb/YaBB.cgi
The Team is composed of Massimo Banzi, David Cuartielles, Tom Igoe, The Team is composed of Massimo Banzi, David Cuartielles, Tom Igoe,
David Mellis and Nicholas Zambetti. David Mellis and Nicholas Zambetti.
@ -15,6 +16,19 @@ taking care of the production.
Yaniv Steiner and Giorgio Olivero have been supporting the project and are Yaniv Steiner and Giorgio Olivero have been supporting the project and are
working at using it with the Instant Soup platform. working at using it with the Instant Soup platform.
Arduino uses the GNU avr-gcc toolchain, uisp, avr-libc, avrlib, and code
from Processing and Wiring.
UPDATES
0004
Serial monitor added (click the toolbar button to turn it on or off). Baud
rate is controlled by the serial.debug_rate field in preferences.txt, defaults
to 9600.
Serial port menu now automatically refreshes when opened.
Created Xcode project for building Arduino on the Mac (doesn't yet regenerate
the grammar files or package the distribution); active target should be "App".
0003 0003
millis() now updates every millisecond instead of every second. millis() now updates every millisecond instead of every second.
Keyspan and FTDI USB drivers included with Mac and Windows distributions. Keyspan and FTDI USB drivers included with Mac and Windows distributions.

View File

@ -19,7 +19,7 @@
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA Boston, MA 02111-1307 USA
$Id: pins_arduino.c,v 1.4 2005/05/24 17:47:41 mellis Exp $ $Id$
*/ */
#include <avr/io.h> #include <avr/io.h>

View File

@ -19,7 +19,7 @@
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA Boston, MA 02111-1307 USA
$Id: pins_atmega8.c,v 1.4 2005/05/24 17:47:41 mellis Exp $ $Id$
*/ */
#include <avr/io.h> #include <avr/io.h>

View File

@ -1 +1 @@
0003 arduino 0004 arduino