![](/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: parallelcpld.cpp
- Revision:
- 124:c1b6c893e1c3
- Parent:
- 119:ee6a53069455
- Child:
- 125:8ff4dc96ad58
diff -r 1d395b5a4cad -r c1b6c893e1c3 parallelcpld.cpp --- a/parallelcpld.cpp Mon May 11 19:21:39 2015 +0000 +++ b/parallelcpld.cpp Wed May 13 14:25:57 2015 +0000 @@ -56,10 +56,11 @@ if( tx_clear == 1 ){ tx_clear = 0; xmemcpy( TXBuffer, buffer, CB_BUFFER_SIZE ); + // Send the first position of TXBuffer first - parallel_write( TXBuffer[ 0 ] ); + parallel_write ( TXBuffer[ 0 ] ); DataReady = 1; - xmemcpy( cb_tx_buffer, buffer, CB_BUFFER_SIZE ); + cpld_pkg_tx_counter++; uint16_t ext = ( ( uint16_t )buffer[ 0 ] ) << 8 | buffer[ 1 ]; @@ -71,9 +72,27 @@ fw_cbx_pkg( ext, port, ( char *)buffer ); } - if( debug_cb_tx == true ){ - if( type != AUDIO ) send_msg("Pkg to CBx :: ( %d, %d ) -- Type :: %d", ext, port, type ); - } + if( type != AUDIO ) + { + xmemcpy( cb_tx_buffer, buffer, CB_BUFFER_SIZE ); + + if ( debug_show_tx_cpld ) + { + char str[ 1024 ]; + strcpy( str, "TX :: \n\r " ); + for( register uint16_t i = 0; i < CB_BUFFER_SIZE; i++ ) { + char tmp[ 16 ]; + snprintf ( tmp, sizeof ( tmp ), "%x", cb_tx_buffer [ i ] ); + strcat( str, tmp ); + if( ( i != 0 ) && !( ( i + 1 ) % 50 ) ) strcat( str, "\n\r " ); + + else strcat( str, " " ); + } + send_msg( "%s", str ); + } + if ( debug_cb_tx == true ) send_msg("H -> CBx :: ( %d, %d ) -- Type :: %d", ext, port, type ); + } + }else{ // Error if the transmission is still in use uint8_t ret = ring_buffer_add( rb, buffer );