From 922323f06b53e887acc11d93e391c6991a16c580 Mon Sep 17 00:00:00 2001 From: yutaka Date: Fri, 31 Aug 2007 09:54:18 +0000 Subject: [PATCH] add aging test git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@267 4ee2a332-4b2b-5046-8439-1ba90f034370 --- build/tests/mcu/mcu-1/ARM7/src/main.c | 34 ++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/build/tests/mcu/mcu-1/ARM7/src/main.c b/build/tests/mcu/mcu-1/ARM7/src/main.c index 2fd8c6b..a0f4b4a 100644 --- a/build/tests/mcu/mcu-1/ARM7/src/main.c +++ b/build/tests/mcu/mcu-1/ARM7/src/main.c @@ -182,6 +182,38 @@ static void test_tuning(void) SVC_WaitByLoop(max); OS_TPrintf("== %d usec\n", (int)OS_TicksToMicroSeconds(OS_GetTick()-begin)); } + // aging + OS_TPrintf("\naging..."); + for (k = 0; k < times; k++) + { + for (j = 0; j < nums; j++) + { + wdata[j]++; + } + + if (!MCU_GetFreeRegisters(offset, wdata, nums) || !MCU_SetFreeRegisters(offset, rdata, nums)) + { + (*pInterval)++; + continue; + } + for (j = 0; j < nums; j++) + { + if (wdata[j] != rdata[j]) + { + (*pInterval)++; + continue; + } + } + } + max = *pInterval; + { + OSTick begin; + OS_InitTick(); + OS_TPrintf("\n\nResult: interval = 0x%08X (%d) ", max, max); + begin = OS_GetTick(); + SVC_WaitByLoop(max); + OS_TPrintf("== %d usec\n", (int)OS_TicksToMicroSeconds(OS_GetTick()-begin)); + } } /*---------------------------------------------------------------------------* @@ -202,7 +234,7 @@ void TwlMain() test_normal(); // tune I2C interval - //test_tuning(); + test_tuning(); // done OS_TPrintf("\nARM7 ends.\n");