We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd011d8 commit 87b23a4Copy full SHA for 87b23a4
src/WebSocketsServer.cpp
@@ -25,6 +25,14 @@
25
#include "WebSockets.h"
26
#include "WebSocketsServer.h"
27
28
+#ifdef ESP32
29
+#if defined __has_include
30
+#if __has_include("soc/wdev_reg.h")
31
+#include "soc/wdev_reg.h"
32
+#endif // __has_include
33
+#endif // defined __has_include
34
+#endif
35
+
36
WebSocketsServerCore::WebSocketsServerCore(const String & origin, const String & protocol) {
37
_origin = origin;
38
_protocol = protocol;
@@ -87,6 +95,8 @@ void WebSocketsServerCore::begin(void) {
87
95
88
96
#ifdef ESP8266
89
97
randomSeed(RANDOM_REG32);
98
+#elif defined(ESP32) && defined(WDEV_RND_REG)
99
+ randomSeed(REG_READ(WDEV_RND_REG));
90
100
#elif defined(ESP32)
91
101
#define DR_REG_RNG_BASE 0x3ff75144
92
102
randomSeed(READ_PERI_REG(DR_REG_RNG_BASE));
0 commit comments