From 82f651d930b43b57dbf1afee76177ec7c891bb22 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Tue, 5 May 2020 16:35:22 +0100 Subject: [PATCH 1/9] Mixer update for XS3 compat --- lib_xua/src/core/mixer/fastmix.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/mixer/fastmix.S b/lib_xua/src/core/mixer/fastmix.S index 4321b717..7f315bd7 100644 --- a/lib_xua/src/core/mixer/fastmix.S +++ b/lib_xua/src/core/mixer/fastmix.S @@ -5,7 +5,7 @@ #define MIX_INPUTS 18 -#if defined(__XS2A__) +#ifndef(__XS1A__) #define DOMIX_TOP(i) \ .cc_top doMix##i.function,doMix##i; \ From c18ca44768d40dae24b7dc2d2a3b673080a59ee4 Mon Sep 17 00:00:00 2001 From: xross Date: Thu, 14 May 2020 13:55:27 +0100 Subject: [PATCH 2/9] Revert "Mixer update for XS3 compat" This reverts commit 82f651d930b43b57dbf1afee76177ec7c891bb22. --- lib_xua/src/core/mixer/fastmix.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/mixer/fastmix.S b/lib_xua/src/core/mixer/fastmix.S index 7f315bd7..4321b717 100644 --- a/lib_xua/src/core/mixer/fastmix.S +++ b/lib_xua/src/core/mixer/fastmix.S @@ -5,7 +5,7 @@ #define MIX_INPUTS 18 -#ifndef(__XS1A__) +#if defined(__XS2A__) #define DOMIX_TOP(i) \ .cc_top doMix##i.function,doMix##i; \ From 74772d864efeb75baa546d402440d4d3c91e80f7 Mon Sep 17 00:00:00 2001 From: mbanth Date: Thu, 14 May 2020 14:47:31 +0100 Subject: [PATCH 3/9] Update copyright date range. --- lib_xua/src/core/mixer/fastmix.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/mixer/fastmix.S b/lib_xua/src/core/mixer/fastmix.S index 4321b717..ca4e39e1 100644 --- a/lib_xua/src/core/mixer/fastmix.S +++ b/lib_xua/src/core/mixer/fastmix.S @@ -1,4 +1,4 @@ -// Copyright (c) 2018, XMOS Ltd, All rights reserved +// Copyright (c) 2018-2020, XMOS Ltd, All rights reserved //#include "devicedefines.h" #define MAX_MIX_COUNT 8 From b7cbc5fe9eac820bfd8b77372a73d1a41e20a1dd Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 19 May 2020 12:43:56 +0100 Subject: [PATCH 4/9] Ability to read or modify serial number string --- CHANGELOG.rst | 6 ++++ lib_xua/api/xua_endpoint0.h | 32 +++++++++++++++---- lib_xua/module_build_info | 2 +- lib_xua/src/core/endpoint0/xua_endpoint0.c | 14 ++++++++ .../src/core/endpoint0/xua_ep0_descriptors.h | 3 +- 5 files changed, 49 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c4fb7f95..15cf79fe 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ lib_xua Change Log ================== +1.1.0 +----- + + + * ADDED: Ability to read or modify serial number string + 1.0.1 ----- diff --git a/lib_xua/api/xua_endpoint0.h b/lib_xua/api/xua_endpoint0.h index 60f68bf3..2cebd564 100644 --- a/lib_xua/api/xua_endpoint0.h +++ b/lib_xua/api/xua_endpoint0.h @@ -62,6 +62,16 @@ void XUA_Endpoint0_setProductStr(char * unsafe product_str); void XUA_Endpoint0_setProductStr(char * product_str); #endif +/** Function to set the Serial string + * + * \param serial_str Serial string to set +*/ +#ifdef __XC__ +void XUA_Endpoint0_setSerialStr(char * unsafe serial_str); +#else +void XUA_Endpoint0_setSerialStr(char * serial_str); +#endif + /** Function to set the BCD device * * \param bcdDevice BCD device to set @@ -72,7 +82,7 @@ void XUA_Endpoint0_setBcdDevice(unsigned short bcdDevice); /** Function to get the Vendor string * - * \param vid vendor string + * \return vendor string */ #ifdef __XC__ char * unsafe XUA_Endpoint0_getVendorStr(); @@ -82,7 +92,7 @@ char * XUA_Endpoint0_getVendorStr(; /** Function to get the Product string * - * \param pid Product string + * \return Product string */ #ifdef __XC__ char * unsafe XUA_Endpoint0_getProductStr(); @@ -90,15 +100,25 @@ char * unsafe XUA_Endpoint0_getProductStr(); char * XUA_Endpoint0_getProductStr(; #endif -/** Function to get the Vendor string +/** Function to get the Serial Number string * - * \return Vendor string + * \return Serial string +*/ +#ifdef __XC__ +char * unsafe XUA_Endpoint0_getSerialStr(); +#else +char * XUA_Endpoint0_getSerialStr(; +#endif + +/** Function to get the Vendor ID + * + * \return Vendor ID */ unsigned short XUA_Endpoint0_getVendorId(); -/** Function to get the Product string +/** Function to get the Product ID * - * \return Product string + * \return Product ID */ unsigned short XUA_Endpoint0_getProductId(); diff --git a/lib_xua/module_build_info b/lib_xua/module_build_info index b8b0aa5f..6f454747 100644 --- a/lib_xua/module_build_info +++ b/lib_xua/module_build_info @@ -1,4 +1,4 @@ -VERSION = 1.0.1 +VERSION = 1.1.0 DEPENDENT_MODULES = lib_logging(>=3.0.0) \ lib_xassert(>=4.0.0) \ diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index f30b4c5c..e91d61fc 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -118,6 +118,8 @@ char g_product_str[XUA_MAX_STR_LEN] = PRODUCT_STR_A2; char g_product_str[XUA_MAX_STR_LEN] = PRODUCT_STR_A1; #endif +char g_serial_str[XUA_MAX_STR_LEN] = ""; + /* Subslot */ const unsigned g_subSlot_Out_HS[OUTPUT_FORMAT_COUNT] = {HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES, #if(OUTPUT_FORMAT_COUNT > 1) @@ -289,6 +291,9 @@ void XUA_Endpoint0_setStrTable() { concatenateAndCopyStrings(g_product_str, "", g_strTable.usbInputTermStr_Audio2); concatenateAndCopyStrings(g_product_str, "", g_strTable.usbOutputTermStr_Audio2); #endif + + // update Serial strings + concatenateAndCopyStrings(g_serial_str, "", g_strTable.serialStr); } void XUA_Endpoint0_setVendorStr(char* vendor_str) { @@ -301,6 +306,11 @@ void XUA_Endpoint0_setProductStr(char* product_str) { concatenateAndCopyStrings(product_str, "", g_product_str); } +void XUA_Endpoint0_setSerialStr(char* serial_str) { + debug_printf("XUA_Endpoint0_setSerialStr() with string %s\n", serial_str); + concatenateAndCopyStrings(serial_str, "", g_serial_str); +} + char* XUA_Endpoint0_getVendorStr() { return g_strTable.vendorStr; } @@ -313,6 +323,10 @@ char* XUA_Endpoint0_getProductStr() { #endif } +char* XUA_Endpoint0_getSerialStr() { + return g_strTable.serialStr; +} + void XUA_Endpoint0_setProductId(unsigned short pid) { #if (AUDIO_CLASS == 1) devDesc_Audio1.idProduct = pid; diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index 185575bb..beaaa4e7 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -40,6 +40,7 @@ #define XUA_CTRL_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\08" #define XUA_MIDI_OUT_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\09" #define XUA_MIDI_IN_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0a" +#define XUA_SERIAL_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0b" // The value below must match the length of XUA_DESCR_EMPTY_STRING. #define XUA_MAX_STR_LEN (32) @@ -334,7 +335,7 @@ StringDescTable_t g_strTable = { .langID = "\x09\x04", /* US English */ .vendorStr = XUA_VENDOR_EMPTY_STRING, - .serialStr = "", + .serialStr = XUA_SERIAL_EMPTY_STRING, #if (AUDIO_CLASS == 2) .productStr_Audio2 = XUA_PRODUCT_EMPTY_STRING, .outputInterfaceStr_Audio2 = XUA_PRODUCT_EMPTY_STRING, From 05dacde043f98efd8c5cfdf0ef027192911e636e Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 19 May 2020 13:45:52 +0100 Subject: [PATCH 5/9] Add SERIAL_STR configurable from xua_conf.h --- lib_xua/api/xua_conf_default.h | 10 ++++++++++ lib_xua/src/core/endpoint0/xua_endpoint0.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib_xua/api/xua_conf_default.h b/lib_xua/api/xua_conf_default.h index 79aa061b..a1fc3514 100644 --- a/lib_xua/api/xua_conf_default.h +++ b/lib_xua/api/xua_conf_default.h @@ -442,6 +442,16 @@ #define CODEC_MASTER (0) #endif +/** + * @brief Serial Number String used by the device + * + * Default: "" + */ +#ifndef SERIAL_STR +#define SERIAL_STR "" +#endif + + /** * @brief Vendor String used by the device. This is also pre-pended to various strings used by the design. * diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index e91d61fc..384aee2a 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -118,7 +118,8 @@ char g_product_str[XUA_MAX_STR_LEN] = PRODUCT_STR_A2; char g_product_str[XUA_MAX_STR_LEN] = PRODUCT_STR_A1; #endif -char g_serial_str[XUA_MAX_STR_LEN] = ""; +/* Global variable for current USB Serial Number strings */ +char g_serial_str[XUA_MAX_STR_LEN] = SERIAL_STR; /* Subslot */ const unsigned g_subSlot_Out_HS[OUTPUT_FORMAT_COUNT] = {HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES, From fda4c3afb16039dd75364f2be2e7afad53cb853f Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 19 May 2020 14:12:51 +0100 Subject: [PATCH 6/9] Remove empty line --- CHANGELOG.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 15cf79fe..0160f5d3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,7 +4,6 @@ lib_xua Change Log 1.1.0 ----- - * ADDED: Ability to read or modify serial number string 1.0.1 From 5c2a69288cc1b02ae450c14d0b2a618a4dbb366f Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 19 May 2020 15:26:27 +0100 Subject: [PATCH 7/9] Add missing bracket --- lib_xua/api/xua_endpoint0.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_xua/api/xua_endpoint0.h b/lib_xua/api/xua_endpoint0.h index 2cebd564..41281115 100644 --- a/lib_xua/api/xua_endpoint0.h +++ b/lib_xua/api/xua_endpoint0.h @@ -87,7 +87,7 @@ void XUA_Endpoint0_setBcdDevice(unsigned short bcdDevice); #ifdef __XC__ char * unsafe XUA_Endpoint0_getVendorStr(); #else -char * XUA_Endpoint0_getVendorStr(; +char * XUA_Endpoint0_getVendorStr(); #endif /** Function to get the Product string @@ -97,7 +97,7 @@ char * XUA_Endpoint0_getVendorStr(; #ifdef __XC__ char * unsafe XUA_Endpoint0_getProductStr(); #else -char * XUA_Endpoint0_getProductStr(; +char * XUA_Endpoint0_getProductStr(); #endif /** Function to get the Serial Number string @@ -107,7 +107,7 @@ char * XUA_Endpoint0_getProductStr(; #ifdef __XC__ char * unsafe XUA_Endpoint0_getSerialStr(); #else -char * XUA_Endpoint0_getSerialStr(; +char * XUA_Endpoint0_getSerialStr(); #endif /** Function to get the Vendor ID From 7ccd5b526df98f3061b898bda83f7eadad65c192 Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 19 May 2020 16:11:34 +0100 Subject: [PATCH 8/9] Set iSerial correctly --- lib_xua/src/core/endpoint0/xua_ep0_descriptors.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index beaaa4e7..e0742f83 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -435,7 +435,7 @@ USB_Descriptor_Device_t devDesc_Audio1 = .bcdDevice = BCD_DEVICE, .iManufacturer = offsetof(StringDescTable_t, vendorStr)/sizeof(char *), .iProduct = offsetof(StringDescTable_t, productStr_Audio1)/sizeof(char *), - .iSerialNumber = 0, + .iSerialNumber = offsetof(StringDescTable_t, serialStr)/sizeof(char *), .bNumConfigurations = 1 }; #endif @@ -471,7 +471,7 @@ USB_Descriptor_Device_t devDesc_Audio2 = .bcdDevice = BCD_DEVICE, .iManufacturer = offsetof(StringDescTable_t, vendorStr)/sizeof(char *), .iProduct = offsetof(StringDescTable_t, productStr_Audio2)/sizeof(char *), - .iSerialNumber = 0, + .iSerialNumber = offsetof(StringDescTable_t, serialStr)/sizeof(char *), .bNumConfigurations = 0x02 /* Set to 2 such that windows does not load composite driver */ }; @@ -494,7 +494,7 @@ unsigned char devDesc_Null[] = (BCD_DEVICE >> 8), /* 13 bcdDevice : Device release number */ offsetof(StringDescTable_t, vendorStr)/sizeof(char *), offsetof(StringDescTable_t, productStr_Audio2)/sizeof(char *), - 0, /* 16 iSerialNumber : Index of serial number decriptor */ + offsetof(StringDescTable_t, serialStr)/sizeof(char *), /* 16 iSerialNumber : Index of serial number decriptor */ 0x01 /* 17 bNumConfigurations : Number of possible configs */ }; #endif From a61f0e7a5f8fcad838a3bf4fbd0d8046a2d727f0 Mon Sep 17 00:00:00 2001 From: mbanth Date: Wed, 20 May 2020 11:46:17 +0100 Subject: [PATCH 9/9] Update Jenkins Shared Library to v0.14.1 to correct a Groovy iteration bug that results in intermittent test failures. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 12512fd1..4f167c75 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library('xmos_jenkins_shared_library@v0.12.1') _ +@Library('xmos_jenkins_shared_library@v0.14.1') _ getApproval()