Skip to content

Commit 23c7536

Browse files
committed
Merged 1.0.2
Merge remote-tracking branch 'arduino/master' into ide-1.5.x Conflicts: app/src/processing/app/debug/AvrdudeUploader.java build/shared/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino build/shared/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino build/shared/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino build/shared/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino build/shared/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino hardware/arduino/boards.txt
2 parents d5e7d0d + 056ba5f commit 23c7536

File tree

22 files changed

+3583
-21
lines changed

22 files changed

+3583
-21
lines changed

build/linux/dist/arduino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22

3-
APPDIR="$(dirname -- $(readlink -f -- "${0}") )"
3+
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"
44

5-
cd $APPDIR
5+
cd "$APPDIR"
66

77
for LIB in \
88
java/lib/rt.jar \
@@ -19,4 +19,4 @@ export LD_LIBRARY_PATH
1919

2020
export PATH="${APPDIR}/java/bin:${PATH}"
2121

22-
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base
22+
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base "$@"
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
2+
Keyboard logout
3+
4+
This sketch demonstrates the Keyboard library.
5+
6+
When you connect pin 2 to ground, it performs a logout.
7+
It uses keyboard combinations to do this, as follows:
8+
9+
On Windows, CTRL-ALT-DEL followed by ALT-l
10+
On Ubuntu, CTRL-ALT-DEL, and ENTER
11+
On OSX, CMD-SHIFT-q
12+
13+
To wake: Spacebar.
14+
15+
Circuit:
16+
* Arduino Leonardo or Micro
17+
* wire to connect D2 to ground.
18+
19+
created 6 Mar 2012
20+
modified 27 Mar 2012
21+
by Tom Igoe
22+
23+
This example is in the public domain
24+
25+
http://www.arduino.cc/en/Tutorial/KeyboardLogout
26+
*/
27+
28+
#define OSX 0
29+
#define WINDOWS 1
30+
#define UBUNTU 2
31+
32+
// change this to match your platform:
33+
int platform = OSX;
34+
35+
void setup() {
36+
// make pin 2 an input and turn on the
37+
// pullup resistor so it goes high unless
38+
// connected to ground:
39+
pinMode(2, INPUT_PULLUP);
40+
Keyboard.begin();
41+
}
42+
43+
void loop() {
44+
while (digitalRead(2) == HIGH) {
45+
// do nothing until pin 2 goes low
46+
delay(500);
47+
}
48+
delay(1000);
49+
50+
switch (platform) {
51+
case OSX:
52+
Keyboard.press(KEY_LEFT_GUI);
53+
// Shift-Q logs out:
54+
Keyboard.press(KEY_LEFT_SHIFT);
55+
Keyboard.press('Q');
56+
delay(100);
57+
Keyboard.releaseAll();
58+
// enter:
59+
Keyboard.write(KEY_RETURN);
60+
break;
61+
case WINDOWS:
62+
// CTRL-ALT-DEL:
63+
Keyboard.press(KEY_LEFT_CTRL);
64+
Keyboard.press(KEY_LEFT_ALT);
65+
Keyboard.press(KEY_DELETE);
66+
delay(100);
67+
Keyboard.releaseAll();
68+
//ALT-s:
69+
delay(2000);
70+
Keyboard.press(KEY_LEFT_ALT);
71+
Keyboard.press('l');
72+
Keyboard.releaseAll();
73+
break;
74+
case UBUNTU:
75+
// CTRL-ALT-DEL:
76+
Keyboard.press(KEY_LEFT_CTRL);
77+
Keyboard.press(KEY_LEFT_ALT);
78+
Keyboard.press(KEY_DELETE);
79+
delay(1000);
80+
Keyboard.releaseAll();
81+
// Enter to confirm logout:
82+
Keyboard.write(KEY_RETURN);
83+
break;
84+
}
85+
86+
// do nothing:
87+
while(true);
88+
}
89+
90+
91+
92+
93+
94+
95+
96+

build/shared/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Keyboard Button test
33
4-
For Leonardo and Due boards only.
4+
For the Arduino Leonardo, Micro and Due boards.
55
66
Sends a text string when a button is pressed.
77

build/shared/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
a final key combination (CTRL-U).
1414
1515
Circuit:
16-
* Arduino Leonardo or Arduino Due
16+
* Arduino Leonardo, Micro or Due
1717
* wire to connect D2 to ground.
1818
1919
created 5 Mar 2012

