diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index 145c11a44..6c77b5ac4 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -100,6 +100,11 @@ #define XTIME(t1) pic32_time((t1)) #define XGMTIME(c) gmtime((c)) #define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t)) +#elif defined(FREESCALE_MQX) + #include + #define XTIME(t1) mqx_time((t1)) + #define XGMTIME(c) gmtime((c)) + #define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t)) #elif defined(CYASSL_MDK_ARM) #include #undef RNG @@ -289,6 +294,25 @@ time_t pic32_time(time_t* timer) #endif /* MICROCHIP_TCPIP */ +#ifdef FREESCALE_MQX + +time_t mqx_time(time_t* timer) +{ + time_t localTime; + TIME_STRUCT time_s; + + if (timer == NULL) + timer = &localTime; + + _time_get(&time_s); + *timer = (time_t) time_s.SECONDS; + + return *timer; +} + +#endif /* FREESCALE_MQX */ + + static INLINE word32 btoi(byte b) { return b - 0x30; diff --git a/src/internal.c b/src/internal.c index 3cb41db14..7f783240b 100644 --- a/src/internal.c +++ b/src/internal.c @@ -2216,6 +2216,17 @@ ProtocolVersion MakeDTLSv1_2(void) return (word32) SYS_TICK_Get(); } +#elif defined(FREESCALE_MQX) + + word32 LowResTimer(void) + { + TIME_STRUCT mqxTime; + + _time_get_elapsed(&mqxTime); + + return (word32) mqxTime.SECONDS; + } + #elif defined(USER_TICKS) #if 0