[bootloader] Use custom USB descriptor

This commit is contained in:
M4x1m3
2022-02-27 00:28:46 +01:00
parent 5a7b076ebe
commit dee783065b
7 changed files with 34 additions and 2 deletions

View File

@@ -25,5 +25,6 @@ ion_device_src += $(addprefix ion/src/device/shared/drivers/, \
swd.cpp \
timing.cpp \
usb.cpp \
usb_desc.cpp \
wakeup.cpp \
)

View File

@@ -12,6 +12,7 @@ void initGPIO();
void shutdownGPIO();
void initOTG();
void shutdownOTG();
const char* stringDescriptor();
}
}

View 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;
}
}
}
}

View File

@@ -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 \
)

View File

@@ -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. */