Added new Pipe_IsFrozen() macro to determine if the currently selected pipe is frozen.
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Pipe.h
index 2945458..fd01b5c 100644 (file)
                                /** Freezes the selected pipe, preventing it from communicating with an attached device. */\r
                                static inline void Pipe_Freeze(void);\r
 \r
+                               /** Determines if the currently selected pipe is frozen, and not able to accept data.\r
+                                *\r
+                                *  \return Boolean true if the currently selected pipe is frozen, false otherwise\r
+                                */\r
+                               static inline bool Pipe_IsFrozen(void);\r
+                               \r
                                /** Clears the master pipe error flag. */\r
                                static inline void Pipe_ClearError(void);\r
                                \r
                                #define Pipe_Unfreeze()                MACROS{ UPCONX &= ~(1 << PFREEZE); }MACROE\r
 \r
                                #define Pipe_Freeze()                  MACROS{ UPCONX |= (1 << PFREEZE); }MACROE\r
+                               \r
+                               #define Pipe_IsFrozen()                ((UPCONX & (1 << PFREEZE)) ? true : false)\r
 \r
                                #define Pipe_ClearError()              MACROS{ UPINTX &= ~(1 << PERRI); }MACROE\r
 \r