Skip to content

Commit f4fb7a7

Browse files
committed
Fix RP2040 Hash.h conflict with Crypto-no-arduino library
The existing ESP8266 workaround detects when Crypto-no-arduino's Hash.h is included instead of the framework's Hash library (by checking the CRYPTO_HASH_h guard) and re-includes the correct one. Extend this to RP2040/RP2350 platforms which use the same framework Hash library for sha1(). Also declare Hash as a dependency for the raspberrypi platform in library.json so PlatformIO resolves it correctly.
1 parent 4138937 commit f4fb7a7

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

library.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939
},
4040
{
4141
"name": "Hash",
42-
"platforms": "espressif8266"
42+
"platforms": [
43+
"espressif8266",
44+
"raspberrypi"
45+
]
4346
},
4447
{
4548
"owner": "ayushsharma82",

src/AsyncWebSocket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include <list>
3737
#include <memory>
3838

39-
#ifdef ESP8266
39+
#if defined(ESP8266) || defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350)
4040
#include <Hash.h>
4141
#ifdef CRYPTO_HASH_h // include Hash.h from espressif framework if the first include was from the crypto library
4242
#include <../src/Hash.h>

0 commit comments

Comments
 (0)