From 359fbfe14d00ab378f85a36664820ea9ba538c3f Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 10 May 2012 19:24:58 +0000 Subject: Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros. --- .../Incomplete/StandaloneProgrammer/Descriptors.c | 8 ++++---- .../Incomplete/StandaloneProgrammer/Descriptors.h | 20 ++++++++++---------- .../Incomplete/StandaloneProgrammer/DiskDevice.c | 21 ++++++++++++--------- Projects/Incomplete/StandaloneProgrammer/DiskHost.c | 15 ++++++++++----- .../StandaloneProgrammer/Lib/PetiteFATFs/diskio.c | 2 +- 5 files changed, 37 insertions(+), 29 deletions(-) (limited to 'Projects/Incomplete/StandaloneProgrammer') diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c index a3319e4ab..61176e607 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c +++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c @@ -120,20 +120,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM), + .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM), + .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.h b/Projects/Incomplete/StandaloneProgrammer/Descriptors.h index 250fcf79b..c0e8f46d7 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.h +++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.h @@ -42,14 +42,14 @@ #include /* Macros: */ - /** Endpoint number of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPNUM 5 + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 5) - /** Endpoint number of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPNUM 1 + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPNUM 2 + /** Endpoint address of the CDC host-to-device data OUT endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 2) /** Size in bytes of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPSIZE 8 @@ -57,11 +57,11 @@ /** Size in bytes of the CDC data IN and OUT endpoints. */ #define CDC_TXRX_EPSIZE 16 - /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */ - #define MASS_STORAGE_IN_EPNUM 3 + /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ + #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */ - #define MASS_STORAGE_OUT_EPNUM 4 + /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */ + #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4) /** Size in bytes of the Mass Storage data endpoints. */ #define MASS_STORAGE_IO_EPSIZE 64 diff --git a/Projects/Incomplete/StandaloneProgrammer/DiskDevice.c b/Projects/Incomplete/StandaloneProgrammer/DiskDevice.c index bc70910e7..73bf5545a 100644 --- a/Projects/Incomplete/StandaloneProgrammer/DiskDevice.c +++ b/Projects/Incomplete/StandaloneProgrammer/DiskDevice.c @@ -40,15 +40,18 @@ USB_ClassInfo_MS_Device_t DiskDevice_MS_Interface = .Config = { .InterfaceNumber = 0, - - .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM, - .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM, - .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE, - .DataOUTEndpointDoubleBank = false, - + .DataINEndpoint = + { + .Address = MASS_STORAGE_IN_EPADDR, + .Size = MASS_STORAGE_IO_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = MASS_STORAGE_OUT_EPADDR, + .Size = MASS_STORAGE_IO_EPSIZE, + .Banks = 1, + }, .TotalLUNs = 1, }, }; diff --git a/Projects/Incomplete/StandaloneProgrammer/DiskHost.c b/Projects/Incomplete/StandaloneProgrammer/DiskHost.c index 1dafda43b..c93029c06 100644 --- a/Projects/Incomplete/StandaloneProgrammer/DiskHost.c +++ b/Projects/Incomplete/StandaloneProgrammer/DiskHost.c @@ -39,11 +39,16 @@ USB_ClassInfo_MS_Host_t DiskHost_MS_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, }, }; diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c index cac0bd957..d953875a2 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c +++ b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c @@ -5,7 +5,7 @@ #include "diskio.h" #include -#include +#include #include "../DataflashManager.h" #include "../../DiskHost.h" -- cgit v1.2.3