]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/audio-preprocessing.git/blobdiff - file_demo_bios/k2g/components/sysmss.c
file_demo_bios/k2g: move the shared code to common folder, add file_io.gel
[processor-sdk/audio-preprocessing.git] / file_demo_bios / k2g / components / sysmss.c
diff --git a/file_demo_bios/k2g/components/sysmss.c b/file_demo_bios/k2g/components/sysmss.c
deleted file mode 100644 (file)
index b3b133e..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * *  Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * *  Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * *  Neither the name of Texas Instruments Incorporated nor the names of
- *    its contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-\r
-/*=================================================================\r
- *  sysmss.c: MSS creation routines.\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h>\r
-#include <ti/sysbios/BIOS.h>\r
-#include <xdc/runtime/System.h>\r
-\r
-#include <ti/mas/types/types.h>\r
-#include <ti/mas/util/ecomem.h>\r
-//#include <ti/mas/aer/mss.h>\r
-\r
-#include "mss/mss.h"\r
-#include "sys.h"\r
-\r
-/* Configuration for getSizes */\r
-mssSizeConfig_t mssSizeConfig = {\r
-  mss_SAMP_RATE_16K,    /* 16kHz sampling rate */\r
-  SYS_VMICS_MAX,        /* Maximum # of fixed mics (will be providing virtual here! */\r
-  0,                    /* No remote mics */\r
-  0,                    /* No "clean" mics */\r
-  0                     /* Beams not supported so we have to used fixed! */\r
-};\r
-\r
-/* Configuration for Open */\r
-mssConfig_t mssConfig = {\r
-  mss_SAMP_RATE_16K,    /* use 16kHz sampling rate */\r
-  SYS_VMICS_MAX,        /* use one virtual mic only by default */\r
-  0,                    /* No remote mics */\r
-  0,                    /* No "clean" mics */\r
-  SYS_MICS_MAX,         /* Microphone array has 8 mics */\r
-  0                     /* Beams not supported so we used the fixed! */\r
-};\r
-\r
-mssControl_t mssCtl = {\r
-  (mss_CTL_SWITCH_THRESH | mss_CTL_SWITCH_DURATION | mss_CTL_SWITCH_HNAGOVER),\r
-  {0, 0},   /* do not use modes */\r
-  {0, 0},   /* do not use source */\r
-  250,      /* sw-thresh in ms */\r
-  500,      /* sw-duration in ms */\r
-  500       /* sw-hangover in ms */\r
-};\r
-\r
-/*=================================================================\r
- *  void sysMssCreate(void)     Create beamformers\r
- *=================================================================*/\r
-void sysMssCreate(void)\r
-{\r
-  int err;\r
-  tint nbufs;\r
-  const ecomemBuffer_t  *bufs;\r
-  mssNewConfig_t mssNewConfig;\r
-//  bfControl_t   bfCtl;\r
-\r
-  System_printf("...Initializing MSS\n");\r
-  System_flush();\r
-\r
-  /* Configure MSS */\r
-  err = mssGetSizes(&nbufs, &bufs, &mssSizeConfig);\r
-  if (err != mss_NOERR) {\r
-    System_printf("*** MSS getSizes error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-  if (nbufs > SYS_COMP_MAXBUFS) {\r
-    System_printf("*** not enough buffer descriptors");\r
-    BIOS_exit(0);\r
-  }\r
-\r
-  /* Allocate memory for MSS */\r
-  mssNewConfig.sizeCfg = mssSizeConfig;   /* Use same configuration */\r
-  err = sysHeapAllocAll(nbufs, sysCompBufs, (const void*)bufs);\r
-  SYS_CHECK_ERROR(err);\r
-  \r
-  /* Give memory to MSS */\r
-  mssNewConfig.handle = (void*)0;     /* Indicate instance 0 */\r
-  sysContext.mssInst_p = NULL;\r
-  err = mssNew(&sysContext.mssInst_p, nbufs, sysCompBufs, &mssNewConfig);\r
-  if (err != mss_NOERR) {\r
-    System_printf("*** MSS New error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-\r
-  /* Open MSS for business */\r
-  err = mssOpen(sysContext.mssInst_p,&mssConfig);\r
-  if (err != mss_NOERR) {\r
-    System_printf("*** MSS open error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-  /* At this point MSS is open */\r
-\r
-  /* Reconfigure hangovers, etc. */\r
-  err = mssControl(sysContext.mssInst_p, &mssCtl);\r
-  if (err != mss_NOERR) {\r
-    System_printf("*** MSS control error: %d\n", err);\r
-    BIOS_exit(0);\r
-  }\r
-\r
-  System_printf("Done with MSS\n");\r
-  System_flush();\r
-\r
-} /* sysMssCreate */\r
-\r
-/* nothing past this point */\r
-\r