Change name of CB emptyFlag to drainFlag
authorFrank Livingston <frank-livingston@ti.com>
Thu, 22 Jun 2017 00:50:20 +0000 (19:50 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Thu, 22 Jun 2017 00:50:20 +0000 (19:50 -0500)
pasdk/common/aspDecOpCircBuf_common.c
pasdk/common/aspDecOpCircBuf_common.h
pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
pasdk/test_dsp/framework/aspDecOpCircBuf_master.c

index 2ca01bcbd626680522046fd0d772e8ba17e442e4..8b69e794ed3788a8d429a50bfcc31711ea60ee9b 100644 (file)
@@ -155,7 +155,7 @@ Int cbLog(
     Cache_wait();
 
     Log_info1("CB: %s", (IArg)locInfo);
-    Log_info3("CB: readerActiveFlag=%d, writerActiveFlag=%d, emptyFlag=%d", pCb->readerActiveFlag, pCb->writerActiveFlag, pCb->emptyFlag);
+    Log_info3("CB: readerActiveFlag=%d, writerActiveFlag=%d, drainFlag=%d", pCb->readerActiveFlag, pCb->writerActiveFlag, pCb->drainFlag);
     Log_info4("CB: afRdIdx=%d, pcmRdIdx=%d, afWrtIdx=%d, numAfCb=%d", pCb->afRdIdx, pCb->pcmRdIdx, 
         pCb->afWrtIdx, 
         pCb->numAfCb);
index 2303d6960ed7e482f6dcf0baac43eb62d92997fb..dd872ec4523fb0ac99a0e9ad5742bd3314923ac4 100644 (file)
@@ -121,7 +121,7 @@ typedef struct PAF_AST_DecOpCircBuf
     Int16 strFrameLen;      // stream frame length (output transaction size)
     Int8 writerActiveFlag;  // flag indicates whether CB writer is active: FALSE - writer not active, TRUE - writer active
     Int8 readerActiveFlag;  // flag indicates whether CB reader is active: FALSE - reader not active, TRUE - reader active
-    Int8 emptyFlag;         // flag indicates whether reader should empty (drain) remaining frames in CB: FALSE - reader should not drain, TRUE - reader should drain
+    Int8 drainFlag;         // flag indicates whether reader should drain (empty) remaining frames in CB: FALSE - reader should not drain, TRUE - reader should drain
     Int8 errUndCnt;         // underflow count
     Int8 errOvrCnt;         // overflow count
     PAF_AudioData *pcmBufEnd;  // PCM buffer, contains PCM data associated with audio frames end
index 31532010ce5082b43cfd48d598efb42756a1b9e6..1ed6f66fbcd5a153a4f7e199354ae8cc7a5e8987 100644 (file)
@@ -118,7 +118,7 @@ Int cbWriteStart(
             
     // update flags
     pCb->writerActiveFlag = 1;
-    pCb->emptyFlag = 0;
+    pCb->drainFlag = 0;
     //pCb->afLagIdx = 0;
     
     // Write back circular buffer configuration
@@ -157,7 +157,7 @@ Int cbWriteStop(
     
     // update flags
     pCb->writerActiveFlag = 0;
-    pCb->emptyFlag = 1;
+    pCb->drainFlag = 1;
 
     // Write back circular buffer configuration
     Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
index f79f85128dbdd25db0b9ec8491776a4374c830a0..c00f5e3e5d044b867bb3afea33efee0ac8cc7628 100644 (file)
@@ -202,7 +202,7 @@ Int cbInit(
     // reset read/write flags
     pCb->writerActiveFlag = 0;
     pCb->readerActiveFlag = 0;
-    pCb->emptyFlag = 0;
+    pCb->drainFlag = 0;
     
     // reset error counts
     pCb->errUndCnt = 0;
@@ -454,7 +454,7 @@ Int cbInitSourceSel(
     {
         pCb->writerActiveFlag = 0;
         pCb->readerActiveFlag = 0;
-        pCb->emptyFlag = 0;
+        pCb->drainFlag = 0;
     }
     
     // reset error counts
@@ -592,11 +592,11 @@ Int cbReadAf(
 
     //Log_info1("cbReadAf:afCb=0x%04x", (IArg)pCb->afCb); // debug
 
-    if ((pCb->writerActiveFlag == 1) && (pCb->emptyFlag == 1))
+    if ((pCb->writerActiveFlag == 1) && (pCb->drainFlag == 1))
     {
         // This shouldn't occur:
         //  writer is active AND draining circular buffer
-        //Log_info2("cbReadAf: ERROR: writerActiveFlag=%d, emptyFlag=%d", pCb->writerActiveFlag, pCb->emptyFlag); // FL: debug
+        //Log_info2("cbReadAf: ERROR: writerActiveFlag=%d, drainFlag=%d", pCb->writerActiveFlag, pCb->drainFlag); // FL: debug
         SW_BREAKPOINT; // FL: debug
         
         // Leave the gate
@@ -605,8 +605,8 @@ Int cbReadAf(
         return ASP_DECOP_CB_READ_INVSTATE;
     }
 
-    //if (((pCb->writerActiveFlag == 0) && (pCb->emptyFlag == 0)) || (pCb->afLagIdx < pCb->afInitialLag))
-    if ((pCb->writerActiveFlag == 0) && (pCb->emptyFlag == 0))
+    //if (((pCb->writerActiveFlag == 0) && (pCb->drainFlag == 0)) || (pCb->afLagIdx < pCb->afInitialLag))
+    if ((pCb->writerActiveFlag == 0) && (pCb->drainFlag == 0))
     {
         //
         // No active writer, not draining circular buffer.
@@ -647,7 +647,7 @@ Int cbReadAf(
     }
     
     
-    // (writerActiveFlag,emptyFlag)=(1,0) and (0,1) are left
+    // (writerActiveFlag,drainFlag)=(1,0) and (0,1) are left
     // Here we are checking (1,0) state here
     if (pCb->writerActiveFlag == 1)
     {
@@ -663,14 +663,15 @@ Int cbReadAf(
             cbReadMuteWithLastAfInfo(pCb, pAfRd);
             //SW_BREAKPOINT; // FL: debug
             
-            {
-                static Uint8 toggleState = 0;
-                if (toggleState == 0)
-                    GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_107);
-                else
-                    GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107);
-                toggleState = ~(toggleState);
-            }
+            // debug
+            //{
+            //    static Uint8 toggleState = 0;
+            //    if (toggleState == 0)
+            //        GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_107);
+            //    else
+            //        GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107);
+            //    toggleState = ~(toggleState);
+            //}
 
             #ifdef CB_RW_OP_CAP_PP // debug
             if (pCb->cb_opCnt < CB_OP_COUNT_MAX)
@@ -700,7 +701,7 @@ Int cbReadAf(
         }
     }
     
-    if ((pCb->writerActiveFlag == 1) || (pCb->emptyFlag == 1))
+    if ((pCb->writerActiveFlag == 1) || (pCb->drainFlag == 1))
     {
         //
         // Writer active or draining remaining frames in circular buffer.
@@ -841,7 +842,7 @@ Int cbReadAf(
         }
     }
     
-    if (pCb->emptyFlag == 1)
+    if (pCb->drainFlag == 1)
     {
         //
         // Writer inactive, but remaining frames in circular buffer.
@@ -849,7 +850,7 @@ Int cbReadAf(
         //
         if (pCb->numAfCb <= 0)
         {
-            pCb->emptyFlag = 0;
+            pCb->drainFlag = 0;
         }
     }