Skip to content

Commit 59605ed

Browse files
committed
Only include the CRC tables once
1 parent 6d2c898 commit 59605ed

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

src/Parse_Unicore_Binary.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ License: MIT. Please see LICENSE.md for more details
1515

1616
#include <stdio.h>
1717
#include "SparkFun_Extensible_Message_Parser.h"
18-
#include "semp_crc32.h"
1918

2019
//----------------------------------------
2120
// Support routines

src/Parse_Unicore_Hash.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ License: MIT. Please see LICENSE.md for more details
1515

1616
#include <stdio.h>
1717
#include "SparkFun_Extensible_Message_Parser.h"
18-
#include "semp_crc32.h"
1918

2019
//----------------------------------------
2120
// Constants

src/SparkFun_Extensible_Message_Parser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ License: MIT. Please see LICENSE.md for more details
1010
#include <stdio.h>
1111
#include <string.h>
1212
#include "SparkFun_Extensible_Message_Parser.h"
13+
#include "semp_crc32.h"
1314

1415
//----------------------------------------
1516
// Constants

src/SparkFun_Extensible_Message_Parser.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ License: MIT. Please see LICENSE.md for more details
1717

1818
#define SEMP_MINIMUM_BUFFER_LENGTH 32
1919

20+
//----------------------------------------
21+
// Externals
22+
//----------------------------------------
23+
24+
extern const int unsigned semp_crc24qTable[256];
25+
extern const unsigned long semp_crc32Table[256];
26+
2027
//----------------------------------------
2128
// Types
2229
//----------------------------------------

src/semp_crc24q.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@
2929
SPDX-License-Identifier: BSD-2-clause
3030
*/
3131

32+
#ifndef __SEMP_CRC24Q_H__
33+
#define __SEMP_CRC24Q_H__
34+
3235
//This file is originally from: https://gitlab.com/gpsd/gpsd/-/blob/master/gpsd/crc24q.c
3336

34-
static const int unsigned semp_crc24qTable[256] =
37+
const int unsigned semp_crc24qTable[256] =
3538
{
3639
0x00000000u, 0x01864CFBu, 0x028AD50Du, 0x030C99F6u,
3740
0x0493E6E1u, 0x0515AA1Au, 0x061933ECu, 0x079F7F17u,
@@ -98,3 +101,5 @@ static const int unsigned semp_crc24qTable[256] =
98101
0xF842FA2Fu, 0xF9C4B6D4u, 0xFAC82F22u, 0xFB4E63D9u,
99102
0xFCD11CCEu, 0xFD575035u, 0xFE5BC9C3u, 0xFFDD8538u,
100103
};
104+
105+
#endif // __SEMP_CRC24Q_H__

0 commit comments

Comments
 (0)