@@ -13,7 +13,7 @@ static uint8 isTriggerEvent(SCOPE_MAIN *pTScope, uint64 curTrgValue);
1313static uint64 getTriggerValue (SCOPE_MAIN * pTScope );
1414static void sampleData (SCOPE_MAIN * pTScope );
1515
16- ALIGNTYPE ScopeArray [SCOPE_SIZE ];
16+ //extern ALIGNTYPE ScopeArray[];
1717
1818#if defined(__COMPILER_CODEWARRIOR_ECLIPSE__ )
1919#pragma push
@@ -44,7 +44,7 @@ static tBlockFunctions* getBlockFunction(const tBlockFunctions* blockFuncTable,
4444/************************************************/
4545/* Scope_Main_Init */
4646/************************************************/
47- void Scope_Main_Init (SCOPE_MAIN * pTScope )
47+ void Scope_Main_Init (SCOPE_MAIN * pTScope , void * scopeArray , uint16_t scope_size )
4848{
4949 uint8 i ;
5050
@@ -55,7 +55,7 @@ void Scope_Main_Init(SCOPE_MAIN *pTScope)
5555 pTScope -> dataSize [i ] = (uint8 )0 ;
5656 }
5757
58- pTScope -> arrayAddr = (void * )ScopeArray ;
58+ pTScope -> arrayAddr = (void * )scopeArray ;
5959 pTScope -> trgLevel = (int32 )0 ;
6060 pTScope -> trgLastValue = (int32 )0 ;
6161 pTScope -> trgAddr = (void * )0 ;
@@ -72,9 +72,10 @@ void Scope_Main_Init(SCOPE_MAIN *pTScope)
7272 pTScope -> trgEventPos = (int32 )0 ;
7373 pTScope -> trgCountReached = (uint8 )0 ;
7474 pTScope -> trgCount = (uint32 )0 ;
75- pTScope -> maxUsedLength = SCOPE_SIZE ;
75+ pTScope -> maxUsedLength = ( uint32 ) scope_size ;
7676 pTScope -> trgEdge = EDGE_RISING ;
77- pTScope -> arraySize = SCOPE_SIZE ;
77+ pTScope -> arraySize = (uint32 )scope_size ;
78+ pTScope -> scopeSize = (uint32 )scope_size ;
7879
7980 TableStruct -> piScope = pTScope ;
8081}
@@ -107,7 +108,7 @@ void Scope_Main_Update(SCOPE_MAIN *pTScope)
107108
108109 /* if size of next data size would exceed SCOPE_SIZE, the */
109110 /* offline sampling mode will be stopped (change to idle state) */
110- if ((pTScope -> offlinePtr + pTScope -> dataSizeTotal ) > SCOPE_SIZE )
111+ if ((pTScope -> offlinePtr + pTScope -> dataSizeTotal ) > pTScope -> scopeSize )
111112 {
112113 pTScope -> state = SCOPE_IDLE ;
113114 }
@@ -134,7 +135,7 @@ void Scope_Main_Update(SCOPE_MAIN *pTScope)
134135 {
135136 pTScope -> stfCnt = (uint16 )0 ;
136137 /* reset array ptr if next dataset would exceed scope buffer size */
137- if (pTScope -> offlinePtr + pTScope -> dataSizeTotal > SCOPE_SIZE )
138+ if (pTScope -> offlinePtr + pTScope -> dataSizeTotal > pTScope -> scopeSize )
138139 {
139140 pTScope -> offlinePtr = (int32 )0 ;
140141 }
@@ -223,7 +224,7 @@ void Scope_Main_Update(SCOPE_MAIN *pTScope)
223224 {
224225 pTScope -> stfCnt = (uint16 )0 ;
225226
226- if ((pTScope -> offlinePtr + pTScope -> dataSizeTotal ) > SCOPE_SIZE )
227+ if ((pTScope -> offlinePtr + pTScope -> dataSizeTotal ) > pTScope -> scopeSize )
227228 {
228229 pTScope -> offlinePtr = (uint32 )0 ;
229230 }
@@ -417,8 +418,8 @@ uint8 Scope_Main_Save(SCOPE_MAIN *pTScope, uint8 *ucData, uint8 ucFRMlen)
417418#error DATA WIDTH NOT DEFINED
418419#endif
419420
420- pTScope -> maxUsedLength = SCOPE_SIZE - \
421- (SCOPE_SIZE % pTScope -> dataSizeTotal );
421+ pTScope -> maxUsedLength = pTScope -> scopeSize - \
422+ (pTScope -> scopeSize % pTScope -> dataSizeTotal );
422423
423424 ptr += (uint8 )5 ;
424425 i ++ ;
0 commit comments