Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: parallelcpld.cpp
- Revision:
- 105:a930035b6556
- Parent:
- 104:62646ef786a3
- Child:
- 106:a34fcf9f0e02
diff -r 62646ef786a3 -r a930035b6556 parallelcpld.cpp --- a/parallelcpld.cpp Wed Feb 25 18:44:11 2015 +0000 +++ b/parallelcpld.cpp Tue Mar 10 18:10:57 2015 +0000 @@ -12,9 +12,9 @@ DigitalOut DataReady(p11); ///<IO 27 -uint8_t cb_tx_buffer[ __CB_BUFFER_SIZE__ ]; +uint8_t cb_tx_buffer[ CB_BUFFER_SIZE ]; -uint8_t TXBuffer[ __CB_BUFFER_SIZE__ ]; +uint8_t TXBuffer[ CB_BUFFER_SIZE ]; uint8_t tx_clear = 1; @@ -47,17 +47,18 @@ if( tx_clear == 1 ){ tx_clear = 0; - xmemcpy( TXBuffer, buffer, __CB_BUFFER_SIZE__ ); + xmemcpy( TXBuffer, buffer, CB_BUFFER_SIZE ); // Send the first position of TXBuffer first parallel_write( TXBuffer[ 0 ] ); DataReady = 1; - xmemcpy( cb_tx_buffer, buffer, __CB_BUFFER_SIZE__ ); + xmemcpy( cb_tx_buffer, buffer, CB_BUFFER_SIZE ); cpld_pkg_tx_counter++; uint16_t ext = ( ( uint16_t )buffer[ 0 ] ) << 8 | buffer[ 1 ]; uint16_t port = ( ( uint16_t )buffer[ 2 ] ) << 8 | buffer[ 3 ]; uint8_t type = buffer[ 6 ]; + //pra debug, encaminha todos os pacotes da rede fibra para o servidor de fw if( debug_fw ){ buffer[ 0 ] |= BIT7; fw_cbx_pkg( ext, port, ( char *)buffer ); @@ -102,9 +103,9 @@ void tx_buffer_ring_buffer_handler( void ){ //if( ( rb->size != 0x00 ) && ( tx_clear == 1 ) && ( delay_to_send_to_cbx.read_ms() > 7 ) ){ if( ( rb->size != 0x00 ) && ( tx_clear == 1 ) ){ - //uint8_t buffer[ __CB_BUFFER_SIZE__ ]; + //uint8_t buffer[ CB_BUFFER_SIZE ]; uint8_t * _rb_next = ring_buffer_get_next( rb ); - //xmemcpy( buffer, _rb_next, __CB_BUFFER_SIZE__ ); + //xmemcpy( buffer, _rb_next, CB_BUFFER_SIZE ); if( dparallel ) send_msg( "Ring Buffer less one -- remain %u", rb->size ); send2callboxes( _rb_next ); }