Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit af290fc

Browse files
facchinmcmaglie
authored andcommitted
rework HID-based libraries and add Due fallback
1 parent 9981435 commit af290fc

File tree

15 files changed

+162
-17
lines changed

15 files changed

+162
-17
lines changed

‎hardware/arduino/avr/libraries/HID/HID.cpp‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
#if defined(USBCON)
2323

24-
//#define RAWHID_ENABLED
25-
2624
HID_ HID;
2725

2826
static u8 HID_ENDPOINT_INT;

‎hardware/arduino/avr/libraries/HID/HID.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#if defined(USBCON)
2929

30+
#define _USING_HID
31+
3032
//================================================================================
3133
//================================================================================
3234
// HID 'Driver'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#######################################
2+
# Syntax Coloring Map HID
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
HID KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
begin KEYWORD2
15+
SendReport KEYWORD2
16+
AppendDescriptor KEYWORD2
17+
18+
#######################################
19+
# Constants (LITERAL1)
20+
#######################################
21+
HID_TX LITERAL1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name=HID
2+
version=1.0
3+
author=Arduino
4+
maintainer=Arduino <info@arduino.cc>
5+
sentence=Module for PluggableUSB infrastructure. Exposes an API for devices like Keyboards, Mice and Gamepads
6+
paragraph=
7+
url=http://www.arduino.cc/en/Reference/HID
8+
architectures=avr
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// HID.h
2+
3+
// placeholder waiting for HID library to be DUE compatible

‎libraries/Keyboard/README.adoc‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
= Keyboard Library for Arduino =
2+
3+
This library allows an Arduino board with USB capabilites to act as a Keyboard.
4+
Being based on HID library you need to include "HID.h" in your sketch.
5+
6+
For more information about this library please visit us at
7+
http://www.arduino.cc/en/Reference/Keyboard
8+
9+
== License ==
10+
11+
Copyright (c) Arduino LLC. All right reserved.
12+
13+
This library is free software; you can redistribute it and/or
14+
modify it under the terms of the GNU Lesser General Public
15+
License as published by the Free Software Foundation; either
16+
version 2.1 of the License, or (at your option) any later version.
17+
18+
This library is distributed in the hope that it will be useful,
19+
but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21+
Lesser General Public License for more details.
22+
23+
You should have received a copy of the GNU Lesser General Public
24+
License along with this library; if not, write to the Free Software
25+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

‎libraries/Keyboard/keywords.txt‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#######################################
2+
# Syntax Coloring Map For Keyboard
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
Keyboard KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
15+
begin KEYWORD2
16+
write KEYWORD2
17+
press KEYWORD2
18+
release KEYWORD2
19+
releaseAll KEYWORD2
20+
21+
#######################################
22+
# Constants (LITERAL1)
23+
#######################################
24+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=Keyboard
2+
version=1.0.0
3+
author=Arduino
4+
maintainer=Arduino <info@arduino.cc>
5+
sentence=Allows an Arduino board with USB capabilites to act as a Keyboard. For Leonardo/Micro only
6+
paragraph=This library plugs on the HID library. It can be used with or without other HID-based libraries (Mouse, Gamepad etc)
7+
category=USB
8+
url=http://www.arduino.cc/en/Reference/Keyboard
9+
architectures=*

‎libraries/Keyboard/Keyboard.cpp‎ renamed to ‎libraries/Keyboard/src/Keyboard.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
*/
2121

22-
#if 1
23-
2422
#include "Keyboard.h"
2523

24+
#if defined(_USING_HID)
25+
2626
//================================================================================
2727
//================================================================================
2828
// Keyboard

‎libraries/Keyboard/Keyboard.h‎ renamed to ‎libraries/Keyboard/src/Keyboard.h‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@
2222
#ifndef KEYBOARD_h
2323
#define KEYBOARD_h
2424

25-
#if 0 //defined(_USING_HID)
26-
27-
#error "Can only attach one submodule to HID module"
25+
#include "HID.h"
2826

29-
#else
27+
#if !defined(_USING_HID)
3028

31-
#define_USING_HID
29+
#warning "Using legacy HID core (non pluggable)"
3230

33-
#include"HID.h"
31+
#else
3432

3533
//================================================================================
3634
//================================================================================

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /