]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/commitdiff
Addressed review comments for cbuff driver.
authorKALYAN VAGVALA <k-vagvala@ti.com>
Mon, 19 Apr 2021 06:50:10 +0000 (12:20 +0530)
committerSujith Shivalingappa <sujith.s@ti.com>
Tue, 20 Apr 2021 19:08:04 +0000 (14:08 -0500)
packages/ti/drv/cbuff/soc/awr294x/cbuff_soc.c
packages/ti/drv/cbuff/src/cbuff.c
packages/ti/drv/cbuff/src/cbuff_internal.h

index 32cb2a9a4972d99448773632de2f73176d24be5a..92de1181b51f08f1f9067825faf6745d2bf743af 100644 (file)
@@ -82,6 +82,9 @@
 /*                          Global Variables                                  */
 /* ========================================================================== */
 
+CBUFF_DriverMCB    g_cbuffDriver = {0};
+CBUFF_Session      g_cbuffSession[CBUFF_MAX_NUM_SESSION] = {0u};
+
 /**
  * @brief   This is the AWR294x Hardware attributes which are used by the
  * CBUFF driver
@@ -160,7 +163,9 @@ CBUFF_Hw_Attrib gCBUFFHwAttribute =
      *  thus defined from 1 to 8
      ***************************************************************/
     1U,
-    8U
+    8U,
+    (uint32_t)&g_cbuffDriver,
+    (uint32_t)&g_cbuffSession[0]
 };
 
 
@@ -257,4 +262,3 @@ bool CBUFF_isMultipleChirpNonInterleavedDataFormatSupported(CBUFF_DataFmt dataFm
 {
     return(false);
 }
-
index 3a02da4b67050dc15fc4baab6812d4da70d2d17b..641aa625f9dd5dd92e454c44439823b53f3a2c7d 100644 (file)
@@ -54,8 +54,6 @@
 #include <ti/osal/osal.h>
 #include <ti/csl/hw_types.h>
 
-CBUFF_DriverMCB    g_cbuffDriver = {0};
-CBUFF_Session      g_cbuffSession[CBUFF_MAX_NUM_SESSION] = {0u};
 /* ========================================================================== */
 /*                          Function Declarations                             */
 /* ========================================================================== */
@@ -1517,7 +1515,7 @@ CBUFF_Handle CBUFF_init (CBUFF_InitCfg* ptrInitCfg, int32_t* errCode)
     }
 
     /* Allocate memory for the CBUFF Driver: */
-    ptrDriverMCB = &g_cbuffDriver;
+    ptrDriverMCB = (CBUFF_DriverMCB*)gCBUFFHwAttribute.cbuffInstanceAddr;
     if (ptrDriverMCB == NULL)
     {
         /* Error: Out of memory */
@@ -1534,7 +1532,7 @@ CBUFF_Handle CBUFF_init (CBUFF_InitCfg* ptrInitCfg, int32_t* errCode)
     memset ((void *)ptrDriverMCB, 0, sizeof(CBUFF_DriverMCB));
 
     /* Allocate memory for the sessions: */
-    ptrDriverMCB->ptrSessionTable = &g_cbuffSession[0];
+    ptrDriverMCB->ptrSessionTable = (CBUFF_Session*)gCBUFFHwAttribute.cbuffSessionAddr;
     if (ptrDriverMCB->ptrSessionTable == NULL)
     {
         /* Error: Out of memory */
index 53875b0e598dc86a6015e9198dd13b7c6e73051f..68d90252daff1c4c575a9abaaf0230ffce6e1aba 100644 (file)
@@ -359,6 +359,16 @@ typedef struct CBUFF_Hw_Attrib_t
      * modes which are supported by the platform
      */
     uint32_t        chirpModeEndIndex;
+
+    /**
+     * @brief   CBUFF MCB address
+     */
+    uint32_t    cbuffInstanceAddr;
+
+    /**
+     * @brief   CBUFF Session address
+     */
+    uint32_t     cbuffSessionAddr;
 }CBUFF_Hw_Attrib;
 
 /**