diff options
author | Octasic Inc <support@octasic.com> | 2007-09-28 13:40:54 +0200 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-02-27 21:07:48 +0200 |
commit | ac89cd86e5cd7d7eb95c832abefe5e6299fd0061 (patch) | |
tree | 1c7391acf89af50f1fe3b5775f3009f6778cc78a /software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c | |
parent | 433987eb1e7f7efdb55c2d6fc50f29d73c83aed0 (diff) |
importing OCT612x-01.00-PR49
Diffstat (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c')
-rw-r--r-- | software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c | 43 |
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 6965d8d..5fc5e3d 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 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -248,7 +248,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. */ @@ -271,23 +271,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; + } } @@ -328,12 +335,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, @@ -343,6 +352,8 @@ UINT32 Oct6100DebugSelectChannelSer( if ( ulResult != cOCT6100_ERR_OK ) return ulResult; } + + /* XXX: What about the silence TSI usSinSilenceEventIndex ?? */ } |