From 24916baf70d7c4ff71125defdb7b8160b7b017ed Mon Sep 17 00:00:00 2001 From: David Mellis Date: Sun, 11 Mar 2012 13:50:47 -0400 Subject: [PATCH 1/7] Don't insert newline in serial monitor keyboard shortcut (Lars J. Nielsen) http://code.google.com/p/arduino/issues/detail?id=279 --- app/src/processing/app/EditorListener.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/processing/app/EditorListener.java b/app/src/processing/app/EditorListener.java index 58c3fc9a1..12806b4ce 100644 --- a/app/src/processing/app/EditorListener.java +++ b/app/src/processing/app/EditorListener.java @@ -122,6 +122,14 @@ public class EditorListener { } } + if ((event.getModifiers() & KeyEvent.CTRL_MASK) != 0) { + // Consume ctrl-m(carriage return) keypresses + if (code == KeyEvent.VK_M) { + event.consume(); // does nothing + return false; + } + } + if ((event.getModifiers() & KeyEvent.META_MASK) != 0) { //event.consume(); // does nothing return false; From 155906637917a6aa60a634e60f4e85055909e0a8 Mon Sep 17 00:00:00 2001 From: David Mellis Date: Sun, 11 Mar 2012 14:01:13 -0400 Subject: [PATCH 2/7] Adding .inf file for USB-serial convertor. --- .../dist/drivers/Arduino USBSerial.inf | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 build/windows/dist/drivers/Arduino USBSerial.inf diff --git a/build/windows/dist/drivers/Arduino USBSerial.inf b/build/windows/dist/drivers/Arduino USBSerial.inf new file mode 100644 index 000000000..f8553fbb9 --- /dev/null +++ b/build/windows/dist/drivers/Arduino USBSerial.inf @@ -0,0 +1,106 @@ +;************************************************************ +; Windows USB CDC ACM Setup File +; Copyright (c) 2000 Microsoft Corporation + + +[Version] +Signature="$Windows NT$" +Class=Ports +ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} +Provider=%MFGNAME% +LayoutFile=layout.inf +CatalogFile=%MFGFILENAME%.cat +DriverVer=11/15/2007,5.1.2600.0 + +[Manufacturer] +%MFGNAME%=DeviceList, NTamd64 + +[DestinationDirs] +DefaultDestDir=12 + + +;------------------------------------------------------------------------------ +; Windows 2000/XP/Vista-32bit Sections +;------------------------------------------------------------------------------ + +[DriverInstall.nt] +include=mdmcpq.inf +CopyFiles=DriverCopyFiles.nt +AddReg=DriverInstall.nt.AddReg + +[DriverCopyFiles.nt] +usbser.sys,,,0x20 + +[DriverInstall.nt.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,%DRIVERFILENAME%.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.nt.Services] +AddService=usbser, 0x00000002, DriverService.nt + +[DriverService.nt] +DisplayName=%SERVICE% +ServiceType=1 +StartType=3 +ErrorControl=1 +ServiceBinary=%12%\%DRIVERFILENAME%.sys + +;------------------------------------------------------------------------------ +; Vista-64bit Sections +;------------------------------------------------------------------------------ + +[DriverInstall.NTamd64] +include=mdmcpq.inf +CopyFiles=DriverCopyFiles.NTamd64 +AddReg=DriverInstall.NTamd64.AddReg + +[DriverCopyFiles.NTamd64] +%DRIVERFILENAME%.sys,,,0x20 + +[DriverInstall.NTamd64.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,%DRIVERFILENAME%.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.NTamd64.Services] +AddService=usbser, 0x00000002, DriverService.NTamd64 + +[DriverService.NTamd64] +DisplayName=%SERVICE% +ServiceType=1 +StartType=3 +ErrorControl=1 +ServiceBinary=%12%\%DRIVERFILENAME%.sys + + +;------------------------------------------------------------------------------ +; Vendor and Product ID Definitions +;------------------------------------------------------------------------------ +; When developing your USB device, the VID and PID used in the PC side +; application program and the firmware on the microcontroller must match. +; Modify the below line to use your VID and PID. Use the format as shown below. +; Note: One INF file can be used for multiple devices with different VID and PIDs. +; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. +;------------------------------------------------------------------------------ +[SourceDisksFiles] +[SourceDisksNames] +[DeviceList] +%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_003B + +[DeviceList.NTamd64] +%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_003B + + +;------------------------------------------------------------------------------ +; String Definitions +;------------------------------------------------------------------------------ +;Modify these strings to customize your device +;------------------------------------------------------------------------------ +[Strings] +MFGFILENAME="CDC_vista" +DRIVERFILENAME ="usbser" +MFGNAME="Arduino LLC (www.arduino.cc)" +INSTDISK="Arduino USBSerial Driver Installer" +DESCRIPTION="Arduino UNO" +SERVICE="USB RS-232 Emulation Driver" \ No newline at end of file From 04c9bb2f4d3cd840b360363e7185f7ef426ac2b4 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sun, 11 Mar 2012 14:25:35 -0400 Subject: [PATCH 3/7] Adding const to keywords.txt. http://code.google.com/p/arduino/issues/detail?id=137 --- build/shared/lib/keywords.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/build/shared/lib/keywords.txt b/build/shared/lib/keywords.txt index 74fb064e5..eb3bd4b09 100644 --- a/build/shared/lib/keywords.txt +++ b/build/shared/lib/keywords.txt @@ -31,6 +31,7 @@ byte KEYWORD1 Byte case KEYWORD1 SwitchCase char KEYWORD1 Char class KEYWORD1 +const KEYWORD1 Const continue KEYWORD1 Continue default KEYWORD1 SwitchCase do KEYWORD1 DoWhile From f1f2f8e49ca4dd5493f7d0b377697f2f3d1c6812 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sun, 11 Mar 2012 15:05:44 -0400 Subject: [PATCH 4/7] Lowering minimum size for Editor text area. This should make it possible to shrink the overall IDE window without losing the scroll bars on the text pane. http://code.google.com/p/arduino/issues/detail?id=52 --- app/src/processing/app/syntax/TextAreaPainter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/syntax/TextAreaPainter.java b/app/src/processing/app/syntax/TextAreaPainter.java index cc93aeded..e99329526 100644 --- a/app/src/processing/app/syntax/TextAreaPainter.java +++ b/app/src/processing/app/syntax/TextAreaPainter.java @@ -515,7 +515,10 @@ implements TabExpander, Printable */ public Dimension getMinimumSize() { - return getPreferredSize(); + Dimension dim = new Dimension(); + dim.width = fm.charWidth('w') * 10; + dim.height = fm.getHeight() * 4; + return dim; } // package-private members From 8cd670bee3b8b6388fe005b2f3974a6840948749 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sun, 11 Mar 2012 15:33:16 -0400 Subject: [PATCH 5/7] Avoid intermediate file when unzipping 32-bit Linux AVR toolchain. http://code.google.com/p/arduino/issues/detail?id=841 --- build/build.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/build.xml b/build/build.xml index bfee8f6d1..6125fff6d 100644 --- a/build/build.xml +++ b/build/build.xml @@ -354,10 +354,9 @@ - - - + + From 34d7925f2736bd0cf7ee8142268040b48b5bc8cb Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 29 Feb 2012 16:43:01 -0500 Subject: [PATCH 6/7] Eliminating temporary file when unzipping 64-bit Linux AVR toolchain. http://code.google.com/p/arduino/issues/detail?id=841 --- build/build.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/build.xml b/build/build.xml index 6125fff6d..245a9a37a 100644 --- a/build/build.xml +++ b/build/build.xml @@ -367,10 +367,9 @@ - - - + + From 7f11df115d37dc869d03a5e8c2c5a54a5e23a977 Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Mon, 12 Mar 2012 15:30:12 -0400 Subject: [PATCH 7/7] Updated ChatServer --- .../examples/ChatServer/ChatServer.ino | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/libraries/Ethernet/examples/ChatServer/ChatServer.ino b/libraries/Ethernet/examples/ChatServer/ChatServer.ino index 9f819fd5a..de7525769 100644 --- a/libraries/Ethernet/examples/ChatServer/ChatServer.ino +++ b/libraries/Ethernet/examples/ChatServer/ChatServer.ino @@ -12,7 +12,7 @@ created 18 Dec 2009 by David A. Mellis - modified 10 August 2010 + modified 12 March 2012 by Tom Igoe */ @@ -23,14 +23,16 @@ // Enter a MAC address and IP address for your controller below. // The IP address will be dependent on your local network. // gateway and subnet are optional: -byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; +byte mac[] = { + 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; IPAddress ip(192,168,1, 177); IPAddress gateway(192,168,1, 1); IPAddress subnet(255, 255, 0, 0); + // telnet defaults to port 23 EthernetServer server(23); -boolean gotAMessage = false; // whether or not you got a message from the client yet +boolean alreadyConnected = false; // whether or not the client was connected previously void setup() { // initialize the ethernet device @@ -39,25 +41,34 @@ void setup() { server.begin(); // open the serial port Serial.begin(9600); + Serial.print("Chat server address:"); + Serial.println(Ethernet.localIP()); } void loop() { // wait for a new client: EthernetClient client = server.available(); - + // when the client sends the first byte, say hello: if (client) { - if (!gotAMessage) { + if (!alreadyConnected) { + // clead out the input buffer: + client.flush(); Serial.println("We have a new client"); client.println("Hello, client!"); - gotAMessage = true; + alreadyConnected = true; + } + + if (client.available() > 0) { + // read the bytes incoming from the client: + char thisChar = client.read(); + // echo the bytes back to the client: + server.write(thisChar); + // echo the bytes to the server as well: + Serial.write(thisChar); } - - // read the bytes incoming from the client: - char thisChar = client.read(); - // echo the bytes back to the client: - server.write(thisChar); - // echo the bytes to the server as well: - Serial.print(thisChar); } } + + +