#include "global.h" #include #include #include #include #include #include #include "ip_arp_udp_tcp.h" #include "enc28j60.h" #include "timeout.h" #include "avr_compat.h" #include "net.h" #include "rprintf.h" #include "a2d.h" #define MYWWWPORT 80 #define MYUDPPORT 1200 #define BUFFER_SIZE 800 #define TIMEOUT_VAL(s) (float)s/0.032 // val = Secound / 0.032 void init_HW(void); void analys_http_request( uint8_t *request ); void device_control( uint8_t *request ); int instr( char *s1, char *s2 ); void echo(unsigned char c); static uint8_t mymac[6] = {0x54,0x55,0x58,0x10,0x00,0x24}; static uint8_t myip[4] = {192,168,1,10}; static uint8_t buf[BUFFER_SIZE+1]; uint16_t plen, dat_p; int timeout = TIMEOUT_VAL(120), session_expire=1, status_led_count; ISR(TIMER0_OVF_vect){ if( timeout ){ timeout--; }else{ session_expire = 1; } if( status_led_count == 25 ){ status_led_count = 0; STATUS_LED_PORT ^= (1<