File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 6
6
#ifdef DEVICE_CRC
7
7
8
8
static crc_bits_t width ;
9
+ static uint32_t final_xor ;
9
10
10
11
bool hal_crc_is_supported (const crc_mbed_config_t * config )
11
12
{
@@ -24,13 +25,14 @@ void hal_crc_compute_partial_start(const crc_mbed_config_t* config)
24
25
return ;
25
26
26
27
width = ((config -> polynomial & 0xFFFF0000U ) != 0 ) ? kCrcBits32 : kCrcBits16 ;
28
+ final_xor = config -> final_xor ;
27
29
28
30
crc_config_t platform_config ;
29
31
platform_config .polynomial = config -> polynomial ;
30
32
platform_config .seed = config -> initial_xor ;
31
33
platform_config .reflectIn = config -> reflect_in ;
32
34
platform_config .reflectOut = config -> reflect_out ;
33
- platform_config .complementChecksum = true ;
35
+ platform_config .complementChecksum = ( config -> final_xor == 0xFFFFFFFFU ) ;
34
36
platform_config .crcBits = width ;
35
37
platform_config .crcResult = kCrcFinalChecksum ;
36
38
@@ -50,6 +52,11 @@ void hal_crc_compute_partial(const uint8_t *data, const size_t size)
50
52
51
53
uint32_t hal_crc_get_result (void )
52
54
{
55
+ if ((final_xor != 0x00000000U ) && (final_xor != 0xFFFFFFFFU ))
56
+ {
57
+ CRC_WriteData (CRC0 , (uint8_t * )& final_xor , sizeof (final_xor ));
58
+ }
59
+
53
60
switch (width )
54
61
{
55
62
case kCrcBits16 :
You can’t perform that action at this time.
0 commit comments