aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/LowLevel
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-09-20 12:01:25 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-09-20 12:01:25 +0000
commit51566d1a811f43dc39f38cb597de44ba9363d974 (patch)
tree9dc1b20907accffd98fecec2f0e034331fa41b2d /LUFA/Drivers/USB/LowLevel
parentcd0adb7574525978f50eabd536f7563f2d9f9aa7 (diff)
downloadlufa-51566d1a811f43dc39f38cb597de44ba9363d974.tar.gz
lufa-51566d1a811f43dc39f38cb597de44ba9363d974.tar.bz2
lufa-51566d1a811f43dc39f38cb597de44ba9363d974.zip
Added new Pipe_IsFrozen() macro to determine if the currently selected pipe is frozen.
Added new USB_GetHIDReportSize() function to the HID report parser to retrieve the size of a given report by its ID. More additions to the unfinished HID Host Class Driver.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel')
-rw-r--r--LUFA/Drivers/USB/LowLevel/Pipe.c2
-rw-r--r--LUFA/Drivers/USB/LowLevel/Pipe.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c
index 9c6a53e78..58d7343b0 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.c
@@ -93,7 +93,7 @@ uint8_t Pipe_WaitUntilReady(void)
#else
uint16_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
#endif
-
+
for (;;)
{
if (Pipe_GetPipeToken() == PIPE_TOKEN_IN)
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h
index 294545804..fd01b5c58 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.h
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.h
@@ -292,6 +292,12 @@
/** Freezes the selected pipe, preventing it from communicating with an attached device. */
static inline void Pipe_Freeze(void);
+ /** Determines if the currently selected pipe is frozen, and not able to accept data.
+ *
+ * \return Boolean true if the currently selected pipe is frozen, false otherwise
+ */
+ static inline bool Pipe_IsFrozen(void);
+
/** Clears the master pipe error flag. */
static inline void Pipe_ClearError(void);
@@ -445,6 +451,8 @@
#define Pipe_Unfreeze() MACROS{ UPCONX &= ~(1 << PFREEZE); }MACROE
#define Pipe_Freeze() MACROS{ UPCONX |= (1 << PFREEZE); }MACROE
+
+ #define Pipe_IsFrozen() ((UPCONX & (1 << PFREEZE)) ? true : false)
#define Pipe_ClearError() MACROS{ UPINTX &= ~(1 << PERRI); }MACROE