// <o>Communication Protocol <0=> TCP <1=> UDP
// <i> Selecet a protocol for sending data.
#define PROTOCOL 1
// <o>LED Blinking speed <1-100>
// <i> Blinking speed = SPEED * 100ms
// <i> Default: 2
#define SPEED 2
//------------- <<< end of configuration section >>> -----------------------
#define UDP 1
BOOL tick;
U8 socket_udp;
U8 Rem_IP[4] = {IP1,IP2,IP3,IP4};
/*--------------------------- init ------------------------------------------*/
static void init () {
/* Add System initialisation code here */
/* Set the clocking to run from the PLL at 50 MHz */
SysCtlClockSet (SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL |
SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
/* Configure the GPIO for the LED. */
SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOF);
GPIOPadConfigSet (GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA,
GPIO_PIN_TYPE_STD);
GPIODirModeSet (GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_DIR_MODE_OUT);
/* Setup and enable the SysTick timer for 100ms. */
SysTickPeriodSet(SysCtlClockGet() / 10);
SysTickEnable();
}
/*--------------------------- timer_poll ------------------------------------*/
static void timer_poll () {
/* System tick timer running in poll mode */
if ((HWREG (NVIC_ST_CTRL) >> 16) & 1) {
/* Timer tick every 100 ms */
timer_tick ();
tick = __TRUE;
}
}
/*--------------------------- UDP socket ------------------------------------*/
U16 udp_callback (U8 soc, U8 *rip, U16 rport, U8 *buf, U16 len) {
buf = buf;
rip = rip;
rport= rport;
len = len;
soc = soc;
return (0);
}
|