mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1412 from openmv/rp2_wifi_fixes2
RP2: Nina WiFi timeout fixes.
This commit is contained in:
commit
5960bf597a
@ -702,7 +702,7 @@ int nina_socket_accept(int fd, uint8_t *ip, uint16_t *port, int *fd_out, uint32_
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (mp_uint_t start = mp_hal_ticks_ms(); sock == 0 || sock == NO_SOCKET_AVAIL; mp_hal_delay_ms(100)) {
|
for (mp_uint_t start = mp_hal_ticks_ms(); sock == 0 || sock == NO_SOCKET_AVAIL; mp_hal_delay_ms(10)) {
|
||||||
if (nina_send_command_read_vals(AVAIL_DATA_TCP_CMD,
|
if (nina_send_command_read_vals(AVAIL_DATA_TCP_CMD,
|
||||||
1, ARG_8BITS, NINA_ARGS(ARG_BYTE(fd)),
|
1, ARG_8BITS, NINA_ARGS(ARG_BYTE(fd)),
|
||||||
1, ARG_8BITS, NINA_VALS({&size, &sock})) != 0) {
|
1, ARG_8BITS, NINA_VALS({&size, &sock})) != 0) {
|
||||||
|
|||||||
@ -518,11 +518,7 @@ static int py_nina_socket_settimeout(mod_network_socket_obj_t *socket, mp_uint_t
|
|||||||
if (timeout_ms == UINT32_MAX) {
|
if (timeout_ms == UINT32_MAX) {
|
||||||
// no timeout is given, set the socket to blocking mode.
|
// no timeout is given, set the socket to blocking mode.
|
||||||
timeout_ms = 0;
|
timeout_ms = 0;
|
||||||
} else if (timeout_ms == 0) {
|
}
|
||||||
// non-blocking mode, set the timeout to a small number other than zero.
|
|
||||||
timeout_ms = 10;
|
|
||||||
} // otherwise, timeout is provided.
|
|
||||||
|
|
||||||
socket->timeout = timeout_ms;
|
socket->timeout = timeout_ms;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user