![](/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: prompt.cpp
- Revision:
- 51:5fc3a8f02fdf
- Parent:
- 50:d9b6577a70f5
- Child:
- 52:12930cef17c4
--- a/prompt.cpp Mon Oct 20 19:28:38 2014 +0000 +++ b/prompt.cpp Mon Oct 20 19:37:33 2014 +0000 @@ -836,9 +836,6 @@ split = strtok( debug_buf + 4, " " ); ext = atoi( split ); - //split = strtok( NULL, " " ); - //port = atoi( split ); - //split = strtok( NULL, " " ); port = convert_ext_to_port( ext ); split += strlen( split ) + 1; @@ -1265,10 +1262,14 @@ return( NULL ); } -int convert_ext_to_port( int ext ){ - int aux = 0; - aux = ( ext / 1000 ) * 1000; - ext -= aux; - aux += ext % 100; - return( aux ); +int convert_ext_to_port( int ext ){ + if( ext < 1000 ) return ext; + + else{ + int aux = 0; + aux = ( ext / 1000 ) * 1000; + ext -= aux; + aux += ext % 100; + return( aux ); + } }