From 58eb2fe6126685107f906ddcf501df25cc368898 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 20 Aug 2019 16:41:49 +0100 Subject: [PATCH] Update AN00246 to API with master clock passed in --- CHANGELOG.rst | 3 ++- examples/AN00246_xua_example/Makefile | 8 ++++---- examples/AN00246_xua_example/src/app_xua_simple.xc | 14 ++------------ lib_xua/src/core/warnings.xc | 4 ---- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 21d1484f..5af089b7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,7 +5,8 @@ lib_xua Change Log ----- * CHANGED: Remove sharing of global master clock port variable for - compatibility with tools 14.4 + compatibility with tools 14.4 (API change but preserve 0.1 + version as this is maintenance branch) * CHANGED: Remove obsolete -fsubword-select to clear warning in tools 14.4 0.1.2 diff --git a/examples/AN00246_xua_example/Makefile b/examples/AN00246_xua_example/Makefile index 7abafaa0..3852a325 100644 --- a/examples/AN00246_xua_example/Makefile +++ b/examples/AN00246_xua_example/Makefile @@ -3,14 +3,14 @@ APP_NAME = app_xua_simple TARGET = xk-audio-216-mc.xn # The flags passed to xcc when building the application -XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -fsubword-select -save-temps \ - -g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -DUSB_TILE=tile[1] \ - -DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope +XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -save-temps \ + -g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -DUSB_TILE=tile[1] \ + -DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope # The USED_MODULES variable lists other module used by the application. These # modules will extend the SOURCE_DIRS, INCLUDE_DIRS and LIB_DIRS variables. # Modules are expected to be in the directory above the BASE_DIR directory. -USED_MODULES = lib_xua lib_device_control lib_xud module_i2c_shared module_i2c_single_port module_locks +USED_MODULES = lib_xua lib_xud module_i2c_shared module_i2c_single_port #============================================================================= # The following part of the Makefile includes the common build infrastructure diff --git a/examples/AN00246_xua_example/src/app_xua_simple.xc b/examples/AN00246_xua_example/src/app_xua_simple.xc index bc5a19ee..7db7639a 100644 --- a/examples/AN00246_xua_example/src/app_xua_simple.xc +++ b/examples/AN00246_xua_example/src/app_xua_simple.xc @@ -24,13 +24,7 @@ buffered out port:32 p_bclk = PORT_I2S_BCLK; /* I2S L/R-clock */ /* Note, declared unsafe as sometimes we want to share this port e.g. PDM mics and I2S use same master clock IO */ -port p_mclk_in_ = PORT_MCLK_IN; - -unsafe -{ - /* TODO simplify this */ - unsafe port p_mclk_in; /* Audio master clock input */ -} +in port p_mclk_in = PORT_MCLK_IN; in port p_for_mclk_count = PORT_MCLK_COUNT; /* Extra port for counting master clock ticks */ in port p_mclk_in2 = PORT_MCLK_IN2; @@ -85,11 +79,7 @@ int main() /* IOHub core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */ on tile[0]: { - unsafe - { - p_mclk_in = p_mclk_in_; - } - XUA_AudioHub(c_aud); + XUA_AudioHub(c_aud, p_mclk_in); } } diff --git a/lib_xua/src/core/warnings.xc b/lib_xua/src/core/warnings.xc index 452a2165..8530758f 100644 --- a/lib_xua/src/core/warnings.xc +++ b/lib_xua/src/core/warnings.xc @@ -60,10 +60,6 @@ Warnings relating to configuration defines located in this XC source file rather #warning AUDIO_CLASS not defined, using 2 #endif -#ifndef AUDIO_CLASS_FALLBACK -#warning AUDIO_CLASS_FALLBACK not defined, using 0 (i.e. disabled) -#endif - /* Sanity check on FS channel counts */ #if (NUM_USB_CHAN_OUT_FS > NUM_USB_CHAN_OUT) #error NUM_USB_CHAN_OUT_FS expected to be less than or equal to NUM_USB_CHAN_OUT