usb: make strings "const char * const *"

This allows the pointer table to be in Flash, by using
"static const char * const strings[] = { ... };"

See https://github.com/libopencm3/libopencm3/pull/924
This commit is contained in:
David Lamparter
2018-03-31 02:54:00 +02:00
committed by Karl Palsson
parent fa7a908027
commit 343cff4675
3 changed files with 13 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ LGPL License Terms @ref lgpl_license
usbd_device *usbd_init(const usbd_driver *driver,
const struct usb_device_descriptor *dev,
const struct usb_config_descriptor *conf,
const char **strings, int num_strings,
const char * const *strings, int num_strings,
uint8_t *control_buffer, uint16_t control_buffer_size)
{
usbd_device *usbd_dev;

View File

@@ -47,7 +47,7 @@ LGPL License Terms @ref lgpl_license
struct _usbd_device {
const struct usb_device_descriptor *desc;
const struct usb_config_descriptor *config;
const char **strings;
const char * const *strings;
int num_strings;
uint8_t *ctrl_buf; /**< Internal buffer used for control transfers */