File tree Expand file tree Collapse file tree 3 files changed +5
-1
lines changed
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ class MbedCRC
203
203
if (_mode == HARDWARE) {
204
204
crc_mbed_config_t config;
205
205
config.polynomial = polynomial;
206
+ config.width = width;
206
207
config.initial_xor = _initial_value;
207
208
config.final_xor = _final_xor;
208
209
config.reflect_in = _reflect_data;
@@ -440,6 +441,7 @@ class MbedCRC
440
441
#ifdef DEVICE_CRC
441
442
crc_mbed_config_t config;
442
443
config.polynomial = polynomial;
444
+ config.width = width;
443
445
config.initial_xor = _initial_value;
444
446
config.final_xor = _final_xor;
445
447
config.reflect_in = _reflect_data;
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ typedef enum crc_polynomial {
38
38
typedef struct crc_mbed_config {
39
39
/// CRC Polynomial. Example polynomial: 0x21 = 0010_0011 = x^5+x+1
40
40
uint32_t polynomial ;
41
+ /// CRC Bit Width
42
+ uint32_t width ;
41
43
/// Initial seed value for the computation.
42
44
uint32_t initial_xor ;
43
45
/// Final xor value for the computation.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ bool hal_crc_is_supported(const crc_mbed_config_t* config)
12
12
if (config == NULL )
13
13
return false;
14
14
15
- if ((config -> polynomial & 0x80008000 ) == 0 )
15
+ if ((config -> width != 32 ) || ( config -> width != 16 ) )
16
16
return false;
17
17
18
18
return true;
You can’t perform that action at this time.
0 commit comments