Skip to content

Commit df93c01

Browse files
author
Steven Cartmell
committed
Remove support for 7/8 bit CRC polynomials for K64F
1 parent 5847f0c commit df93c01

File tree

2 files changed

+35
-29
lines changed

2 files changed

+35
-29
lines changed

hal/crc_api.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/** \addtogroup hal */
2+
/** @{*/
3+
/* mbed Microcontroller Library
4+
* Copyright (c) 2018 ARM Limited
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
118
#ifndef MBED_CRC_HAL_API_H
219
#define MBED_CRC_HAL_API_H
320

@@ -24,6 +41,15 @@ typedef enum crc_polynomial {
2441
extern "C" {
2542
#endif
2643

44+
/**
45+
* \defgroup hal_crc Hardware CRC
46+
*
47+
* The Hardware CRC HAL API provides a low-level interface to the Hardware CRC
48+
* module of a target platform.
49+
*
50+
* @{
51+
*/
52+
2753
/** Determine if the current platform supports hardware CRC for given polynomial
2854
*
2955
* The purpose of this function is to inform the CRC Platform API whether the
@@ -122,9 +148,13 @@ void hal_crc_compute_partial(const uint8_t *data, const size_t size);
122148
*/
123149
uint32_t hal_crc_get_result(void);
124150

151+
/**@}*/
152+
125153
#ifdef __cplusplus
126154
};
127155
#endif
128156

129157
#endif // DEVICE_CRC
130158
#endif // MBED_CRC_HAL_API_H
159+
160+
/**@}*/

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/mbed_crc_api.c

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ bool hal_crc_is_supported(const uint32_t polynomial)
1111
{
1212
switch (polynomial)
1313
{
14-
case POLY_8BIT_CCITT:
15-
case POLY_7BIT_SD:
1614
case POLY_16BIT_CCITT:
1715
case POLY_16BIT_IBM:
1816
case POLY_32BIT_ANSI:
1917
return true;
18+
case POLY_8BIT_CCITT:
19+
case POLY_7BIT_SD:
20+
return false;
2021
default:
2122
return false;
2223
}
@@ -70,34 +71,9 @@ void hal_crc_compute_partial_start(const uint32_t polynomial)
7071

7172
break;
7273
}
73-
case POLY_8BIT_CCITT:
74-
{
75-
width = kCrcBits16;
76-
77-
config.polynomial = polynomial;
78-
config.seed = 0U;
79-
config.reflectIn = false;
80-
config.reflectOut = false;
81-
config.complementChecksum = false;
82-
config.crcBits = width;
83-
config.crcResult = kCrcFinalChecksum;
84-
85-
break;
86-
}
87-
case POLY_7BIT_SD:
88-
{
89-
width = kCrcBits16;
90-
91-
config.polynomial = polynomial;
92-
config.seed = 0U;
93-
config.reflectIn = false;
94-
config.reflectOut = false;
95-
config.complementChecksum = false;
96-
config.crcBits = width;
97-
config.crcResult = kCrcFinalChecksum;
98-
74+
default:
75+
MBED_ASSERT("Configuring Mbed CRC with unsupported polynomial");
9976
break;
100-
}
10177
}
10278

10379
CRC_Init(CRC0, &config);

0 commit comments

Comments
 (0)