add support for Microchip TCP/IP 6.0 beta

pull/1/head
Chris Conlon 2013-05-17 10:59:18 -06:00
parent dcf88daae7
commit a4c6ed0dda
3 changed files with 27 additions and 6 deletions

View File

@ -95,7 +95,7 @@
#endif #endif
#define NO_TIME_H #define NO_TIME_H
/* since Micrium not defining XTIME or XGMTIME, CERT_GEN not available */ /* since Micrium not defining XTIME or XGMTIME, CERT_GEN not available */
#elif defined(MICROCHIP_TCPIP) #elif defined(MICROCHIP_TCPIP_V5) || defined(MICROCHIP_TCPIP)
#include <time.h> #include <time.h>
#define XTIME(t1) pic32_time((t1)) #define XTIME(t1) pic32_time((t1))
#define XGMTIME(c) gmtime((c)) #define XGMTIME(c) gmtime((c))
@ -255,7 +255,7 @@ struct tm* my_gmtime(const time_t* timer) /* has a gmtime() but hangs */
#endif /* THREADX */ #endif /* THREADX */
#ifdef MICROCHIP_TCPIP #if defined(MICROCHIP_TCPIP_V5) || defined(MICROCHIP_TCPIP)
/* /*
* time() is just a stub in Microchip libraries. We need our own * time() is just a stub in Microchip libraries. We need our own
@ -263,7 +263,11 @@ struct tm* my_gmtime(const time_t* timer) /* has a gmtime() but hangs */
*/ */
time_t pic32_time(time_t* timer) time_t pic32_time(time_t* timer)
{ {
#ifdef MICROCHIP_TCPIP_V5
DWORD sec = 0; DWORD sec = 0;
#else
uint32_t sec = 0;
#endif
time_t localTime; time_t localTime;
if (timer == NULL) if (timer == NULL)

View File

@ -45,7 +45,10 @@
/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ /* Uncomment next line if using Microchip PIC32 ethernet starter kit */
/* #define MICROCHIP_PIC32 */ /* #define MICROCHIP_PIC32 */
/* Uncomment next line if using Microchip TCP/IP stack, for time features */ /* Uncomment next line if using Microchip TCP/IP stack, version 5 */
/* #define MICROCHIP_TCPIP_V5 */
/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */
/* #define MICROCHIP_TCPIP */ /* #define MICROCHIP_TCPIP */
/* Uncomment next line if using FreeRTOS */ /* Uncomment next line if using FreeRTOS */
@ -94,11 +97,17 @@
#define TFM_TIMING_RESISTANT #define TFM_TIMING_RESISTANT
#endif #endif
#ifdef MICROCHIP_TCPIP #ifdef MICROCHIP_TCPIP_V5
/* includes timer functions */ /* include timer functions */
#include "TCPIP Stack/TCPIP.h" #include "TCPIP Stack/TCPIP.h"
#endif #endif
#ifdef MICROCHIP_TCPIP
/* include timer, NTP functions */
#include "system/system_services.h"
#include "tcpip/sntp.h"
#endif
#ifdef MBED #ifdef MBED
#define SINGLE_THREADED #define SINGLE_THREADED
#define CYASSL_USER_IO #define CYASSL_USER_IO

View File

@ -2088,7 +2088,7 @@ ProtocolVersion MakeDTLSv1_2(void)
} }
#elif defined(MICROCHIP_TCPIP) #elif defined(MICROCHIP_TCPIP_V5)
word32 LowResTimer(void) word32 LowResTimer(void)
{ {
@ -2096,6 +2096,14 @@ ProtocolVersion MakeDTLSv1_2(void)
} }
#elif defined(MICROCHIP_TCPIP)
word32 LowResTimer(void)
{
return (word32) SYS_TICK_Get();
}
#elif defined(USER_TICKS) #elif defined(USER_TICKS)
#if 0 #if 0
word32 LowResTimer(void) word32 LowResTimer(void)