Oops - fix incorrect variable name in the updated Pipe_Write_8() function.
[pub/USBasp.git] / LUFA / Drivers / USB / Core / PipeStream.c
index 4465471..475d597 100644 (file)
@@ -109,7 +109,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
                }\r
                else\r
                {\r
                }\r
                else\r
                {\r
-                       Pipe_Write_Byte(0);\r
+                       Pipe_Write_8(0);\r
                        \r
                        Length--;\r
                        BytesInTransfer++;\r
                        \r
                        Length--;\r
                        BytesInTransfer++;\r
@@ -128,25 +128,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
 #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
 #define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
 #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
 #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
 #define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
 #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_Byte(*BufferPtr)\r
-#include "Template/Template_Pipe_RW.c"\r
-\r
-#define  TEMPLATE_FUNC_NAME                        Pipe_Write_PStream_LE\r
-#define  TEMPLATE_BUFFER_TYPE                      const void*\r
-#define  TEMPLATE_TOKEN                            PIPE_TOKEN_OUT\r
-#define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
-#define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
-#define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_Byte(pgm_read_byte(BufferPtr))\r
-#include "Template/Template_Pipe_RW.c"\r
-\r
-#define  TEMPLATE_FUNC_NAME                        Pipe_Write_EStream_LE\r
-#define  TEMPLATE_BUFFER_TYPE                      const void*\r
-#define  TEMPLATE_TOKEN                            PIPE_TOKEN_OUT\r
-#define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
-#define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
-#define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_Byte(eeprom_read_byte(BufferPtr))\r
+#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_8(*BufferPtr)\r
 #include "Template/Template_Pipe_RW.c"\r
 \r
 #define  TEMPLATE_FUNC_NAME                        Pipe_Write_Stream_BE\r
 #include "Template/Template_Pipe_RW.c"\r
 \r
 #define  TEMPLATE_FUNC_NAME                        Pipe_Write_Stream_BE\r
@@ -155,25 +137,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
 #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
 #define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
 #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
 #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
 #define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
 #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_Byte(*BufferPtr)\r
-#include "Template/Template_Pipe_RW.c"\r
-\r
-#define  TEMPLATE_FUNC_NAME                        Pipe_Write_PStream_BE\r
-#define  TEMPLATE_BUFFER_TYPE                      const void*\r
-#define  TEMPLATE_TOKEN                            PIPE_TOKEN_OUT\r
-#define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
-#define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
-#define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_Byte(pgm_read_byte(BufferPtr))\r
-#include "Template/Template_Pipe_RW.c"\r
-\r
-#define  TEMPLATE_FUNC_NAME                        Pipe_Write_EStream_BE\r
-#define  TEMPLATE_BUFFER_TYPE                      const void*\r
-#define  TEMPLATE_TOKEN                            PIPE_TOKEN_OUT\r
-#define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
-#define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
-#define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_Byte(eeprom_read_byte(BufferPtr))\r
+#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_8(*BufferPtr)\r
 #include "Template/Template_Pipe_RW.c"\r
 \r
 #define  TEMPLATE_FUNC_NAME                        Pipe_Read_Stream_LE\r
 #include "Template/Template_Pipe_RW.c"\r
 \r
 #define  TEMPLATE_FUNC_NAME                        Pipe_Read_Stream_LE\r
@@ -182,16 +146,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
 #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearIN()\r
 #define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
 #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
 #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearIN()\r
 #define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
 #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         *BufferPtr = Pipe_Read_Byte()\r
-#include "Template/Template_Pipe_RW.c"\r
-\r
-#define  TEMPLATE_FUNC_NAME                        Pipe_Read_EStream_LE\r
-#define  TEMPLATE_BUFFER_TYPE                      void*\r
-#define  TEMPLATE_TOKEN                            PIPE_TOKEN_IN\r
-#define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearIN()\r
-#define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
-#define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         eeprom_update_byte(BufferPtr, Pipe_Read_Byte())\r
+#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         *BufferPtr = Pipe_Read_8()\r
 #include "Template/Template_Pipe_RW.c"\r
 \r
 #define  TEMPLATE_FUNC_NAME                        Pipe_Read_Stream_BE\r
 #include "Template/Template_Pipe_RW.c"\r
 \r
 #define  TEMPLATE_FUNC_NAME                        Pipe_Read_Stream_BE\r
@@ -200,17 +155,66 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
 #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearIN()\r
 #define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
 #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
 #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearIN()\r
 #define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
 #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         *BufferPtr = Pipe_Read_Byte()\r
+#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         *BufferPtr = Pipe_Read_8()\r
 #include "Template/Template_Pipe_RW.c"\r
 \r
 #include "Template/Template_Pipe_RW.c"\r
 \r
-#define  TEMPLATE_FUNC_NAME                        Pipe_Read_EStream_BE\r
-#define  TEMPLATE_BUFFER_TYPE                      void*\r
-#define  TEMPLATE_TOKEN                            PIPE_TOKEN_IN\r
-#define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearIN()\r
-#define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
-#define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
-#define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         eeprom_update_byte(BufferPtr, Pipe_Read_Byte())\r
-#include "Template/Template_Pipe_RW.c"\r
+#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)\r
+       #define  TEMPLATE_FUNC_NAME                        Pipe_Write_PStream_LE\r
+       #define  TEMPLATE_BUFFER_TYPE                      const void*\r
+       #define  TEMPLATE_TOKEN                            PIPE_TOKEN_OUT\r
+       #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
+       #define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
+       #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
+       #define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_8(pgm_read_byte(BufferPtr))\r
+       #include "Template/Template_Pipe_RW.c"\r
+\r
+       #define  TEMPLATE_FUNC_NAME                        Pipe_Write_PStream_BE\r
+       #define  TEMPLATE_BUFFER_TYPE                      const void*\r
+       #define  TEMPLATE_TOKEN                            PIPE_TOKEN_OUT\r
+       #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
+       #define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
+       #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
+       #define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_8(pgm_read_byte(BufferPtr))\r
+       #include "Template/Template_Pipe_RW.c"\r
+#endif\r
+\r
+#if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE)\r
+       #define  TEMPLATE_FUNC_NAME                        Pipe_Write_EStream_LE\r
+       #define  TEMPLATE_BUFFER_TYPE                      const void*\r
+       #define  TEMPLATE_TOKEN                            PIPE_TOKEN_OUT\r
+       #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
+       #define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
+       #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
+       #define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_8(eeprom_read_byte(BufferPtr))\r
+       #include "Template/Template_Pipe_RW.c"\r
+\r
+       #define  TEMPLATE_FUNC_NAME                        Pipe_Write_EStream_BE\r
+       #define  TEMPLATE_BUFFER_TYPE                      const void*\r
+       #define  TEMPLATE_TOKEN                            PIPE_TOKEN_OUT\r
+       #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearOUT()\r
+       #define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
+       #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
+       #define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         Pipe_Write_8(eeprom_read_byte(BufferPtr))\r
+       #include "Template/Template_Pipe_RW.c"\r
+\r
+       #define  TEMPLATE_FUNC_NAME                        Pipe_Read_EStream_LE\r
+       #define  TEMPLATE_BUFFER_TYPE                      void*\r
+       #define  TEMPLATE_TOKEN                            PIPE_TOKEN_IN\r
+       #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearIN()\r
+       #define  TEMPLATE_BUFFER_OFFSET(Length)            0\r
+       #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream += Amount\r
+       #define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         eeprom_update_byte(BufferPtr, Pipe_Read_8())\r
+       #include "Template/Template_Pipe_RW.c"\r
+\r
+       #define  TEMPLATE_FUNC_NAME                        Pipe_Read_EStream_BE\r
+       #define  TEMPLATE_BUFFER_TYPE                      void*\r
+       #define  TEMPLATE_TOKEN                            PIPE_TOKEN_IN\r
+       #define  TEMPLATE_CLEAR_PIPE()                     Pipe_ClearIN()\r
+       #define  TEMPLATE_BUFFER_OFFSET(Length)            (Length - 1)\r
+       #define  TEMPLATE_BUFFER_MOVE(BufferPtr, Amount)   DataStream -= Amount\r
+       #define  TEMPLATE_TRANSFER_BYTE(BufferPtr)         eeprom_update_byte(BufferPtr, Pipe_Read_8())\r
+       #include "Template/Template_Pipe_RW.c"\r
+#endif\r
 \r
 #endif\r
 
 \r
 #endif\r