summaryrefslogtreecommitdiff
path: root/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c')
-rw-r--r--software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c
index ac25f81..1f4de01 100644
--- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c
+++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c
@@ -22,9 +22,9 @@ You should have received a copy of the GNU General Public License
along with the OCT6100 GPL API; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-$Octasic_Release: OCT612xAPI-01.00-PR48 $
+$Octasic_Release: OCT612xAPI-01.00-PR49 $
-$Octasic_Revision: 64 $
+$Octasic_Revision: 65 $
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
@@ -257,7 +257,7 @@ UINT32 Oct6100DebugSelectChannelSer(
mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pTempChanEntry, pSharedInfo->DebugInfo.usCurrentDebugChanIndex )
/* Release the extra TSI memory entry and reprogram the TSST control memory if required. */
- if ( pTempChanEntry->usExtraSinTsiDependencyCnt == 1 )
+ if ( pTempChanEntry->usExtraSinTsiDependencyCnt >= 1 )
{
/*=======================================================================*/
/* Clear memcpy operations. */
@@ -280,23 +280,30 @@ UINT32 Oct6100DebugSelectChannelSer(
/*=======================================================================*/
- ulResult = Oct6100ApiReleaseTsiMemEntry( f_pApiInstance, pTempChanEntry->usExtraSinTsiMemIndex );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
-
- if ( pTempChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX )
+ /* If we are the last dependency using the extra Sin TSI, release it */
+ if ( pTempChanEntry->usExtraSinTsiDependencyCnt == 1 )
{
- ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance,
- pTempChanEntry->usSinTsstIndex,
- pTempChanEntry->usSinSoutTsiMemIndex,
- pTempChanEntry->TdmConfig.bySinPcmLaw );
- }
+ ulResult = Oct6100ApiReleaseTsiMemEntry( f_pApiInstance, pTempChanEntry->usExtraSinTsiMemIndex );
+ if ( ulResult != cOCT6100_ERR_OK )
+ return ulResult;
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
+ /* Do not forget to reprogram the TSST control memory. */
+ if ( pTempChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX )
+ {
+ ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance,
+ pTempChanEntry->usSinTsstIndex,
+ pTempChanEntry->usSinSoutTsiMemIndex,
+ pTempChanEntry->TdmConfig.bySinPcmLaw );
+ if ( ulResult != cOCT6100_ERR_OK )
+ return ulResult;
+ }
+ pTempChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX;
+
+ /* XXX: What about the silence TSI usSinSilenceEventIndex ?? */
+ }
pTempChanEntry->usExtraSinTsiDependencyCnt--;
- pTempChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX;
+
}
}
@@ -337,12 +344,14 @@ UINT32 Oct6100DebugSelectChannelSer(
/* Check if the API needs to reserve an extra TSI memory to load the SIN signal. */
if ( pSharedInfo->ChipConfig.fEnableChannelRecording == TRUE )
{
+ /* Reserve the extra Sin TSI memory if it was not already reserved. */
if ( pChanEntry->usExtraSinTsiMemIndex == cOCT6100_INVALID_INDEX )
{
ulResult = Oct6100ApiReserveTsiMemEntry( f_pApiInstance, &pChanEntry->usExtraSinTsiMemIndex );
if ( ulResult != cOCT6100_ERR_OK )
return ulResult;
+ /* Reprogram the TSST control memory accordingly. */
if ( pChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX )
{
ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance,
@@ -352,6 +361,8 @@ UINT32 Oct6100DebugSelectChannelSer(
if ( ulResult != cOCT6100_ERR_OK )
return ulResult;
}
+
+ /* XXX: What about the silence TSI usSinSilenceEventIndex ?? */
}