From 47426b1f8d1f0a26eb794daf3a78321356cff988 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Mon, 28 Dec 2015 13:58:01 -0700 Subject: [PATCH] fix LowResTimer on Microchip ports --- src/internal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/internal.c b/src/internal.c index db7f9f65c..31ed766ca 100644 --- a/src/internal.c +++ b/src/internal.c @@ -2746,7 +2746,7 @@ ProtocolVersion MakeDTLSv1_2(void) word32 LowResTimer(void) { - return (word32) TickGet(); + return (word32) (TickGet() / TICKS_PER_SECOND); } @@ -2758,14 +2758,15 @@ ProtocolVersion MakeDTLSv1_2(void) word32 LowResTimer(void) { - return (word32) SYS_TMR_TickCountGet(); + return (word32) (SYS_TMR_TickCountGet() / + SYS_TMR_TickCounterFrequencyGet()); } #else word32 LowResTimer(void) { - return (word32) SYS_TICK_Get(); + return (word32) (SYS_TICK_Get() / SYS_TICK_TicksPerSecondGet()); } #endif