aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/USB/LowLevel/Pipe.h
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2009-06-16 07:17:22 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2009-06-16 07:17:22 +0000
commit6468ce7acd6095f8019630e65799cf7bf0cc07be (patch)
tree27d6d4cb5aaeecf0dcc5841c4af83d88096c054a /LUFA/Drivers/USB/LowLevel/Pipe.h
parent2e09feff05ce44a1ed9df610c2ea04088322c6dd (diff)
Pipe_GetErrorFlags() now returns additional error flags for overflow and underflow errors.
Change MIDI demos to use real MIDI command values, and shift for the USB wrapper, rather than shift for the MIDI bytes. This is a little confusing for the MIDI USB wrapper, but allows for the use of real standardized MIDI command values. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@605 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel/Pipe.h')
-rw-r--r--LUFA/Drivers/USB/LowLevel/Pipe.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h
index f3da9d1c..62cbe65a 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.h
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.h
@@ -77,6 +77,12 @@
/* Public Interface - May be used in end-application: */
/* Macros: */
+ /** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */
+ #define PIPE_ERRORFLAG_OVERFLOW (1 << 6)
+
+ /** Mask for \ref Pipe_GetErrorFlags(), indicating that an underflow error occurred in the pipe on the received data. */
+ #define PIPE_ERRORFLAG_UNDERFLOW (1 << 5)
+
/** Mask for \ref Pipe_GetErrorFlags(), indicating that a CRC error occurred in the pipe on the received data. */
#define PIPE_ERRORFLAG_CRC16 (1 << 4)
@@ -426,7 +432,10 @@
#define Pipe_ClearErrorFlags() MACROS{ UPERRX = 0; }MACROE
- #define Pipe_GetErrorFlags() UPERRX
+ #define Pipe_GetErrorFlags() ((UPERRX & (PIPE_ERRORFLAG_CRC16 | PIPE_ERRORFLAG_TIMEOUT | \
+ PIPE_ERRORFLAG_PID | PIPE_ERRORFLAG_DATAPID | \
+ PIPE_ERRORFLAG_DATATGL)) | \
+ (UPSTAX & PIPE_ERRORFLAG_OVERFLOW | PIPE_ERRORFLAG_UNDERFLOW))
#define Pipe_IsReadWriteAllowed() ((UPINTX & (1 << RWAL)) ? true : false)