4848#include "lwip/sio.h"
4949#endif
5050
51- // FIXME FIXME FIXME
52- #define LWIP_DELAY HAL_Delay
53-
5451#ifdef MICROPY_PY_LWIP_SLIP
5552/******************************************************************************/
5653// Slip object for modlwip. Requires a serial driver for the port that supports
@@ -324,7 +321,7 @@ STATIC mp_uint_t lwip_udp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
324321 if (socket -> incoming == NULL ) {
325322 if (socket -> timeout != -1 ) {
326323 for (mp_uint_t retries = socket -> timeout / 100 ; retries -- ;) {
327- LWIP_DELAY (100 );
324+ mp_hal_delay_ms (100 );
328325 if (socket -> incoming != NULL ) break ;
329326 }
330327 if (socket -> incoming == NULL ) {
@@ -333,7 +330,7 @@ STATIC mp_uint_t lwip_udp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
333330 }
334331 } else {
335332 while (socket -> incoming == NULL ) {
336- LWIP_DELAY (100 );
333+ mp_hal_delay_ms (100 );
337334 }
338335 }
339336 }
@@ -378,7 +375,7 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
378375 if (socket -> incoming == NULL ) {
379376 if (socket -> timeout != -1 ) {
380377 for (mp_uint_t retries = socket -> timeout / 100 ; retries -- ;) {
381- LWIP_DELAY (100 );
378+ mp_hal_delay_ms (100 );
382379 if (socket -> incoming != NULL ) break ;
383380 }
384381 if (socket -> incoming == NULL ) {
@@ -387,7 +384,7 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
387384 }
388385 } else {
389386 while (socket -> incoming == NULL ) {
390- LWIP_DELAY (100 );
387+ mp_hal_delay_ms (100 );
391388 }
392389 }
393390 }
@@ -572,15 +569,15 @@ STATIC mp_obj_t lwip_socket_accept(mp_obj_t self_in) {
572569 if (socket -> incoming == NULL ) {
573570 if (socket -> timeout != -1 ) {
574571 for (mp_uint_t retries = socket -> timeout / 100 ; retries -- ;) {
575- LWIP_DELAY (100 );
572+ mp_hal_delay_ms (100 );
576573 if (socket -> incoming != NULL ) break ;
577574 }
578575 if (socket -> incoming == NULL ) {
579576 nlr_raise (mp_obj_new_exception_arg1 (& mp_type_OSError , MP_OBJ_NEW_SMALL_INT (ETIMEDOUT )));
580577 }
581578 } else {
582579 while (socket -> incoming == NULL ) {
583- LWIP_DELAY (100 );
580+ mp_hal_delay_ms (100 );
584581 }
585582 }
586583 }
@@ -656,15 +653,15 @@ STATIC mp_obj_t lwip_socket_connect(mp_obj_t self_in, mp_obj_t addr_in) {
656653 // And now we wait...
657654 if (socket -> timeout != -1 ) {
658655 for (mp_uint_t retries = socket -> timeout / 100 ; retries -- ;) {
659- LWIP_DELAY (100 );
656+ mp_hal_delay_ms (100 );
660657 if (socket -> connected != 1 ) break ;
661658 }
662659 if (socket -> connected == 1 ) {
663660 nlr_raise (mp_obj_new_exception_arg1 (& mp_type_OSError , MP_OBJ_NEW_SMALL_INT (ETIMEDOUT )));
664661 }
665662 } else {
666663 while (socket -> connected == 1 ) {
667- LWIP_DELAY (100 );
664+ mp_hal_delay_ms (100 );
668665 }
669666 }
670667 if (socket -> connected == 2 ) {
@@ -946,7 +943,7 @@ STATIC mp_obj_t lwip_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) {
946943 }
947944 case ERR_INPROGRESS : {
948945 while (!lwip_dns_returned ) {
949- LWIP_DELAY (100 );
946+ mp_hal_delay_ms (100 );
950947 }
951948 if (lwip_dns_returned == 2 ) {
952949 nlr_raise (mp_obj_new_exception_arg1 (& mp_type_OSError , MP_OBJ_NEW_SMALL_INT (ENOENT )));
0 commit comments