Add checks for Adafruit TinyUSB to USB libs (#2319)
The included USB libraries are not compatible with Adafruit TinyUSB, so add a #error message when they're built with the define set.
This commit is contained in:
parent
4bd7d99c96
commit
28b0edac21
6 changed files with 30 additions and 18 deletions
|
|
@ -19,6 +19,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef USE_TINYUSB
|
||||||
|
#error FatFSUSB is not compatible with Adafruit TinyUSB
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
class FatFSUSBClass {
|
class FatFSUSBClass {
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,14 @@
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _JOYSTICK_h
|
#pragma once
|
||||||
#define _JOYSTICK_h
|
|
||||||
|
#ifdef USE_TINYUSB
|
||||||
|
#error Joystick is not compatible with Adafruit TinyUSB
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <HID_Joystick.h>
|
#include <HID_Joystick.h>
|
||||||
#include "class/hid/hid.h"
|
#include <class/hid/hid.h>
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
class Joystick_ : public HID_Joystick {
|
class Joystick_ : public HID_Joystick {
|
||||||
|
|
@ -31,5 +34,3 @@ public:
|
||||||
virtual void send_now(void) override;
|
virtual void send_now(void) override;
|
||||||
};
|
};
|
||||||
extern Joystick_ Joystick;
|
extern Joystick_ Joystick;
|
||||||
|
|
||||||
#endif /* _JOYSTICK_h */
|
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,11 @@
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef KEYBOARD_h
|
#pragma once
|
||||||
#define KEYBOARD_h
|
|
||||||
|
#ifdef USE_TINYUSB
|
||||||
|
#error Keyboard is not compatible with Adafruit TinyUSB
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <HID_Keyboard.h>
|
#include <HID_Keyboard.h>
|
||||||
|
|
||||||
|
|
@ -34,5 +37,3 @@ public:
|
||||||
Keyboard_(void);
|
Keyboard_(void);
|
||||||
};
|
};
|
||||||
extern Keyboard_ Keyboard;
|
extern Keyboard_ Keyboard;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,11 @@
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MOUSE_h
|
#pragma once
|
||||||
#define MOUSE_h
|
|
||||||
|
#ifdef USE_TINYUSB
|
||||||
|
#error Mouse is not compatible with Adafruit TinyUSB
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <HID_Mouse.h>
|
#include <HID_Mouse.h>
|
||||||
|
|
||||||
|
|
@ -30,5 +33,3 @@ public:
|
||||||
virtual void move(int x, int y, signed char wheel = 0) override;
|
virtual void move(int x, int y, signed char wheel = 0) override;
|
||||||
};
|
};
|
||||||
extern Mouse_ Mouse;
|
extern Mouse_ Mouse;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Mouse.h
|
MouseAbsolute.h
|
||||||
|
|
||||||
Copyright (c) 2015, Arduino LLC
|
Copyright (c) 2015, Arduino LLC
|
||||||
Original code (pre-library): Copyright (c) 2011, Peter Barrett
|
Original code (pre-library): Copyright (c) 2011, Peter Barrett
|
||||||
|
|
@ -19,8 +19,11 @@
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MOUSEABSOLUTE_h
|
#pragma once
|
||||||
#define MOUSEABSOLUTE_h
|
|
||||||
|
#ifdef USE_TINYUSB
|
||||||
|
#error MouseAbsolute is not compatible with Adafruit TinyUSB
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <HID_Mouse.h>
|
#include <HID_Mouse.h>
|
||||||
|
|
||||||
|
|
@ -30,5 +33,3 @@ public:
|
||||||
virtual void move(int x, int y, signed char wheel = 0) override;
|
virtual void move(int x, int y, signed char wheel = 0) override;
|
||||||
};
|
};
|
||||||
extern MouseAbsolute_ MouseAbsolute;
|
extern MouseAbsolute_ MouseAbsolute;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef USE_TINYUSB
|
||||||
|
#error SingleFileDrive is not compatible with Adafruit TinyUSB
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
class SingleFileDrive {
|
class SingleFileDrive {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue