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 {
70
70
extern " C" {
71
71
72
72
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
74
74
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)();
80
76
}
81
77
82
-
83
78
// Avoid calling lwip_init multiple times
84
79
extern void __real_lwip_init ();
85
80
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 ());
91
83
__real_lwip_init ();
92
- initted = true ;
93
84
}
94
85
}
95
86
You can’t perform that action at this time.
0 commit comments