From 60bd43e0a1cd536b16ef47b07e527a26b2d33ac0 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Sat, 19 Sep 2015 17:28:36 +0200 Subject: [PATCH] added bool operator --- src/PluggableHID/HID.cpp | 10 ++++++++++ src/PluggableHID/HID.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/PluggableHID/HID.cpp b/src/PluggableHID/HID.cpp index 17fa0b0..1e6f196 100644 --- a/src/PluggableHID/HID.cpp +++ b/src/PluggableHID/HID.cpp @@ -210,6 +210,16 @@ HID_::HID_(void) HID_ENDPOINT_INT = PUSB_AddFunction(&node, &HID_INTERFACE); } +HID_::operator bool() { + if(USBDevice.configured()){ + delay(10); + return true; + } + else{ + return false; + } +} + int HID_::begin(void) { } diff --git a/src/PluggableHID/HID.h b/src/PluggableHID/HID.h index e53a4df..5562f9e 100644 --- a/src/PluggableHID/HID.h +++ b/src/PluggableHID/HID.h @@ -70,6 +70,7 @@ class HID_ { public: HID_(void); + operator bool(); // Only access this class via the HIDDevice private: