diff --git a/bootloader/Makefile b/bootloader/Makefile index 4a3209618..519a847cd 100644 --- a/bootloader/Makefile +++ b/bootloader/Makefile @@ -8,6 +8,7 @@ bootloader_src += $(addprefix bootloader/,\ interface.cpp \ jump_to_firmware.s \ trampoline.cpp \ + usb_desc.cpp \ ) bootloader_images = $(addprefix bootloader/, \ @@ -15,6 +16,6 @@ bootloader_images = $(addprefix bootloader/, \ computer.png \ ) -bootloader_src += $(ion_src) $(kandinsky_src) $(liba_src) $(libaxx_src) $(bootloader_images) +bootloader_src += $(filter-out ion/src/device/shared/drivers/usb_desc.cpp,$(ion_src)) $(kandinsky_src) $(liba_src) $(libaxx_src) $(bootloader_images) $(eval $(call depends_on_image,bootloader/interface.cpp,$(bootloader_images))) diff --git a/bootloader/usb_desc.cpp b/bootloader/usb_desc.cpp new file mode 100644 index 000000000..be4930600 --- /dev/null +++ b/bootloader/usb_desc.cpp @@ -0,0 +1,12 @@ + +namespace Ion { +namespace Device { +namespace USB { + +const char* stringDescriptor() { + return "@Flash/0x90000000/08*004Kg,01*032Kg,63*064Kg,64*064Kg"; +} + +} +} +} diff --git a/ion/src/device/shared/drivers/Makefile b/ion/src/device/shared/drivers/Makefile index 2db043c5f..67bfb6ff5 100644 --- a/ion/src/device/shared/drivers/Makefile +++ b/ion/src/device/shared/drivers/Makefile @@ -25,5 +25,6 @@ ion_device_src += $(addprefix ion/src/device/shared/drivers/, \ swd.cpp \ timing.cpp \ usb.cpp \ + usb_desc.cpp \ wakeup.cpp \ ) diff --git a/ion/src/device/shared/drivers/usb.h b/ion/src/device/shared/drivers/usb.h index df27513e7..598aa4e9f 100644 --- a/ion/src/device/shared/drivers/usb.h +++ b/ion/src/device/shared/drivers/usb.h @@ -12,6 +12,7 @@ void initGPIO(); void shutdownGPIO(); void initOTG(); void shutdownOTG(); +const char* stringDescriptor(); } } diff --git a/ion/src/device/shared/drivers/usb_desc.cpp b/ion/src/device/shared/drivers/usb_desc.cpp new file mode 100644 index 000000000..34ea8527a --- /dev/null +++ b/ion/src/device/shared/drivers/usb_desc.cpp @@ -0,0 +1,15 @@ +#include "usb.h" +#include +#include + +namespace Ion { +namespace Device { +namespace USB { + +const char* stringDescriptor() { + return Config::InterfaceStringDescriptor; +} + +} +} +} \ No newline at end of file diff --git a/ion/src/device/shared/usb/Makefile b/ion/src/device/shared/usb/Makefile index a79991d74..02e931b6a 100644 --- a/ion/src/device/shared/usb/Makefile +++ b/ion/src/device/shared/usb/Makefile @@ -66,6 +66,7 @@ ion_device_dfu_src += $(addprefix ion/src/device/shared/drivers/, \ swd.cpp \ timing.cpp \ usb.cpp \ + usb_desc.cpp \ wakeup.cpp \ ) diff --git a/ion/src/device/shared/usb/calculator.h b/ion/src/device/shared/usb/calculator.h index cf083860c..e5eaba3a4 100644 --- a/ion/src/device/shared/usb/calculator.h +++ b/ion/src/device/shared/usb/calculator.h @@ -3,6 +3,7 @@ #include #include +#include #include #include "dfu_interface.h" #include "stack/device.h" @@ -94,7 +95,7 @@ public: m_manufacturerStringDescriptor("NumWorks"), m_productStringDescriptor("NumWorks Calculator"), m_serialNumberStringDescriptor(serialNumber), - m_interfaceStringDescriptor(Config::InterfaceStringDescriptor), + m_interfaceStringDescriptor(stringDescriptor()), //m_interfaceStringDescriptor("@SRAM/0x20000000/01*256Ke"), /* Switch to this descriptor to use dfu-util to write in the SRAM. * FIXME Should be an alternate Interface. */