Fix spelling of the MissileLauncher project directory.
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Pipe.h
index f3da9d1..82d9b69 100644 (file)
 \r
        /* Public Interface - May be used in end-application: */\r
                /* Macros: */\r
 \r
        /* Public Interface - May be used in end-application: */\r
                /* Macros: */\r
+                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */\r
+                       #define PIPE_ERRORFLAG_OVERFLOW         (1 << 6)\r
+\r
+                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that an underflow error occurred in the pipe on the received data. */\r
+                       #define PIPE_ERRORFLAG_UNDERFLOW        (1 << 5)\r
+\r
                        /** Mask for \ref Pipe_GetErrorFlags(), indicating that a CRC error occurred in the pipe on the received data. */\r
                        #define PIPE_ERRORFLAG_CRC16            (1 << 4)\r
 \r
                        /** Mask for \ref Pipe_GetErrorFlags(), indicating that a CRC error occurred in the pipe on the received data. */\r
                        #define PIPE_ERRORFLAG_CRC16            (1 << 4)\r
 \r
                                 *\r
                                 *  \return The current pipe token, as a PIPE_TOKEN_* mask\r
                                 */\r
                                 *\r
                                 *  \return The current pipe token, as a PIPE_TOKEN_* mask\r
                                 */\r
-                               static inline uint8_t Pipe_GetCurrentToken(void);\r
+                               static inline uint8_t Pipe_GetPipeToken(void);\r
                                \r
                                /** Sets the token for the currently selected pipe to one of the tokens specified by the PIPE_TOKEN_*\r
                                 *  masks. This can be used on CONTROL type pipes, to allow for bidirectional transfer of data during\r
                                \r
                                /** Sets the token for the currently selected pipe to one of the tokens specified by the PIPE_TOKEN_*\r
                                 *  masks. This can be used on CONTROL type pipes, to allow for bidirectional transfer of data during\r
                                \r
                                #define Pipe_ClearErrorFlags()         MACROS{ UPERRX = 0; }MACROE\r
 \r
                                \r
                                #define Pipe_ClearErrorFlags()         MACROS{ UPERRX = 0; }MACROE\r
 \r
-                               #define Pipe_GetErrorFlags()           UPERRX\r
+                               #define Pipe_GetErrorFlags()           ((UPERRX & (PIPE_ERRORFLAG_CRC16 | PIPE_ERRORFLAG_TIMEOUT | \\r
+                                                                                  PIPE_ERRORFLAG_PID   | PIPE_ERRORFLAG_DATAPID | \\r
+                                                                                  PIPE_ERRORFLAG_DATATGL))                      | \\r
+                                                                       (UPSTAX & PIPE_ERRORFLAG_OVERFLOW | PIPE_ERRORFLAG_UNDERFLOW))\r
 \r
                                #define Pipe_IsReadWriteAllowed()      ((UPINTX & (1 << RWAL)) ? true : false)\r
 \r
 \r
                                #define Pipe_IsReadWriteAllowed()      ((UPINTX & (1 << RWAL)) ? true : false)\r
 \r