aboutsummaryrefslogtreecommitdiff
path: root/cores
diff options
context:
space:
mode:
Diffstat (limited to 'cores')
-rw-r--r--cores/arduino/USBAPI.h2
-rw-r--r--cores/arduino/USBCore.cpp6
-rw-r--r--cores/arduino/WInterrupts.c14
3 files changed, 8 insertions, 14 deletions
diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h
index 479ced9..701a14f 100644
--- a/cores/arduino/USBAPI.h
+++ b/cores/arduino/USBAPI.h
@@ -65,6 +65,8 @@ public:
void detach(); // Serial port goes down too...
void poll();
bool wakeupHost(); // returns false, when wakeup cannot be processed
+
+ bool isSuspended();
};
extern USBDevice_ USBDevice;
diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp
index 81f689d..c0a4c7c 100644
--- a/cores/arduino/USBCore.cpp
+++ b/cores/arduino/USBCore.cpp
@@ -855,4 +855,10 @@ bool USBDevice_::wakeupHost()
return false;
}
+bool USBDevice_::isSuspended()
+{
+ return (_usbSuspendState & (1 << SUSPI));
+}
+
+
#endif /* if defined(USBCON) */
diff --git a/cores/arduino/WInterrupts.c b/cores/arduino/WInterrupts.c
index cef1106..ac72dda 100644
--- a/cores/arduino/WInterrupts.c
+++ b/cores/arduino/WInterrupts.c
@@ -65,7 +65,6 @@ static volatile voidFuncPtr intFunc[EXTERNAL_NUM_INTERRUPTS] = {
nothing,
#endif
};
-// volatile static voidFuncPtr twiIntFunc;
void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
if(interruptNum < EXTERNAL_NUM_INTERRUPTS) {
@@ -274,11 +273,6 @@ void detachInterrupt(uint8_t interruptNum) {
}
}
-/*
-void attachInterruptTwi(void (*userFunc)(void) ) {
- twiIntFunc = userFunc;
-}
-*/
#define IMPLEMENT_ISR(vect, interrupt) \
ISR(vect) { \
@@ -314,11 +308,3 @@ IMPLEMENT_ISR(INT2_vect, EXTERNAL_INT_2)
#endif
#endif
-
-/*
-ISR(TWI_vect) {
- if(twiIntFunc)
- twiIntFunc();
-}
-*/
-