mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #11478 from hugueskamba/hk-fix-some-more-warnings
Refactor CRC constructor method to remove warningpull/11564/head
commit
ab857c4963
|
@ -514,22 +514,19 @@ private:
|
|||
MBED_STATIC_ASSERT(width <= 32, "Max 32-bit CRC supported");
|
||||
|
||||
#if DEVICE_CRC
|
||||
if (POLY_32BIT_REV_ANSI == polynomial) {
|
||||
_crc_table = (uint32_t *)Table_CRC_32bit_Rev_ANSI;
|
||||
_mode = TABLE;
|
||||
return;
|
||||
}
|
||||
crc_mbed_config_t config;
|
||||
config.polynomial = polynomial;
|
||||
config.width = width;
|
||||
config.initial_xor = _initial_value;
|
||||
config.final_xor = _final_xor;
|
||||
config.reflect_in = _reflect_data;
|
||||
config.reflect_out = _reflect_remainder;
|
||||
if (POLY_32BIT_REV_ANSI != polynomial) {
|
||||
crc_mbed_config_t config;
|
||||
config.polynomial = polynomial;
|
||||
config.width = width;
|
||||
config.initial_xor = _initial_value;
|
||||
config.final_xor = _final_xor;
|
||||
config.reflect_in = _reflect_data;
|
||||
config.reflect_out = _reflect_remainder;
|
||||
|
||||
if (hal_crc_is_supported(&config)) {
|
||||
_mode = HARDWARE;
|
||||
return;
|
||||
if (hal_crc_is_supported(&config)) {
|
||||
_mode = HARDWARE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue