File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -70,26 +70,17 @@ class LWIPMutex {
7070extern " C" {
7171
7272 static XoshiroCpp::Xoshiro256PlusPlus *_lwip_rng = nullptr ;
73- // Random number generator for LWIP. Bare metal, use the HW. FreeRTOS, use xoshiro generator to avoid needing to freeze the other core
73+ // Random number generator for LWIP
7474 unsigned long __lwip_rand () {
75- if (__isFreeRTOS) {
76- return (unsigned long )(*_lwip_rng)();
77- } else {
78- return get_rand_32 ();
79- }
75+ return (unsigned long )(*_lwip_rng)();
8076 }
8177
82-
8378 // Avoid calling lwip_init multiple times
8479 extern void __real_lwip_init ();
8580 void __wrap_lwip_init () {
86- static bool initted = false ;
87- if (!initted) {
88- if (__isFreeRTOS) {
89- _lwip_rng = new XoshiroCpp::Xoshiro256PlusPlus (rp2040.getCycleCount ());
90- }
81+ if (!_lwip_rng) {
82+ _lwip_rng = new XoshiroCpp::Xoshiro256PlusPlus (get_rand_64 ());
9183 __real_lwip_init ();
92- initted = true ;
9384 }
9485 }
9586
You can’t perform that action at this time.
0 commit comments