![](/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: vz_protocol.cpp
- Revision:
- 67:cdedc64d9921
- Parent:
- 63:0d95da692bb4
- Child:
- 69:65665afbad5d
diff -r 3f1d22e69e7b -r cdedc64d9921 vz_protocol.cpp --- a/vz_protocol.cpp Tue Oct 28 18:35:48 2014 +0000 +++ b/vz_protocol.cpp Thu Oct 30 19:26:41 2014 +0000 @@ -156,22 +156,25 @@ //__print_clock__( pkg + 8 ); pkg[ __TIMESLICE_PLACE__ ] = cb_buffer[ __TIMESLICE_PLACE__ ]; fill = __TIMESLICE_PLACE__ + 1; - } - - if( type == __PROMPT__ ){ + }else if( type == __PROMPT__ ){ //__print_clock__( pkg + 8 ); xmemcpy((pkg+7), (uint8_t*)cb_buffer, 293); + //FIXME isso forca qualquer cmd ter < 100 chars fill = 100; - } - - else if( type == __TELEMETRY__ ){ + }else if( type == __TELEMETRY__ ){ pkg[ 7 ] = seq_num; //__print_clock__( pkg + 8 ); pkg[ __TIMESLICE_PLACE__ ] = cb_buffer[ __TIMESLICE_PLACE__ ]; fill = __TIMESLICE_PLACE__ + 1; + }else if( type == __BOOTLOADER_CBX__ ){ + pkg[ 7 ] = seq_num; + //__print_clock__( pkg + 8 ); + fill = __VZ_HEADER_OFFSET__ + __CLOCK_SYNC_SIZE__ + __SEQ_NUM_SIZE__; + }else{ + fill = __VZ_HEADER_OFFSET__; } - for( register int i = fill; i < __CB_BUFFER_SIZE__; i++ ) pkg[ i ] = 0x00; + for( register uint16_t i = fill; i < __CB_BUFFER_SIZE__; i++ ) pkg[ i ] = 0x00; uint16_t cc = __checksum__( pkg, 300 ); pkg[ 4 ] =( uint8_t )( ( cc & 0xFF00 ) >> 8) ;