Skip to content

Commit 8a979d3

Browse files
committed
clean up, use BLEDIS_MANUFACTURER and BLEDIS_MODEL for USB Manufacturer and Product string
1 parent c6d0290 commit 8a979d3

File tree

6 files changed

+18
-61
lines changed

6 files changed

+18
-61
lines changed

src/boards/electronut_labs_papyr/board.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,4 @@
6767
#define USB_DESC_VID 0x239A
6868
#define USB_DESC_UF2_PID 0x003B
6969

70-
#define USB_STRING_DESCRIPTORS { \
71-
/* 0: is supported language = English */ \
72-
TUD_DESC_STRCONV(0x0409), \
73-
\
74-
/* 1: Manufacturer */ \
75-
TUD_DESC_STRCONV('E','l','e','c','t','r','o','n','u','t',' ','L','a','b','s'), \
76-
\
77-
/* 2: Product */ \
78-
TUD_DESC_STRCONV('P','a','p','y','r', ' ', 'D','F','U'), \
79-
\
80-
/* 3: Serials TODO use chip ID */ \
81-
usb_desc_str_serial, \
82-
\
83-
/* 4: CDC Interface */ \
84-
TUD_DESC_STRCONV('P','a','p','y','r',' ','S','e','r','i','a','l'), \
85-
\
86-
/* 5: MSC Interface */ \
87-
TUD_DESC_STRCONV('P','a','p','y','r',' ','U','F','2'), \
88-
}
89-
9070
#endif // PPAPYR_H

src/boards/feather_nrf52832/board.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
#define HWFC false
5252

5353
// Used as model string in OTA mode
54-
#define BLEDIS_MANUFACTURER "Adafruit Industries"
55-
#define BLEDIS_MODEL "Feather nRF52832"
54+
#define BLEDIS_MANUFACTURER "Adafruit Industries"
55+
#define BLEDIS_MODEL "Feather nRF52832"
5656

57-
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52832"
58-
#define UF2_INDEX_URL "https://www.adafruit.com/product/3406"
57+
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52832"
58+
#define UF2_INDEX_URL "https://www.adafruit.com/product/3406"
5959

6060
#endif // _FEATHER_NRF52832_H

src/boards/feather_nrf52840_express/board.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
#define USB_DESC_CDC_ONLY_PID 0x002A
6969

7070
//------------- UF2 -------------//
71-
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express"
72-
#define UF2_VOLUME_LABEL "FTHR840BOOT"
73-
#define UF2_BOARD_ID "nRF52840-Feather-revD"
74-
#define UF2_INDEX_URL "https://www.adafruit.com/product/4062"
71+
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express"
72+
#define UF2_VOLUME_LABEL "FTHR840BOOT"
73+
#define UF2_BOARD_ID "nRF52840-Feather-revD"
74+
#define UF2_INDEX_URL "https://www.adafruit.com/product/4062"
7575

7676
#endif // _FEATHER_NRF52840_H

src/usb/msc_uf2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16
5252
(void) lun;
5353

5454
const char vid[] = "Adafruit";
55-
const char pid[] = "Bluefruit UF2";
55+
const char pid[] = "nRF UF2";
5656
const char rev[] = "1.0";
5757

5858
memcpy(vendor_id , vid, strlen(vid));

src/usb/usb_desc.c

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -134,42 +134,19 @@ void usb_desc_init(bool cdc_only)
134134
// STRING DESCRIPTORS
135135
//--------------------------------------------------------------------+
136136

137-
#ifndef USB_STRING_DESCRIPTORS
138-
#define USB_STRING_DESCRIPTORS { \
139-
/* 0: is supported language = English */ \
140-
TUD_DESC_STRCONV(0x0409), \
141-
\
142-
/* 1: Manufacturer */ \
143-
TUD_DESC_STRCONV('A','d','a','f','r','u','i','t',' ','I','n','d','u','s','t','r','i','e','s'), \
144-
\
145-
/* 2: Product */ \
146-
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','n','R','F','5','2','8','4','0', ' ', 'D','F','U'), \
147-
\
148-
/* 3: Serials TODO use chip ID */ \
149-
usb_desc_str_serial, \
150-
\
151-
/* 4: CDC Interface */ \
152-
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','S','e','r','i','a','l'), \
153-
\
154-
/* 5: MSC Interface */ \
155-
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','U','F','2'), \
156-
}
157-
#endif
158-
159-
160137
// array of pointer to string descriptors
161138
char const* string_desc_arr [] =
162139
{
163140
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
164-
"Adafruit Industries", // 1: Manufacturer
165-
"Bluefruit DFU", // 2: Product
141+
BLEDIS_MANUFACTURER, // 1: Manufacturer
142+
BLEDIS_MODEL, // 2: Product
166143
desc_str_serial, // 3: Serials, should use chip ID
167-
"Bluefruit Serial", // 4: CDC Interface
168-
"Bluefruit UF2", // 5: MSC Interface
144+
"nRF Serial", // 4: CDC Interface
145+
"nRF UF2", // 5: MSC Interface
169146
};
170147

171-
// up to 32 unicode characters (header make it 33)
172-
static uint16_t _desc_str[33];
148+
// up to 64 unicode characters
149+
static uint16_t _desc_str[64+1];
173150

174151
// Invoked when received GET STRING DESCRIPTOR request
175152
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete

src/usb/usb_desc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
void usb_desc_init(bool cdc_only);
3232

3333
#ifndef USB_DESC_VID
34-
#define USB_DESC_VID 0x239A
34+
#define USB_DESC_VID 0x239A
3535
#endif
3636

3737
#ifndef USB_DESC_UF2_PID
38-
#define USB_DESC_UF2_PID 0x0029
38+
#define USB_DESC_UF2_PID 0x0029
3939
#endif
4040

4141
#ifndef USB_DESC_CDC_ONLY_PID
42-
#define USB_DESC_CDC_ONLY_PID 0x002A
42+
#define USB_DESC_CDC_ONLY_PID 0x002A
4343
#endif
4444

4545
#endif /* USB_DESC_H_ */

0 commit comments

Comments
 (0)