nova proba

Revision:
22:11279d24a105
Parent:
21:2232f5a34eb4
Child:
23:766819b4c453
--- a/main.cpp	Mon May 25 22:19:36 2020 +0200
+++ b/main.cpp	Thu Jun 11 10:41:11 2020 +0200
@@ -9,8 +9,13 @@
 #include "doHTML.h"
 #include "dataFlash.h"
 
+ extern "C" void mbed_reset();
 
-
+void startUp( void)
+{
+   // mbed_reset();
+   NVIC_SystemReset();
+}
 
 
 volatile PFV pfv = NULL; 
@@ -69,7 +74,8 @@
             }
                 break;
             case 'P': case 'p':
-                restart_TcpClients( );
+               // restart_TcpClients( );
+               startUp();
                 break;
             case 'S': case 's':
             {
@@ -96,6 +102,13 @@
                 SystemInit();
                 //goto __main;
             break;
+            
+            case 'q': case 'Q':
+            {
+              extern void print_serial( void );
+                 print_serial( );
+            }
+            break;
         }
      } 
 } 
@@ -112,7 +125,7 @@
   
     printf("\n\r\n\n----------  POCETAK  ------------- \n\n\r");
     
-    init_FlashData( );
+    doinit_FlashData( );
 
    gpc_html = new C_HTMLparse;
    C_HTMLparse  *p_temp_html = new C_HTMLparse;
@@ -127,7 +140,7 @@
     }
     else 
     {
-        printf("MAIN: losi FLASH podaci\n\r");
+        printf("MAIN: losi FLASH podaci - koristim static\n\r");
         putHTMLintoFLASH( gpc_html );
         putFLASHintoHTML( gpc_html );    
     }
@@ -172,7 +185,7 @@
            if( s != k)
            {
                *p_led = 1;
-                if( s == 1 )        p_led = &GLed;
+                if( s == 1 )       startUp(); //p_led = &GLed;
                 else if( s == 3)    p_led = &BLed; 
                 k = s;
            }