File tree 2 files changed +2
-25
lines changed
2 files changed +2
-25
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,8 @@ AP_GPS_NOVA::parse(uint8_t temp)
176
176
nova_msg.crc += (uint32_t ) (temp << 24 );
177
177
nova_msg.nova_state = nova_msg_parser::PREAMBLE1;
178
178
179
- uint32_t crc = CalculateBlockCRC32 ((uint32_t )nova_msg. header . nova_headeru . headerlength , (uint8_t *)&nova_msg.header .data , (uint32_t )0 );
180
- crc = CalculateBlockCRC32 (( uint32_t )nova_msg. header . nova_headeru . messagelength , (uint8_t *)&nova_msg.data , crc );
179
+ uint32_t crc = crc_crc32 ((uint32_t )0 , (uint8_t *)&nova_msg.header .data , (uint32_t )nova_msg. header . nova_headeru . headerlength );
180
+ crc = crc_crc32 (crc , (uint8_t *)&nova_msg.data , ( uint32_t )nova_msg. header . nova_headeru . messagelength );
181
181
182
182
if (nova_msg.crc == crc) {
183
183
return process_message ();
@@ -293,25 +293,4 @@ AP_GPS_NOVA::process_message(void)
293
293
return false ;
294
294
}
295
295
296
- #define CRC32_POLYNOMIAL 0xEDB88320L
297
- uint32_t AP_GPS_NOVA::CRC32Value (uint32_t icrc)
298
- {
299
- int i;
300
- uint32_t crc = icrc;
301
- for ( i = 8 ; i > 0 ; i-- ) {
302
- if ( crc & 1 )
303
- crc = ( crc >> 1 ) ^ CRC32_POLYNOMIAL;
304
- else
305
- crc >>= 1 ;
306
- }
307
- return crc;
308
- }
309
-
310
- uint32_t AP_GPS_NOVA::CalculateBlockCRC32 (uint32_t length, uint8_t *buffer, uint32_t crc)
311
- {
312
- while ( length-- != 0 ) {
313
- crc = ((crc >> 8 ) & 0x00FFFFFFL ) ^ (CRC32Value (((uint32_t ) crc ^ *buffer++) & 0xff ));
314
- }
315
- return ( crc );
316
- }
317
296
#endif
Original file line number Diff line number Diff line change @@ -39,8 +39,6 @@ class AP_GPS_NOVA : public AP_GPS_Backend
39
39
40
40
bool parse (uint8_t temp);
41
41
bool process_message ();
42
- uint32_t CRC32Value (uint32_t icrc);
43
- uint32_t CalculateBlockCRC32 (uint32_t length, uint8_t *buffer, uint32_t crc);
44
42
45
43
static const uint8_t NOVA_PREAMBLE1 = 0xaa ;
46
44
static const uint8_t NOVA_PREAMBLE2 = 0x44 ;
You can’t perform that action at this time.
0 commit comments