Skip to content

Commit a499341

Browse files
committed
K64F CRC driver: Fix coding style
1 parent ee6a07e commit a499341

File tree

1 file changed

+36
-36
lines changed
  • targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F

1 file changed

+36
-36
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/mbed_crc_api.c

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,54 +25,54 @@ static uint32_t final_xor;
2525

2626
bool hal_crc_is_supported(const crc_mbed_config_t* config)
2727
{
28-
if (config == NULL) {
29-
return false;
30-
}
28+
if (config == NULL) {
29+
return false;
30+
}
3131

32-
if ((config->width != 32) && (config->width != 16)) {
33-
return false;
34-
}
32+
if ((config->width != 32) && (config->width != 16)) {
33+
return false;
34+
}
3535

36-
return true;
36+
return true;
3737
}
3838

3939
void hal_crc_compute_partial_start(const crc_mbed_config_t* config)
4040
{
41-
if (config == NULL) {
42-
return;
43-
}
44-
45-
width = (config->width == 32) ? kCrcBits32 : kCrcBits16;
46-
final_xor = config->final_xor;
47-
48-
crc_config_t platform_config;
49-
platform_config.polynomial = config->polynomial;
50-
platform_config.seed = config->initial_xor;
51-
platform_config.reflectIn = config->reflect_in;
52-
platform_config.reflectOut = config->reflect_out;
53-
if ((width == kCrcBits16 && config->final_xor == 0xFFFFU) ||
54-
(width == kCrcBits32 && config->final_xor == 0xFFFFFFFFU)) {
55-
platform_config.complementChecksum = true;
56-
} else {
57-
platform_config.complementChecksum = false;
58-
}
59-
platform_config.crcBits = width;
60-
platform_config.crcResult = kCrcFinalChecksum;
61-
62-
CRC_Init(CRC0, &platform_config);
41+
if (config == NULL) {
42+
return;
43+
}
44+
45+
width = (config->width == 32) ? kCrcBits32 : kCrcBits16;
46+
final_xor = config->final_xor;
47+
48+
crc_config_t platform_config;
49+
platform_config.polynomial = config->polynomial;
50+
platform_config.seed = config->initial_xor;
51+
platform_config.reflectIn = config->reflect_in;
52+
platform_config.reflectOut = config->reflect_out;
53+
if ((width == kCrcBits16 && config->final_xor == 0xFFFFU) ||
54+
(width == kCrcBits32 && config->final_xor == 0xFFFFFFFFU)) {
55+
platform_config.complementChecksum = true;
56+
} else {
57+
platform_config.complementChecksum = false;
58+
}
59+
platform_config.crcBits = width;
60+
platform_config.crcResult = kCrcFinalChecksum;
61+
62+
CRC_Init(CRC0, &platform_config);
6363
}
6464

6565
void hal_crc_compute_partial(const uint8_t *data, const size_t size)
6666
{
67-
if (data == NULL) {
68-
return;
69-
}
67+
if (data == NULL) {
68+
return;
69+
}
7070

71-
if (size == 0) {
72-
return;
73-
}
71+
if (size == 0) {
72+
return;
73+
}
7474

75-
CRC_WriteData(CRC0, data, size);
75+
CRC_WriteData(CRC0, data, size);
7676
}
7777

7878
uint32_t hal_crc_get_result(void)

0 commit comments

Comments
 (0)