![](/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: eth.cpp
- Revision:
- 78:1353744f01e1
- Parent:
- 74:81c47fff88a5
- Child:
- 81:3656f00ab3db
--- a/eth.cpp Tue Nov 25 18:43:01 2014 +0000 +++ b/eth.cpp Tue Dec 16 12:13:01 2014 +0000 @@ -29,7 +29,6 @@ } fclose( fp ); buff_ip[ 15 ] = 0; - fp = fopen( "/qspi/mymask.txt", "r"); if( fp == NULL ){ if( debug_file ) debug_msg("Failed to open /qspi/mymask.txt" ); @@ -50,10 +49,9 @@ } fclose( fp ); buff_msk[ 15 ] = 0; - - fp = fopen( "/qspi/mygate.txt", "r"); + fp = fopen( "/qspi/mygateway.txt", "r"); if( fp == NULL ){ - if( debug_file ) debug_msg("Failed to open /qspi/mygate.txt" ); + if( debug_file ) debug_msg("Failed to open /qspi/mygateway.txt" ); strncpy( buff_gtw, __MY_GTW__, 20 ); }else{ int read = fread( buff_gtw, 1, 512, fp ); @@ -65,20 +63,18 @@ } if( debug_file ) debug_msg("Ip Gateway Eth %s", buff_gtw ); }else{ - if( debug_file ) debug_msg("Failed to read /qspi/mygate.txt" ); + if( debug_file ) debug_msg("Failed to read /qspi/mygateway.txt" ); strncpy( buff_gtw, __MY_GTW__, 20 ); } } fclose( fp ); buff_gtw[ 15 ] = 0; - if( !initialized ){ //eth.init( buff_ip, buff_msk, buff_gtw ); eth.init( buff_ip, buff_msk, __MY_GTW__ ); initialized = true; return eth.connect(); } - if( !eth.disconnect() ){ return eth.connect(); }