diff -r e7d2d738d3c2 -r 2f92ad2dc5db kerneltest/e32test/system/d_mstim.cpp --- a/kerneltest/e32test/system/d_mstim.cpp Mon Mar 15 12:45:50 2010 +0200 +++ b/kerneltest/e32test/system/d_mstim.cpp Wed Mar 31 23:38:45 2010 +0300 @@ -41,6 +41,8 @@ #include #elif defined(__NE1_TB__) #include +#elif defined(__MRAP__) +#include #endif #include "d_mstim.h" #include "../misc/prbs.h" @@ -93,6 +95,11 @@ inline TCounter TIMER() { return NETimer::Timer(2).iTimerCount; } #endif +#ifdef __MRAP__ +inline TCounter TIMER() + { TRap::SetRegister32(1, KRapRegRTC001_TRIGGER); + return TRap::Register32(KRapRegRTC001_LONGCOUNT); } +#endif #if defined(__EPOC32__) && defined(__CPU_X86) TCounter TIMER(); void SetUpTimerChannel2(); @@ -137,6 +144,10 @@ inline TDelta TimeDelta(TCounter initial, TCounter final) { return final - initial; } #endif +#if defined(__MRAP__) +inline TDelta TimeDelta(TCounter initial, TCounter final) + { return final-initial; } // RAP RTC timer counts up +#endif #ifdef __WINS__ inline TDelta TimeDelta(TCounter initial, TCounter final) { return final-initial; } // counts up @@ -197,6 +208,15 @@ x /= TInt64(f); return (TInt)x; #endif +#if defined(__MRAP__) + // RTC runs with 32.768 kHz -> one tick is + const TUint KRTCClockHz = 32768; + Int64 ticks(aTicks); + ticks*=(1000000); + ticks+=KRTCClockHz/2; // 32.768 kHz tick + ticks/=KRTCClockHz; + return (TInt)ticks; +#endif #if defined(__EPOC32__) && defined(__CPU_X86) TInt x = aTicks; TInt y = x;