mirror of
https://github.com/esphome/esphome.git
synced 2025-03-31 16:08:15 +01:00
[core] Fix s2 build after crc header fix (#8459)
This commit is contained in:
parent
bc999b50b3
commit
e7d1072c85
@ -70,7 +70,9 @@ static const uint16_t CRC16_8408_LE_LUT_L[] = {0x0000, 0x1189, 0x2312, 0x329b, 0
|
||||
0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7};
|
||||
static const uint16_t CRC16_8408_LE_LUT_H[] = {0x0000, 0x1081, 0x2102, 0x3183, 0x4204, 0x5285, 0x6306, 0x7387,
|
||||
0x8408, 0x9489, 0xa50a, 0xb58b, 0xc60c, 0xd68d, 0xe70e, 0xf78f};
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ESP32) || defined(USE_ESP32_VARIANT_ESP32S2)
|
||||
static const uint16_t CRC16_1021_BE_LUT_L[] = {0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
|
||||
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef};
|
||||
static const uint16_t CRC16_1021_BE_LUT_H[] = {0x0000, 0x1231, 0x2462, 0x3653, 0x48c4, 0x5af5, 0x6ca6, 0x7e97,
|
||||
@ -151,7 +153,7 @@ uint16_t crc16(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t reverse
|
||||
}
|
||||
|
||||
uint16_t crc16be(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t poly, bool refin, bool refout) {
|
||||
#ifdef USE_ESP32
|
||||
#if defined(USE_ESP32) && !defined(USE_ESP32_VARIANT_ESP32S2)
|
||||
if (poly == 0x1021) {
|
||||
crc = crc16_be(refin ? crc : (crc ^ 0xffff), data, len);
|
||||
return refout ? crc : (crc ^ 0xffff);
|
||||
@ -160,7 +162,7 @@ uint16_t crc16be(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t poly,
|
||||
if (refin) {
|
||||
crc ^= 0xffff;
|
||||
}
|
||||
#ifndef USE_ESP32
|
||||
#if !defined(USE_ESP32) || defined(USE_ESP32_VARIANT_ESP32S2)
|
||||
if (poly == 0x1021) {
|
||||
while (len--) {
|
||||
uint8_t combo = (crc >> 8) ^ *data++;
|
||||
@ -178,7 +180,7 @@ uint16_t crc16be(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t poly,
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef USE_ESP32
|
||||
#if !defined(USE_ESP32) || defined(USE_ESP32_VARIANT_ESP32S2)
|
||||
}
|
||||
#endif
|
||||
return refout ? (crc ^ 0xffff) : crc;
|
||||
|
5
tests/components/pipsolar/test.esp32-s2-idf.yaml
Normal file
5
tests/components/pipsolar/test.esp32-s2-idf.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
<<: !include common.yaml
|
Loading…
x
Reference in New Issue
Block a user