fix LowResTimer on Microchip ports

This commit is contained in:
Chris Conlon
2015-12-28 13:58:01 -07:00
parent 91c06736cb
commit 47426b1f8d

View File

@@ -2746,7 +2746,7 @@ ProtocolVersion MakeDTLSv1_2(void)
word32 LowResTimer(void) word32 LowResTimer(void)
{ {
return (word32) TickGet(); return (word32) (TickGet() / TICKS_PER_SECOND);
} }
@@ -2758,14 +2758,15 @@ ProtocolVersion MakeDTLSv1_2(void)
word32 LowResTimer(void) word32 LowResTimer(void)
{ {
return (word32) SYS_TMR_TickCountGet(); return (word32) (SYS_TMR_TickCountGet() /
SYS_TMR_TickCounterFrequencyGet());
} }
#else #else
word32 LowResTimer(void) word32 LowResTimer(void)
{ {
return (word32) SYS_TICK_Get(); return (word32) (SYS_TICK_Get() / SYS_TICK_TicksPerSecondGet());
} }
#endif #endif