From b8184ca3b7bb96fe024784f211a2fed4feac13c0 Mon Sep 17 00:00:00 2001 From: Pisit Sawangvonganan Date: Sat, 23 Dec 2023 13:50:33 +0700 Subject: [PATCH] lib: crc: address absence of crc4, crc4_ti in crc_types array Added CRC4 and CRC4_TI to the supported crc_types[] array. On some SoCs, like ESP32-S3, missing values can cause hardfaults due to attempts to access the zero address. Signed-off-by: Pisit Sawangvonganan --- lib/crc/crc_shell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/crc/crc_shell.c b/lib/crc/crc_shell.c index e75d88623e1..32393ff6f6e 100644 --- a/lib/crc/crc_shell.c +++ b/lib/crc/crc_shell.c @@ -19,9 +19,11 @@ #include static const char *const crc_types[] = { + [CRC4] = "4", + [CRC4_TI] = "4_ti", [CRC7_BE] = "7_be", [CRC8] = "8", - [CRC8_CCITT] "8_ccitt", + [CRC8_CCITT] = "8_ccitt", [CRC16] = "16", [CRC16_ANSI] = "16_ansi", [CRC16_CCITT] = "16_ccitt",