mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[bootloader] Use custom USB descriptor
This commit is contained in:
@@ -25,5 +25,6 @@ ion_device_src += $(addprefix ion/src/device/shared/drivers/, \
|
||||
swd.cpp \
|
||||
timing.cpp \
|
||||
usb.cpp \
|
||||
usb_desc.cpp \
|
||||
wakeup.cpp \
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ void initGPIO();
|
||||
void shutdownGPIO();
|
||||
void initOTG();
|
||||
void shutdownOTG();
|
||||
const char* stringDescriptor();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
15
ion/src/device/shared/drivers/usb_desc.cpp
Normal file
15
ion/src/device/shared/drivers/usb_desc.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "usb.h"
|
||||
#include <ion/usb.h>
|
||||
#include <drivers/config/usb.h>
|
||||
|
||||
namespace Ion {
|
||||
namespace Device {
|
||||
namespace USB {
|
||||
|
||||
const char* stringDescriptor() {
|
||||
return Config::InterfaceStringDescriptor;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 \
|
||||
)
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <assert.h>
|
||||
#include <drivers/usb.h>
|
||||
#include <drivers/config/usb.h>
|
||||
#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. */
|
||||
|
||||
Reference in New Issue
Block a user