--- trunk/PIC/Demo trimmet/TFTPcDemo.c 2007/05/25 16:00:14 102 +++ trunk/PIC/Demo trimmet/TFTPcDemo.c 2007/05/28 10:13:48 109 @@ -1,37 +1,13 @@ #define THIS_IS_STACK_APPLICATION #include "stacktsk.h" -#include "dhcp.h" #include "tick.h" #include "delay.h" -#include "udp.h" -#include "arp.h" -#include "arptsk.h" -#include "tcp.h" +#include "network.h" +#include "barcode.h" +#include -bit bIsDhcpUp = 0; -char netlevel = 0; -// All TFTP command statuts display will be done on first line of LCD. -//#define TFTP_COMMAND_DISPLAY_LINE 0 - -// Result will be displayed at y = 15. -#define TFTP_COMMAND_RESULT_POSITION 15 - - -/*#define STARTUP_MSG "G1_Build_0x00" - -ROM char StartupMsg[] = STARTUP_MSG; - -#if defined(STACK_USE_DHCP) || defined(STACK_USE_IP_GLEANING) -ROM char DHCPMsg[] = "DHCP/Gleaning..."; -#endif - -ROM char SetupMsg[] = "Board Setup..."; - -// 1234567890123456 -//ROM char blankLCDLine[] = " "; -*/ /* * This is used by other stack elements. * Main application must define this and initialize it with @@ -69,193 +45,12 @@ static void InitializeBoard(void); static void SetConfig(void); -/***************************** - Enummerations - ****************************/ -typedef enum _NetworkState -{ - off, - DhcpIsBound, - ArpIsTxReady, - ArpIsResolved, - SockOpening, - SockOpen, - TcpReadyToSend, - TcpSend, - HelloDone, - StregkodeDone, - SockClosing, - SockClosed -} NetworkState; - -/***************************** - GLOBAL INIT - ****************************/ -NODE_INFO rnode; -NetworkState state; -TCP_SOCKET tsock1; - - -/***************************** - network funktions - ****************************/ -int net_INT = 13, i; -char *net_CHAR = "1234567890123"; - - -void network_init(void) -{ - state = off; -} - - -void network_worker(void) -{ - TickGet(); - StackTask(); -} - -void network_wait(unsigned char n) -{ - int i; - for (i=0; i