Skip to content

Commit

Permalink
Moved descriptors into PROGMEM
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoHood committed Jul 22, 2015
1 parent cfc5604 commit fc2d90a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Version History
2.0.5 Release (xx.xx.2015)
* Improved USART reconfiguration
* Changed Magic Key to RAMEND
* Saved a lot ram by moving descriptors to PROGMEM
* Switch to U2Xn=0 if needed
* TODO linux avrdude script
Expand Down
16 changes: 8 additions & 8 deletions avr/bootloaders/HoodLoader2/Descriptors.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ along with Hoodloader2. If not, see <http://www.gnu.org/licenses/>.
* number of device configurations. The descriptor is read out by the USB host when the enumeration
* process begins.
*/
const USB_Descriptor_Device_t DeviceDescriptor =
const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},

Expand Down Expand Up @@ -98,7 +98,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
* and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
* a configuration so that the host may correctly communicate with the USB device.
*/
const USB_Descriptor_Configuration_t ConfigurationDescriptor =
const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Config =
{
Expand Down Expand Up @@ -207,26 +207,26 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
const USB_Descriptor_String_t LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG);
const USB_Descriptor_String_t PROGMEM LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG);

/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(L"NicoHood");
const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"NicoHood");

/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
#if (PRODUCTID == ARDUINO_UNO_PID)
const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"HoodLoader2 Uno");
const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"HoodLoader2 Uno");
#elif (PRODUCTID == ARDUINO_MEGA_PID)
const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"HoodLoader2 Mega");
const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"HoodLoader2 Mega");
#elif (PRODUCTID == ARDUINO_ADK_PID)
const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"HoodLoader2 ADK");
const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"HoodLoader2 ADK");
#else
const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"HoodLoader2 Lufa");
const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"HoodLoader2 Lufa");
#endif

/** This function is called by the library when in device mode, and must be overridden (see LUFA library "USB Descriptors"
Expand Down

0 comments on commit fc2d90a

Please sign in to comment.