nova verzija tcp+udp->serial com

Revision:
26:c14d034d7459
Parent:
24:ec9446d86668
--- a/main.cpp	Thu Jun 18 22:54:35 2020 +0200
+++ b/main.cpp	Fri Jul 10 11:33:05 2020 +0200
@@ -5,6 +5,7 @@
 #include "TcpClients.h"
 #include "SerialCom.h"
 #include "TcpServerToFlash.h"
+#include "TcpServer.h"
 //#include "dxml.h"
 #include "doHTML.h"
 #include "dataFlash.h"
@@ -40,15 +41,18 @@
 
 void input_fun( void ) 
 {
+
      while(true) 
      { 
       unsigned char uc;
       int fltip, kanal, fleg;
+wait(0.1);
         uc = (unsigned char)getchar( );
         printf( "\n\runesen karakter %c\n\r", uc);
         
         switch( uc )
         {
+            case 'F': printf("while\n\r"); while(1); break;
             case 'h': 
             {
             extern C_HTMLparse *gpc_html;
@@ -120,13 +124,17 @@
     C_HTMLparse *gpc_html;
     
     
+#define WD_KICK     watchdog.kick()
 
 
 int main(void)
 {
   
     printf("\n\r\n\n----------  POCETAK  ------------- \n\n\r");
-    
+
+  Watchdog &watchdog = Watchdog::get_instance();
+  watchdog.start(10000);
+
     doinit_FlashData( );
 
    gpc_html = new C_HTMLparse;
@@ -154,7 +162,7 @@
    //extern EthernetInterface *gp_eth;
 
 
-   
+   WD_KICK;
 
   if( ethernet_setup(  ) )
   {
@@ -162,9 +170,18 @@
     start_UdpClients( );
      inic_TcpServerToFlash(  );
      p_led = &GLed;
+    
+    
+    extern void start_TcpServer( void );
+    start_TcpServer( );
+
   }
   else p_led = &BLed;
 
+
+WD_KICK;
+
+
   start_SerialCom( );
 
 extern void test_HTML(void);
@@ -194,6 +211,9 @@
            else *p_led = !*p_led;
 
         }
+
+        WD_KICK;
+
         wait(0.01);  
     }