Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
44:cc4996469404
Parent:
43:455522f98de5
Child:
45:c80574f24dc3
--- a/main.cpp	Mon Oct 06 14:31:54 2014 +0000
+++ b/main.cpp	Mon Oct 06 19:26:36 2014 +0000
@@ -89,8 +89,8 @@
     reset_leds();
     wdt.Configure( 40.0 ); 
     udp_timer.start();
-    
     led1 = 0; led4 = 1;
+    debug_msg("Ready");
     while( true ){
         prompt_process( NULL );
         wdt.kick();
@@ -142,7 +142,7 @@
         }
 //----------------------
             if( t.read() > 5 ){
-                //static int count = 0;
+                static int count = 0;
                 for( register uint8_t i = 0; i < v_cb->size(); i++ ){
                     Call_Box * cb = ( Call_Box * )v_cb->get_element( i );
                     if( debug_alive ){ 
@@ -161,18 +161,27 @@
                 if( debug_cks ) debug_msg("PKG_CSK OK: %d :: PKG_CSK ERR: %d", pkg_cksok, pkg_ckserr );
                 
                 //<><><><><><><><><><>
-                /*
                 count++;            
+                if( !( count % 3 ) ){
+                    if( eth_status ){
+                        wdt.kick();
+                        eth_status = __init_eth__( &eth );
+                        if( eth_status ){
+                            if( debug_main ) debug_msg("Cannot connect to eth");
+                        }else{
+                            if( debug_main ) debug_msg("Connection eth - ok");
+                            init_prompt();
+                        }
+                    }
+                }
                 if( count == 5 ){
                     //debug_msg("Colocar simulacoes de cbx aqui");
                     data = buffer;
                     ext = 891;
                     port = 5001;
-                    type = __INVITE__;
+                    type = __REGISTRY__;
                     debug_msg("registro enviado");
                 }
-                */
-                
             }
 //----------------------
         switch( type ){