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
#define NO_TIME_H
/* 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>
#define XTIME(t1) pic32_time((t1))
#define XGMTIME(c) gmtime((c))
@ -255,7 +255,7 @@ struct tm* my_gmtime(const time_t* timer) /* has a gmtime() but hangs */
#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
@ -263,7 +263,11 @@ struct tm* my_gmtime(const time_t* timer) /* has a gmtime() but hangs */
*/
time_t pic32_time(time_t* timer)
{
#ifdef MICROCHIP_TCPIP_V5
DWORD sec = 0;
#else
uint32_t sec = 0;
#endif
time_t localTime;
if (timer == NULL)

View File

@ -45,7 +45,10 @@
/* Uncomment next line if using Microchip PIC32 ethernet starter kit */
/* #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 */
/* Uncomment next line if using FreeRTOS */
@ -94,11 +97,17 @@
#define TFM_TIMING_RESISTANT
#endif
#ifdef MICROCHIP_TCPIP
/* includes timer functions */
#ifdef MICROCHIP_TCPIP_V5
/* include timer functions */
#include "TCPIP Stack/TCPIP.h"
#endif
#ifdef MICROCHIP_TCPIP
/* include timer, NTP functions */
#include "system/system_services.h"
#include "tcpip/sntp.h"
#endif
#ifdef MBED
#define SINGLE_THREADED
#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)
{
@ -2096,6 +2096,14 @@ ProtocolVersion MakeDTLSv1_2(void)
}
#elif defined(MICROCHIP_TCPIP)
word32 LowResTimer(void)
{
return (word32) SYS_TICK_Get();
}
#elif defined(USER_TICKS)
#if 0
word32 LowResTimer(void)