Skip to content

Commit 7216441

Browse files
committed
Merge pull request MHeironimus#7 from MHeironimus/add-ide-checking
Added additional compiler directives to check for the proper version of the Arduino IDE and compatible device.
2 parents c839fc1 + 52651e5 commit 7216441

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

Joystick/Joystick.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323

2424
#include "HID.h"
2525

26+
#if ARDUINO < 10606
27+
#error The Joystick library requires Arduino IDE 1.6.6 or greater. Please update your IDE.
28+
#endif
29+
30+
#if !defined(USBCON)
31+
#error The Joystick library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).
32+
#endif
33+
2634
#if !defined(_USING_HID)
2735

2836
#warning "Using legacy HID core (non pluggable)"

Joystick2/Joystick2.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323

2424
#include "HID.h"
2525

26+
#if ARDUINO < 10606
27+
#error The Joystick2 library requires Arduino IDE 1.6.6 or greater. Please update your IDE.
28+
#endif
29+
30+
#if !defined(USBCON)
31+
#error The Joystick2 library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).
32+
#endif
33+
2634
#if !defined(_USING_HID)
2735

2836
#warning "Using legacy HID core (non pluggable)"

Joystick3/Joystick3.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323

2424
#include "HID.h"
2525

26+
#if ARDUINO < 10606
27+
#error The Joystick3 library requires Arduino IDE 1.6.6 or greater. Please update your IDE.
28+
#endif
29+
30+
#if !defined(USBCON)
31+
#error The Joystick3 library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).
32+
#endif
33+
2634
#if !defined(_USING_HID)
2735

2836
#warning "Using legacy HID core (non pluggable)"

0 commit comments

Comments
 (0)