diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-03-21 11:10:02 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-03-21 11:10:02 +0000 |
commit | f595043584d864d2618da62f422cf57ed5eda6f4 (patch) | |
tree | ed1db5d5b56343dd26549f3804f08ee6e1975eb9 /LUFA/Drivers/USB/Core/EndpointStream.c | |
parent | aba7932a5c7c5f4a65f1c8558c94ed313ff3ca96 (diff) | |
download | lufa-f595043584d864d2618da62f422cf57ed5eda6f4.tar.gz lufa-f595043584d864d2618da62f422cf57ed5eda6f4.tar.bz2 lufa-f595043584d864d2618da62f422cf57ed5eda6f4.zip |
Add in new architecture attribute defines to selectively remove the EEPROM and FLASH memory space functions on architectures which do not have seperate memory address spaces.
Diffstat (limited to 'LUFA/Drivers/USB/Core/EndpointStream.c')
-rw-r--r-- | LUFA/Drivers/USB/Core/EndpointStream.c | 172 |
1 files changed, 90 insertions, 82 deletions
diff --git a/LUFA/Drivers/USB/Core/EndpointStream.c b/LUFA/Drivers/USB/Core/EndpointStream.c index 974af682c..893a6ff35 100644 --- a/LUFA/Drivers/USB/Core/EndpointStream.c +++ b/LUFA/Drivers/USB/Core/EndpointStream.c @@ -122,22 +122,6 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
#include "Template/Template_Endpoint_RW.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_LE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_RW.c"
-
-#define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_LE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_RW.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Write_Stream_BE
#define TEMPLATE_BUFFER_TYPE const void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
@@ -146,22 +130,6 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
#include "Template/Template_Endpoint_RW.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_BE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_RW.c"
-
-#define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_BE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_RW.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Read_Stream_LE
#define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
@@ -170,14 +138,6 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, #define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_RW.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_LE
-#define TEMPLATE_BUFFER_TYPE void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
-#include "Template/Template_Endpoint_RW.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Read_Stream_BE
#define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
@@ -186,13 +146,57 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, #define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_RW.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_BE
-#define TEMPLATE_BUFFER_TYPE void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
-#include "Template/Template_Endpoint_RW.c"
+#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_LE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_BE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_RW.c"
+#endif
+
+#if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_LE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_BE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_LE
+ #define TEMPLATE_BUFFER_TYPE void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
+ #include "Template/Template_Endpoint_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_BE
+ #define TEMPLATE_BUFFER_TYPE void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
+ #include "Template/Template_Endpoint_RW.c"
+#endif
#endif
@@ -202,58 +206,62 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
#include "Template/Template_Endpoint_Control_W.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_LE
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_Control_W.c"
-
-#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_LE
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_Control_W.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_Stream_BE
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
#include "Template/Template_Endpoint_Control_W.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_BE
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_Control_W.c"
-
-#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_BE
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_Control_W.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_LE
#define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_Control_R.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_LE
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
-#include "Template/Template_Endpoint_Control_R.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_BE
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_Control_R.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_BE
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
-#include "Template/Template_Endpoint_Control_R.c"
+#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_LE
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_Control_W.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_BE
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_Control_W.c"
+#endif
+
+#if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_LE
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_Control_W.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_BE
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_Control_W.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_LE
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
+ #include "Template/Template_Endpoint_Control_R.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_BE
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
+ #include "Template/Template_Endpoint_Control_R.c"
+#endif
#endif |