@@ -371,6 +371,9 @@ modwlan_Status_t wlan_sl_enable (SlWlanMode_t mode, const char *ssid, uint8_t ss
371
371
// if the device is in AP mode, we need to wait for this event
372
372
// before doing anything
373
373
while (!IS_IP_ACQUIRED (wlan_obj .status )) {
374
+ #ifndef SL_PLATFORM_MULTI_THREADED
375
+ _SlTaskEntry ();
376
+ #endif
374
377
HAL_Delay (5 );
375
378
}
376
379
}
@@ -386,6 +389,9 @@ modwlan_Status_t wlan_sl_enable (SlWlanMode_t mode, const char *ssid, uint8_t ss
386
389
// other return-codes
387
390
if (0 == sl_WlanDisconnect ()) {
388
391
while (IS_CONNECTED (wlan_obj .status )) {
392
+ #ifndef SL_PLATFORM_MULTI_THREADED
393
+ _SlTaskEntry ();
394
+ #endif
389
395
HAL_Delay (5 );
390
396
}
391
397
}
@@ -516,7 +522,7 @@ void wlan_set_pm_policy (uint8_t policy) {
516
522
void wlan_servers_stop (void ) {
517
523
servers_disable ();
518
524
do {
519
- HAL_Delay (2 );
525
+ HAL_Delay (5 );
520
526
} while (servers_are_enabled ());
521
527
}
522
528
@@ -553,9 +559,12 @@ STATIC modwlan_Status_t wlan_do_connect (const char* ssid, uint32_t ssid_len, co
553
559
554
560
if (0 == sl_WlanConnect ((_i8 * )ssid , ssid_len , (_u8 * )bssid , & secParams , NULL )) {
555
561
556
- // Wait for WLAN Event
562
+ // Wait for the WLAN Event
557
563
uint32_t waitForConnectionMs = 0 ;
558
564
while (!IS_CONNECTED (wlan_obj .status )) {
565
+ #ifndef SL_PLATFORM_MULTI_THREADED
566
+ _SlTaskEntry ();
567
+ #endif
559
568
HAL_Delay (5 );
560
569
if (++ waitForConnectionMs >= MODWLAN_TIMEOUT_MS ) {
561
570
return MODWLAN_ERROR_TIMEOUT ;
@@ -777,6 +786,9 @@ STATIC mp_obj_t wlan_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_
777
786
if (GET_STATUS_BIT (wlan_obj .status , STATUS_BIT_CONNECTION )) {
778
787
if (0 == sl_WlanDisconnect ()) {
779
788
while (IS_CONNECTED (wlan_obj .status )) {
789
+ #ifndef SL_PLATFORM_MULTI_THREADED
790
+ _SlTaskEntry ();
791
+ #endif
780
792
HAL_Delay (5 );
781
793
}
782
794
}
0 commit comments