![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: main.cpp
- Revision:
- 122:480c44b0e205
- Parent:
- 121:ee02790d00b7
- Child:
- 123:1d395b5a4cad
--- a/main.cpp Fri May 08 04:15:23 2015 +0000 +++ b/main.cpp Mon May 11 15:16:36 2015 +0000 @@ -1,6 +1,5 @@ #include "main_app_functions.h" #include "main_app_var_configs.h" -#include "header_app_includes.h" int main() { @@ -341,34 +340,37 @@ if( debug_invite ) debug_msg("[%d] Invite request", ext); - Call_Box * cb = find_CB( v_cb, ext ); + Call_Box * cb = find_CB ( v_cb, ext ); - if( cb == NULL ) { - if( v_cb->size() < MAX_CB_IN_A_BRANCH ) { - if( debug_main ) debug_msg( "[%d] Adding CBx", ext ); - cb = new Call_Box( ext, port ); + if ( cb == NULL ) + { + if ( v_cb -> size () < MAX_CB_IN_A_BRANCH ) + { + if ( debug_main ) debug_msg ( "[%d] Adding CBx", ext ); + cb = new Call_Box ( ext, port ); - if( cb == NULL ) { + if ( cb == NULL ) + { memory_is_over = true; - if( debug_memory ) debug_msg("[%d] Invite allocation cb fail", ext ); + if ( debug_memory ) debug_msg ("[%d] Invite allocation cb fail", ext ); } else { - v_cb->add( cb ); + v_cb->add ( cb ); } } } - if( cb != NULL ) + if ( cb != NULL ) { - cb->invite_retry_count_reset(); + cb -> invite_retry_count_reset (); - cb->set_msg_id( data[ 0 ] ); + cb -> set_msg_id ( data [ 0 ] ); - if ( cb -> get_status () == cb_idle ){ + if ( cb -> get_status () == cb_idle ) { cb -> call_config (); } else { - data[ TIMESLICE_PLACE ] = cb->get_timeslice(); + data [ TIMESLICE_PLACE ] = cb -> get_timeslice (); - cb->set_invite_response_pending(); + cb -> set_invite_response_pending (); send2callboxes( build_cb_package( ext, port, INVITE, ( char * )data, cb->msg_id_update (), CB_BUFFER_SIZE - VZ_HEADER_OFFSET, write_buffer ) ); @@ -566,7 +568,7 @@ if( eth_status == 0 ) eth_wdt = ETH_CONNECT_TIMEOUT; if( wdt_timer.read() >= 1 ) { - wdt_update (); + if ( -1 == wdt_update () ) debug_msg("Erro!!!!!"); wdt_timer.reset(); }