//*****************************************************************************
//
// Defines for setting up the system clock.
//
//*****************************************************************************
#define SYSTICKHZ 100
#define SYSTICKMS (1000 / SYSTICKHZ)
#define SYSTICKUS (1000000 / SYSTICKHZ)
#define SYSTICKNS (1000000000 / SYSTICKHZ)
//*****************************************************************************
//
// Interrupt priority definitions. The top 3 bits of these values are
// significant with lower values indicating higher priority interrupts.
//
//*****************************************************************************
#define SYSTICK_INT_PRIORITY 0x80
#define ETHERNET_INT_PRIORITY 0xC0
//*****************************************************************************
//
//the ip of PC
//
//*****************************************************************************
#define ip_PC {192,168,0,101}
static const unsigned char pcIPAddress[]=ip_PC;
//*****************************************************************************
//
//address for Mac,IP,Mack,gateway address
//
//*****************************************************************************
//*****************************************************************************
//
//define a tcp_pcb struct for the tcp_write
//
//*****************************************************************************
static struct tcp_pcb *g_psPCB = NULL;
//*****************************************************************************
//
//a struct for the state of the pcb
//
//*****************************************************************************
typedef struct
{
unsigned long ulRetryCount;
tBoolean bCONTROLSent;
}
tAPPState;
//*****************************************************************************
//
//this function will used after the connection is builded
//
//*****************************************************************************
if((err == ERR_OK) && (test_data == NULL))
{
//
// Close the connection.
//
mem_free(pState);
tcp_close(tpcb);
}
return ERR_OK;
}
//*****************************************************************************
//
// The interrupt handler for the SysTick interrupt.
//
//*****************************************************************************
void
SysTickIntHandler(void)
{
//
// Call the lwIP timer handler.
//
lwIPTimer(SYSTICKMS);
}
//*****************************************************************************
//
//this is the main function
//
//*****************************************************************************