FW version in USB sernum string; change Ultra product string to tinySA4

use same name as PRODUCT from Makefile, either tinySA or tinySA4
report FW version as v1.3-nnn-gxxxxxxx in USB descriptor, see dmesg log:
[  +1,567891] usb 1-1: new full-speed USB device number 121 using uhci_hcd
[  +0,179094] usb 1-1: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 2.00
[  +0,000008] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  +0,000005] usb 1-1: Product: tinySA
[  +0,000005] usb 1-1: Manufacturer: tinysa.org
[  +0,000004] usb 1-1: SerialNumber: v1.3-498-gf04006f
[  +0,003544] cdc_acm 1-1:1.0: ttyACM0: USB ACM device

Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
pull/38/head
Martin 3 years ago
parent f04006f05e
commit 90ce6ca744

@ -157,13 +157,12 @@ static const uint8_t vcom_string1[] = {
#ifdef TINYSA4 #ifdef TINYSA4
/* /*
* Device Description string, use "tinySA Ultra" * Device Description string, use "tinySA4" as in "VERSION"
*/ */
static const uint8_t vcom_string2[] = { static const uint8_t vcom_string2[] = {
USB_DESC_BYTE(26), /* bLength. */ USB_DESC_BYTE(16), /* bLength. */
USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */
't', 0, 'i', 0, 'n', 0, 'y', 0, 'S', 0, 'A', 0, 't', 0, 'i', 0, 'n', 0, 'y', 0, 'S', 0, 'A', 0, '4', 0
' ', 0, 'U', 0, 'l', 0, 't', 0, 'r', 0, 'a', 0
}; };
#else #else
/* /*
@ -176,16 +175,59 @@ static const uint8_t vcom_string2[] = {
}; };
#endif #endif
#ifdef TINYSA4
/*
* Serial Number string. VERSION = 'tinySA4_v1.3-nnn-gxxxxxxx'
* 0123456789012345678901234
*/
static const uint8_t vcom_string3[] = {
USB_DESC_BYTE(36), /* bLength. */
USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */
VERSION[8], 0, /* 'v' */
VERSION[9], 0, /* '1' */
VERSION[10], 0, /* '.' */
VERSION[11], 0, /* '3' */
VERSION[12], 0, /* '-' */
VERSION[13], 0, /* 'n' */
VERSION[14], 0, /* 'n' */
VERSION[15], 0, /* 'n' */
VERSION[16], 0, /* '-' */
VERSION[17], 0, /* 'g' */
VERSION[18], 0, /* 'x' */
VERSION[19], 0, /* 'x' */
VERSION[20], 0, /* 'x' */
VERSION[21], 0, /* 'x' */
VERSION[22], 0, /* 'x' */
VERSION[23], 0, /* 'x' */
VERSION[24], 0 /* 'x' */
};
#else
/* /*
* Serial Number string. TODO: use real product version. * Serial Number string. VERSION = 'tinySA_v1.3-nnn-gxxxxxxx'
* 012345678901234567890123
*/ */
static const uint8_t vcom_string3[] = { static const uint8_t vcom_string3[] = {
USB_DESC_BYTE(8), /* bLength. */ USB_DESC_BYTE(36), /* bLength. */
USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */
'0' + CH_KERNEL_MAJOR, 0, VERSION[7], 0, /* 'v' */
'0' + CH_KERNEL_MINOR, 0, VERSION[8], 0, /* '1' */
'0' + CH_KERNEL_PATCH, 0 VERSION[9], 0, /* '.' */
VERSION[10], 0, /* '3' */
VERSION[11], 0, /* '-' */
VERSION[12], 0, /* 'n' */
VERSION[13], 0, /* 'n' */
VERSION[14], 0, /* 'n' */
VERSION[15], 0, /* '-' */
VERSION[16], 0, /* 'g' */
VERSION[17], 0, /* 'x' */
VERSION[18], 0, /* 'x' */
VERSION[19], 0, /* 'x' */
VERSION[20], 0, /* 'x' */
VERSION[21], 0, /* 'x' */
VERSION[22], 0, /* 'x' */
VERSION[23], 0 /* 'x' */
}; };
#endif
/* /*
* Strings wrappers array. * Strings wrappers array.

Loading…
Cancel
Save

Powered by TurnKey Linux.