From e0c7272190998aa12dc82181e988936bbbdcf9b0 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Fri, 15 Nov 2019 14:29:49 +0000 Subject: [PATCH 01/19] Add missing definition of MIC_DUAL_FRAME_SIZE. Use the MIC_ARRAY_FRAME_SIZE value from lib_xua. --- lib_xua/src/core/pdm_mics/mic_array_conf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_xua/src/core/pdm_mics/mic_array_conf.h b/lib_xua/src/core/pdm_mics/mic_array_conf.h index 7f105514..e7ea8b46 100644 --- a/lib_xua/src/core/pdm_mics/mic_array_conf.h +++ b/lib_xua/src/core/pdm_mics/mic_array_conf.h @@ -12,4 +12,8 @@ #define MIC_ARRAY_NUM_MICS (XUA_NUM_PDM_MICS) #endif +#ifndef MIC_DUAL_FRAME_SIZE +#define MIC_DUAL_FRAME_SIZE (MIC_ARRAY_FRAME_SIZE) +#endif + #endif /* MIC_ARRAY_CONF_H_ */ From fecc01d2031ac17e509c21dab97e5605b8b6761b Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Fri, 15 Nov 2019 17:19:44 +0000 Subject: [PATCH 02/19] Update the copyright date. --- lib_xua/src/core/pdm_mics/mic_array_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/pdm_mics/mic_array_conf.h b/lib_xua/src/core/pdm_mics/mic_array_conf.h index e7ea8b46..2da348df 100644 --- a/lib_xua/src/core/pdm_mics/mic_array_conf.h +++ b/lib_xua/src/core/pdm_mics/mic_array_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2015-2019, XMOS Ltd, All rights reserved #ifndef MIC_ARRAY_CONF_H_ #define MIC_ARRAY_CONF_H_ From 5c3cff6a91ebb7dacd035cd217ce1a200352893a Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 18 Nov 2019 11:15:00 +0000 Subject: [PATCH 03/19] Add missing #defines. The XUA library code now depends on these constants. --- tests/app_test_i2s_loopback/xua_conf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/app_test_i2s_loopback/xua_conf.h b/tests/app_test_i2s_loopback/xua_conf.h index 6dc9c95d..0b555dba 100644 --- a/tests/app_test_i2s_loopback/xua_conf.h +++ b/tests/app_test_i2s_loopback/xua_conf.h @@ -22,5 +22,7 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 +#define MIC_DUAL_ENABLED 1 //Use single thread, dual PDM mic +#define MIC_ARRAY_FRAME_SIZE 240 #endif // __custom_defines_h__ From 3b6f6b6a1082c6a1611f6b9c02718b29e354ab73 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 18 Nov 2019 11:18:46 +0000 Subject: [PATCH 04/19] Added comment to change log. --- CHANGELOG.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 498faf1e..26be68d4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,8 @@ lib_xua Change Log * ADDED: UAC1 HID support with simulated Voice Command detection reported every 10 seconds * ADDED: Support for USB HID Set Idle request + * ADDED: Pre-processor symbols to enable single-threaded, dual-PDM + microphone operation 0.2.1 ----- From 192d8f54d7ebbec4a9776ab883ea870619b280a8 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 18 Nov 2019 11:28:42 +0000 Subject: [PATCH 05/19] Update copyright date range. --- tests/app_test_i2s_loopback/xua_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app_test_i2s_loopback/xua_conf.h b/tests/app_test_i2s_loopback/xua_conf.h index 0b555dba..29316351 100644 --- a/tests/app_test_i2s_loopback/xua_conf.h +++ b/tests/app_test_i2s_loopback/xua_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2016-2019, XMOS Ltd, All rights reserved #ifndef __custom_defines_h__ #define __custom_defines_h__ From 9674ae3328a724c5da918142166344a08bc9052e Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 18 Nov 2019 11:36:41 +0000 Subject: [PATCH 06/19] Update copyright date range. --- tests/app_test_i2s_loopback/LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app_test_i2s_loopback/LICENSE.txt b/tests/app_test_i2s_loopback/LICENSE.txt index c7b8c711..5fee4f02 100644 --- a/tests/app_test_i2s_loopback/LICENSE.txt +++ b/tests/app_test_i2s_loopback/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2016-2018, XMOS, All rights reserved. +Copyright (c) 2016-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. From f91728485cfed8f48e64c1f93b5df975d167bd73 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 18 Nov 2019 13:08:44 +0000 Subject: [PATCH 07/19] Add missing constant --- examples/AN00246_xua_example/src/xua_conf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/AN00246_xua_example/src/xua_conf.h b/examples/AN00246_xua_example/src/xua_conf.h index d879e272..6fa7ae62 100644 --- a/examples/AN00246_xua_example/src/xua_conf.h +++ b/examples/AN00246_xua_example/src/xua_conf.h @@ -21,5 +21,6 @@ #define PID_AUDIO_1 1 #define PID_AUDIO_2 2 #define XUA_DFU_EN 0 /* Disable DFU (for simplicity of example */ +#define MIC_DUAL_ENABLED 0 // Use multiple thread #endif From c8299998c87f9087524839b92b249b2b7e36695a Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 18 Nov 2019 13:16:05 +0000 Subject: [PATCH 08/19] Update copyright date range. --- examples/AN00246_xua_example/LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/AN00246_xua_example/LICENSE.txt b/examples/AN00246_xua_example/LICENSE.txt index 82cfb860..8b37ec93 100644 --- a/examples/AN00246_xua_example/LICENSE.txt +++ b/examples/AN00246_xua_example/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2018, XMOS, All rights reserved. +Copyright (c) 2018-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. From f594d1d4232e3c35b644055f7ff2ef46e4b41ad0 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Tue, 19 Nov 2019 09:59:18 +0000 Subject: [PATCH 09/19] Add missing #define and update copyright date range. --- examples/AN00247_xua_example_spdif_tx/src/xua_conf.h | 3 ++- examples/AN00248_xua_example_pdm_mics/src/xua_conf.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h b/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h index d83f5a2e..ccbaaa91 100644 --- a/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h +++ b/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved #ifndef _XUA_CONF_H_ #define _XUA_CONF_H_ @@ -26,5 +26,6 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 +#define MIC_DUAL_ENABLED 0 // Use multiple thread #endif diff --git a/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h b/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h index 8cdf256e..b28ede56 100644 --- a/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h +++ b/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved #ifndef _XUA_CONF_H_ #define _XUA_CONF_H_ @@ -25,5 +25,6 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 +#define MIC_DUAL_ENABLED 0 // Use multiple thread #endif From e097b5dc3dc82962e74541bc94e4fca34dbb3092 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Tue, 19 Nov 2019 09:59:37 +0000 Subject: [PATCH 10/19] Update copyright date range. --- examples/AN00246_xua_example/src/xua_conf.h | 2 +- examples/AN00247_xua_example_spdif_tx/LICENSE.txt | 2 +- examples/AN00248_xua_example_pdm_mics/LICENSE.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/AN00246_xua_example/src/xua_conf.h b/examples/AN00246_xua_example/src/xua_conf.h index 6fa7ae62..2c8629ea 100644 --- a/examples/AN00246_xua_example/src/xua_conf.h +++ b/examples/AN00246_xua_example/src/xua_conf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved #ifndef _XUA_CONF_H_ #define _XUA_CONF_H_ diff --git a/examples/AN00247_xua_example_spdif_tx/LICENSE.txt b/examples/AN00247_xua_example_spdif_tx/LICENSE.txt index 236b6d1a..381126d4 100644 --- a/examples/AN00247_xua_example_spdif_tx/LICENSE.txt +++ b/examples/AN00247_xua_example_spdif_tx/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2018, XMOS, All rights reserved. +Copyright (c) 2018-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. diff --git a/examples/AN00248_xua_example_pdm_mics/LICENSE.txt b/examples/AN00248_xua_example_pdm_mics/LICENSE.txt index dd731b32..bdf72741 100644 --- a/examples/AN00248_xua_example_pdm_mics/LICENSE.txt +++ b/examples/AN00248_xua_example_pdm_mics/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2018, XMOS, All rights reserved. +Copyright (c) 2018-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. From 4ff6815d07fc4292acaae644f916ada8d4f42e90 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Tue, 19 Nov 2019 10:35:22 +0000 Subject: [PATCH 11/19] Add missing #define and switch to using the single-threaded, dual PDM microphone design. --- examples/AN00246_xua_example/src/xua_conf.h | 3 ++- examples/AN00247_xua_example_spdif_tx/src/xua_conf.h | 3 ++- examples/AN00248_xua_example_pdm_mics/src/xua_conf.h | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/AN00246_xua_example/src/xua_conf.h b/examples/AN00246_xua_example/src/xua_conf.h index 2c8629ea..61a4de4b 100644 --- a/examples/AN00246_xua_example/src/xua_conf.h +++ b/examples/AN00246_xua_example/src/xua_conf.h @@ -21,6 +21,7 @@ #define PID_AUDIO_1 1 #define PID_AUDIO_2 2 #define XUA_DFU_EN 0 /* Disable DFU (for simplicity of example */ -#define MIC_DUAL_ENABLED 0 // Use multiple thread +#define MIC_DUAL_ENABLED 1 // Use single-threaded design with dual PDM microphones +#define MIC_ARRAY_FRAME_SIZE 240 #endif diff --git a/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h b/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h index ccbaaa91..c572d59f 100644 --- a/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h +++ b/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h @@ -26,6 +26,7 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 -#define MIC_DUAL_ENABLED 0 // Use multiple thread +#define MIC_DUAL_ENABLED 1 // Use single-threaded design with dual PDM microphones +#define MIC_ARRAY_FRAME_SIZE 240 #endif diff --git a/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h b/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h index b28ede56..fa0a015f 100644 --- a/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h +++ b/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h @@ -25,6 +25,7 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 -#define MIC_DUAL_ENABLED 0 // Use multiple thread +#define MIC_DUAL_ENABLED 1 // Use single-threaded design with dual PDM microphones +#define MIC_ARRAY_FRAME_SIZE 240 #endif From 2aaa12e60b021522f3d1c25d59197b1e75cd5bc1 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Thu, 21 Nov 2019 16:57:56 +0000 Subject: [PATCH 12/19] Remove the default definition of MIC_ARRAY_MAX_FRAME_SIZE_LOG2. It has been moved to mic_array_frame.h. Establish a value for MIC_ARRAY_FRAME_SIZE and MIC_DUAL_FRAME_SIZE if they have not already been defined. Give them the value of XUA_MIC_FRAME_SIZE in this case. --- lib_xua/src/core/pdm_mics/mic_array_conf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_xua/src/core/pdm_mics/mic_array_conf.h b/lib_xua/src/core/pdm_mics/mic_array_conf.h index 2da348df..81e062b4 100644 --- a/lib_xua/src/core/pdm_mics/mic_array_conf.h +++ b/lib_xua/src/core/pdm_mics/mic_array_conf.h @@ -4,8 +4,8 @@ #include "xua_conf_full.h" -#ifndef MIC_ARRAY_MAX_FRAME_SIZE_LOG2 -#define MIC_ARRAY_MAX_FRAME_SIZE_LOG2 0 +#ifndef MIC_ARRAY_FRAME_SIZE +#define MIC_ARRAY_FRAME_SIZE (XUA_MIC_FRAME_SIZE) #endif #ifndef MIC_ARRAY_NUM_MICS @@ -13,7 +13,7 @@ #endif #ifndef MIC_DUAL_FRAME_SIZE -#define MIC_DUAL_FRAME_SIZE (MIC_ARRAY_FRAME_SIZE) +#define MIC_DUAL_FRAME_SIZE (XUA_MIC_FRAME_SIZE) #endif #endif /* MIC_ARRAY_CONF_H_ */ From 241afbe7e6d36278e2a7c825240f7d8e0f795be3 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Thu, 21 Nov 2019 16:58:24 +0000 Subject: [PATCH 13/19] Establish a default value for XUA_MIC_FRAME_SIZE. --- lib_xua/api/xua_conf_default.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib_xua/api/xua_conf_default.h b/lib_xua/api/xua_conf_default.h index b7bd71cf..9bfa7bbd 100644 --- a/lib_xua/api/xua_conf_default.h +++ b/lib_xua/api/xua_conf_default.h @@ -288,6 +288,13 @@ #define PDM_MIC_INDEX (0) #endif +/** + * @brief Size of a frame of microphone data samples. Default: 1 + */ +#ifndef XUA_MIC_FRAME_SIZE +#define XUA_MIC_FRAME_SIZE (1) +#endif + /** * @brief Enable MIDI functionality including buffering, descriptors etc. Default: DISABLED */ From eeca5fdd60a6142211d0bf00848b9521ee510538 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Thu, 21 Nov 2019 17:32:39 +0000 Subject: [PATCH 14/19] Move the default definition of MIC_ARRAY_MAX_FRAME_SIZE_LOG2 to mic_array_conf.h so that an assembler file can pick it up using a #include. --- lib_xua/src/core/pdm_mics/mic_array_conf.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib_xua/src/core/pdm_mics/mic_array_conf.h b/lib_xua/src/core/pdm_mics/mic_array_conf.h index 81e062b4..e88cdbb6 100644 --- a/lib_xua/src/core/pdm_mics/mic_array_conf.h +++ b/lib_xua/src/core/pdm_mics/mic_array_conf.h @@ -8,6 +8,13 @@ #define MIC_ARRAY_FRAME_SIZE (XUA_MIC_FRAME_SIZE) #endif +// The default definition of MIC_ARRAY_MAX_FRAME_SIZE_LOG2 must appear in this file +// because an assembler file #includes it. +// The assembler does not understand C language syntax, only C pre-processor syntax. +#ifndef MIC_ARRAY_MAX_FRAME_SIZE_LOG2 +#define MIC_ARRAY_MAX_FRAME_SIZE_LOG2 (0) +#endif + #ifndef MIC_ARRAY_NUM_MICS #define MIC_ARRAY_NUM_MICS (XUA_NUM_PDM_MICS) #endif From 3a1c1b0265bfe90a936c0b7b388ea989a46b4885 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Fri, 22 Nov 2019 10:08:36 +0000 Subject: [PATCH 15/19] Only override the value of MIC_DUAL_FRAME_SIZE if MIC_DUAL_ENABLED is set to true. --- lib_xua/src/core/pdm_mics/mic_array_conf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_xua/src/core/pdm_mics/mic_array_conf.h b/lib_xua/src/core/pdm_mics/mic_array_conf.h index e88cdbb6..ededfedf 100644 --- a/lib_xua/src/core/pdm_mics/mic_array_conf.h +++ b/lib_xua/src/core/pdm_mics/mic_array_conf.h @@ -19,8 +19,12 @@ #define MIC_ARRAY_NUM_MICS (XUA_NUM_PDM_MICS) #endif +// MIC_DUAL_FRAME_SIZE has no meaning if MIC_DUAL_ENABLED is false. +// Only define MIC_DUAL_FRAME_SIZE if MIC_DUAL_ENABLED is true. +#if defined(MIC_DUAL_ENABLED) && (MIC_DUAL_ENABLED != 0) #ifndef MIC_DUAL_FRAME_SIZE #define MIC_DUAL_FRAME_SIZE (XUA_MIC_FRAME_SIZE) #endif +#endif #endif /* MIC_ARRAY_CONF_H_ */ From 82d364a25d8069004a4b6c44ed6405e027f018db Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Fri, 22 Nov 2019 11:19:07 +0000 Subject: [PATCH 16/19] Disable single-threaded mic array processing for these examples. Remove the unnecessary definition of MIC_ARRAY_FRAME_SIZE. --- examples/AN00246_xua_example/src/xua_conf.h | 3 +-- examples/AN00247_xua_example_spdif_tx/src/xua_conf.h | 3 +-- examples/AN00248_xua_example_pdm_mics/src/xua_conf.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/AN00246_xua_example/src/xua_conf.h b/examples/AN00246_xua_example/src/xua_conf.h index 61a4de4b..c969f6cf 100644 --- a/examples/AN00246_xua_example/src/xua_conf.h +++ b/examples/AN00246_xua_example/src/xua_conf.h @@ -21,7 +21,6 @@ #define PID_AUDIO_1 1 #define PID_AUDIO_2 2 #define XUA_DFU_EN 0 /* Disable DFU (for simplicity of example */ -#define MIC_DUAL_ENABLED 1 // Use single-threaded design with dual PDM microphones -#define MIC_ARRAY_FRAME_SIZE 240 +#define MIC_DUAL_ENABLED 0 // Use multi-threaded design #endif diff --git a/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h b/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h index c572d59f..b2867ee7 100644 --- a/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h +++ b/examples/AN00247_xua_example_spdif_tx/src/xua_conf.h @@ -26,7 +26,6 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 -#define MIC_DUAL_ENABLED 1 // Use single-threaded design with dual PDM microphones -#define MIC_ARRAY_FRAME_SIZE 240 +#define MIC_DUAL_ENABLED 0 // Use multi-threaded design #endif diff --git a/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h b/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h index fa0a015f..e2f0f84f 100644 --- a/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h +++ b/examples/AN00248_xua_example_pdm_mics/src/xua_conf.h @@ -25,7 +25,6 @@ #define AUDIO_CLASS_FALLBACK 0 #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 -#define MIC_DUAL_ENABLED 1 // Use single-threaded design with dual PDM microphones -#define MIC_ARRAY_FRAME_SIZE 240 +#define MIC_DUAL_ENABLED 0 // Use multi-threaded design #endif From f22027564d5bc1787114546bda03b9b1976e0e8c Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 25 Nov 2019 12:10:26 +0000 Subject: [PATCH 17/19] Use the XUA-specific microphone frame size constant instead of directly overriding the microphone frame size constant from lib_mic_array. Multiple constants may be derived from XUA_MIC_FRAME_SIZE. The override of MIC_ARRAY_FRAME_SIZE occurs in mic_array_conf.h. --- tests/app_test_i2s_loopback/xua_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app_test_i2s_loopback/xua_conf.h b/tests/app_test_i2s_loopback/xua_conf.h index 29316351..70298c70 100644 --- a/tests/app_test_i2s_loopback/xua_conf.h +++ b/tests/app_test_i2s_loopback/xua_conf.h @@ -23,6 +23,6 @@ #define BCD_DEVICE 0x1234 #define XUA_DFU_EN 0 #define MIC_DUAL_ENABLED 1 //Use single thread, dual PDM mic -#define MIC_ARRAY_FRAME_SIZE 240 +#define XUA_MIC_FRAME_SIZE 240 #endif // __custom_defines_h__ From 471ab4548a60db66bb498b4af1eed2a19f5157d8 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Mon, 25 Nov 2019 13:48:58 +0000 Subject: [PATCH 18/19] Move the override of MIC_ARRAY_FRAME_SIZE from mic_array_conf.h in lib_xua to ap_conf.h in sw_xvf3510/app_xk/xvf3510_l71. This constant is only used in the audio pipelines, hence does not belong in the configuration of XUA. --- lib_xua/src/core/pdm_mics/mic_array_conf.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib_xua/src/core/pdm_mics/mic_array_conf.h b/lib_xua/src/core/pdm_mics/mic_array_conf.h index ededfedf..10840331 100644 --- a/lib_xua/src/core/pdm_mics/mic_array_conf.h +++ b/lib_xua/src/core/pdm_mics/mic_array_conf.h @@ -4,10 +4,6 @@ #include "xua_conf_full.h" -#ifndef MIC_ARRAY_FRAME_SIZE -#define MIC_ARRAY_FRAME_SIZE (XUA_MIC_FRAME_SIZE) -#endif - // The default definition of MIC_ARRAY_MAX_FRAME_SIZE_LOG2 must appear in this file // because an assembler file #includes it. // The assembler does not understand C language syntax, only C pre-processor syntax. From daf378e4a52a3940c5f8a9f14e95a4b48ab8f290 Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Tue, 26 Nov 2019 11:37:38 +0000 Subject: [PATCH 19/19] Add in the code to call HidInterfaceClassRequests(). It was inadvertently removed during the removal of the XUA_Endpoint0_lite_loop() function. --- lib_xua/src/core/endpoint0/xua_endpoint0.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index 3c92defa..91576287 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -617,6 +617,12 @@ void XUA_Endpoint0_loop(XUD_Result_t result, USB_SetupPacket_t sp, chanend c_ep0 device_reboot(); } } +#endif +#if( 0 < HID_CONTROLS ) + if (interfaceNum == INTERFACE_NUMBER_HID) + { + result = HidInterfaceClassRequests(ep0_out, ep0_in, &sp); + } #endif /* Check for: - Audio CONTROL interface request - always 0, note we check for DFU first * - Audio STREAMING interface request (In or Out)