Skip to content

Commit 7d3622f

Browse files
almir-okatogustavonihei
authored andcommitted
boot_serial: espressif: change CRC call for esp chips general compatibility
Signed-off-by: Almir Okato <[email protected]>
1 parent 6ea3e9b commit 7d3622f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

boot/boot_serial/src/boot_serial.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#elif __ESPRESSIF__
4141
#include <bootloader_utility.h>
4242
#include <esp_rom_sys.h>
43-
#include <rom/crc.h>
43+
#include <esp_crc.h>
4444
#include <endian.h>
4545
#include <mbedtls/base64.h>
4646
#else
@@ -732,8 +732,8 @@ boot_serial_output(void)
732732
crc = crc16_itu_t(crc, data, len);
733733
#elif __ESPRESSIF__
734734
/* For ESP32 it was used the CRC API in rom/crc.h */
735-
crc = ~crc16_be(~CRC16_INITIAL_CRC, (uint8_t *)bs_hdr, sizeof(*bs_hdr));
736-
crc = ~crc16_be(~crc, (uint8_t *)data, len);
735+
crc = ~esp_crc16_be(~CRC16_INITIAL_CRC, (uint8_t *)bs_hdr, sizeof(*bs_hdr));
736+
crc = ~esp_crc16_be(~crc, (uint8_t *)data, len);
737737
#else
738738
crc = crc16_ccitt(CRC16_INITIAL_CRC, bs_hdr, sizeof(*bs_hdr));
739739
crc = crc16_ccitt(crc, data, len);
@@ -819,7 +819,7 @@ boot_serial_in_dec(char *in, int inlen, char *out, int *out_off, int maxout)
819819
#ifdef __ZEPHYR__
820820
crc = crc16_itu_t(CRC16_INITIAL_CRC, out, len);
821821
#elif __ESPRESSIF__
822-
crc = ~crc16_be(~CRC16_INITIAL_CRC, (uint8_t *)out, len);
822+
crc = ~esp_crc16_be(~CRC16_INITIAL_CRC, (uint8_t *)out, len);
823823
#else
824824
crc = crc16_ccitt(CRC16_INITIAL_CRC, out, len);
825825
#endif

0 commit comments

Comments
 (0)