Skip to content

Commit 0713231

Browse files
facchinmcmaglie
authored andcommitted
enforce single use of HID submodule
1 parent 89928b4 commit 0713231

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

libraries/Keyboard/Keyboard.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
*/
2121

22-
#if 1
22+
#if defined(_USING_HID)
23+
24+
#error "Can only attach one submodule to HID module"
25+
26+
#else
27+
28+
#define _USING_HID
2329

2430
#include "HID.h"
2531

libraries/Mouse/Mouse.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
#ifndef MOUSE_h
2323
#define MOUSE_h
2424

25-
#if 1 //defined(USBCON)
25+
#if defined(_USING_HID)
26+
27+
#error "Can only attach one submodule to HID module"
28+
29+
#else
30+
31+
#define _USING_HID
2632

2733
#include "HID.h"
2834
//================================================================================

libraries/MouseAndKeyboard/MouseAndKeyboard.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#ifndef MOUSEANDKEYBOARD_h
22

3-
#if 1 //defined(USBCON)
3+
#if defined(_USING_HID)
4+
5+
#error "Can only attach one submodule to HID module"
6+
7+
#else
8+
9+
#define _USING_HID
410

511
#include "HID.h"
612
//================================================================================

0 commit comments

Comments
 (0)