diff -r 95f71bcdcdb7 -r 657f875b013e kerneltest/e32test/system/d_mstim.cpp --- a/kerneltest/e32test/system/d_mstim.cpp Thu May 27 14:17:14 2010 +0300 +++ b/kerneltest/e32test/system/d_mstim.cpp Fri Jun 11 15:02:23 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(5).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;