build/shared/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Keyboard test
33
4-
For Leonardo and Due boards only
4+
For the Arduino Leonardo, Micro or Due
55
66
Reads a byte from the serial port, sends a keystroke back.
77
The sent keystroke is one higher than what's received, e.g.
@@ -14,14 +14,14 @@
1414
modified 27 Mar 2012
1515
by Tom Igoe
1616
17-
This example code is in the public domain.
17+
This example code is in the public domain.
1818
1919
http://www.arduino.cc/en/Tutorial/KeyboardSerial
2020
*/
2121

2222
void setup() {
2323
// open the serial port:
24-
Serial.begin(9600);
24+
Serial.begin(9600);
2525
// initialize control over the keyboard:
2626
Keyboard.begin();
2727
}

build/shared/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
/*
33
KeyboardAndMouseControl
44
5-
For Leonardo and Due boards only.
6-
7-
Controls the mouse from five pushbuttons on an Arduino Leonardo.
5+
Controls the mouse from five pushbuttons on an Arduino Leonardo, Micro or Due.
86
97
Hardware:
108
* 5 pushbuttons attached to D2, D3, D4, D5, D6
119
12-
1310
The mouse movement is always relative. This sketch reads
1411
four pushbuttons, and uses them to set the movement of the mouse.
1512

build/shared/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
For Leonardo and Due boards only.
66
7-
Controls the mouse from five pushbuttons on an Arduino Leonardo or Due.
7+
Controls the mouse from five pushbuttons on an Arduino Leonardo, Micro or Due.
88
99
Hardware:
1010
* 5 pushbuttons attached to D2, D3, D4, D5, D6

build/shared/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*
22
JoystickMouseControl
33
4-
For Leonardo and Due boards only.
5-
6-
Controls the mouse from a joystick on an Arduino Leonardo or Due.
4+
Controls the mouse from a joystick on an Arduino Leonardo, Micro or Due.
75
Uses a pushbutton to turn on and off mouse control, and
86
a second pushbutton to click the left mouse button
97

build/windows/dist/drivers/Arduino Micro.inf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ ServiceBinary=%12%\%DRIVERFILENAME%.sys
8686
[SourceDisksFiles]
8787
[SourceDisksNames]
8888
[DeviceList]
89-
%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_0035&MI_00
89+
%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_0037
90+
%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_8037&MI_00
9091

9192
[DeviceList.NTamd64]
92-
%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_0035&MI_00
93-
93+
%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_0037
94+
%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_8037&MI_00
9495

9596
;------------------------------------------------------------------------------
9697
; String Definitions
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
;************************************************************
2+
; Windows USB CDC ACM Setup File
3+
; Copyright (c) 2000 Microsoft Corporation
4+
5+
6+
[Version]
7+
Signature="$Windows NT$"
8+
Class=Ports
9+
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
10+
Provider=%MFGNAME%
11+
LayoutFile=layout.inf
12+
CatalogFile=%MFGFILENAME%.cat
13+
DriverVer=11/15/2007,5.1.2600.0
14+
15+
[Manufacturer]
16+
%MFGNAME%=DeviceList, NTamd64
17+
18+
[DestinationDirs]
19+
DefaultDestDir=12
20+
21+
22+
;------------------------------------------------------------------------------
23+
; Windows 2000/XP/Vista-32bit Sections
24+
;------------------------------------------------------------------------------
25+
26+
[DriverInstall.nt]
27+
include=mdmcpq.inf
28+
CopyFiles=DriverCopyFiles.nt
29+
AddReg=DriverInstall.nt.AddReg
30+
31+
[DriverCopyFiles.nt]
32+
usbser.sys,,,0x20
33+
34+
[DriverInstall.nt.AddReg]
35+
HKR,,DevLoader,,*ntkern
36+
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
37+
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
38+
39+
[DriverInstall.nt.Services]
40+
AddService=usbser, 0x00000002, DriverService.nt
41+
42+
[DriverService.nt]
43+
DisplayName=%SERVICE%
44+
ServiceType=1
45+
StartType=3
46+
ErrorControl=1
47+
ServiceBinary=%12%\%DRIVERFILENAME%.sys
48+
49+
;------------------------------------------------------------------------------
50+
; Vista-64bit Sections
51+
;------------------------------------------------------------------------------
52+
53+
[DriverInstall.NTamd64]
54+
include=mdmcpq.inf
55+
CopyFiles=DriverCopyFiles.NTamd64
56+
AddReg=DriverInstall.NTamd64.AddReg
57+
58+
[DriverCopyFiles.NTamd64]
59+
%DRIVERFILENAME%.sys,,,0x20
60+
61+
[DriverInstall.NTamd64.AddReg]
62+
HKR,,DevLoader,,*ntkern
63+
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
64+
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
65+
66+
[DriverInstall.NTamd64.Services]
67+
AddService=usbser, 0x00000002, DriverService.NTamd64
68+
69+
[DriverService.NTamd64]
70+
DisplayName=%SERVICE%
71+
ServiceType=1
72+
StartType=3
73+
ErrorControl=1
74+
ServiceBinary=%12%\%DRIVERFILENAME%.sys
75+
76+
77+
;------------------------------------------------------------------------------
78+
; Vendor and Product ID Definitions
79+
;------------------------------------------------------------------------------
80+
; When developing your USB device, the VID and PID used in the PC side
81+
; application program and the firmware on the microcontroller must match.
82+
; Modify the below line to use your VID and PID. Use the format as shown below.
83+
; Note: One INF file can be used for multiple devices with different VID and PIDs.
84+
; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
85+
;------------------------------------------------------------------------------
86+
[SourceDisksFiles]
87+
[SourceDisksNames]
88+
[DeviceList]
89+
%DESCRIPTION%=DriverInstall, USB\VID_1B4F&PID_9207
90+
%DESCRIPTION%=DriverInstall, USB\VID_1B4F&PID_9208&MI_00
91+
92+
[DeviceList.NTamd64]
93+
%DESCRIPTION%=DriverInstall, USB\VID_1B4F&PID_9207
94+
%DESCRIPTION%=DriverInstall, USB\VID_1B4F&PID_9208&MI_00
95+
96+
;------------------------------------------------------------------------------
97+
; String Definitions
98+
;------------------------------------------------------------------------------
99+
;Modify these strings to customize your device
100+
;------------------------------------------------------------------------------
101+
[Strings]
102+
MFGFILENAME="CDC_vista"
103+
DRIVERFILENAME ="usbser"
104+
MFGNAME="SparkFun Electronics"
105+
INSTDISK="SparkFun LilyPadUSB Driver Installer"
106+
DESCRIPTION="SparkFun LilyPadUSB"
107+
SERVICE="USB RS-232 Emulation Driver"

hardware/arduino/avr/boards.txt

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,34 @@ menu.cpu.bt.atmega168.build.mcu=atmega168
301301

302302
##############################################################
303303

304+
LilyPadUSB.name=LilyPad Arduino USB
305+
306+
LilyPadUSB.upload.tool=avrdude
307+
LilyPadUSB.upload.protocol=avr109
308+
LilyPadUSB.upload.maximum_size=28672
309+
LilyPadUSB.upload.speed=57600
310+
LilyPadUSB.upload.disable_flushing=true
311+
LilyPadUSB.upload.use_1200bps_touch=true
312+
LilyPadUSB.upload.wait_for_upload_port=true
313+
314+
LilyPadUSB.bootloader.tool=avrdude
315+
LilyPadUSB.bootloader.low_fuses=0xff
316+
LilyPadUSB.bootloader.high_fuses=0xd8
317+
LilyPadUSB.bootloader.extended_fuses=0xce
318+
LilyPadUSB.bootloader.file=caterina-LilyPadUSB/ Caterina-LilyPadUSB.hex
319+
LilyPadUSB.bootloader.unlock_bits=0x3F
320+
LilyPadUSB.bootloader.lock_bits=0x2F
321+
322+
LilyPadUSB.build.mcu=atmega32u4
323+
LilyPadUSB.build.f_cpu=8000000L
324+
LilyPadUSB.build.vid=0x1B4F
325+
LilyPadUSB.build.pid=0x9208
326+
LilyPadUSB.build.core=arduino
327+
LilyPadUSB.build.variant=leonardo
328+
LilyPadUSB.build.extra_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid}
329+
330+
##############################################################
331+
304332
lilypad.name=LilyPad Arduino
305333

306334
lilypad.upload.tool=avrdude
@@ -448,4 +476,4 @@ menu.cpu.atmegang.atmega8.bootloader.low_fuses=0xdf
448476
menu.cpu.atmegang.atmega8.bootloader.high_fuses=0xca
449477
menu.cpu.atmegang.atmega8.bootloader.file=atmegang/ATmegaBOOT.hex
450478

451-
menu.cpu.atmegang.atmega8.build.mcu=atmega8
479+
menu.cpu.atmegang.atmega8.build.mcu=atmega8

0 commit comments

Comments
 (0)