circuitpython/ports/espressif/common-hal
Jeff Epler 66411fdd38
espressif: check return value from esp_ping_new_session
esp_ping_new_session can fail, particularly if ping is called quickly
many times in succession.

This is because `esp_ping_new_session` has to do a bunch of stuff
including creating a task and a socket. Calling `esp_ping_delete_session`
doesn't clean up these resources immediately. Instead, it signals the
task to clean up resources and exit 'soon', but 'soon' is defined as 1
second.

When the calls are frequent, the in-use sockets and tasks fill up
available slots—I didn't actually check which resource gets used
up first.

With this change, the ping call will raise an exception instead of
continuing with a call to esp_ping_start that crashes.

Closes #5980 based on my testing on an ESP32S3-N8R2.
2023-05-05 17:11:03 -05:00
..
_bleio fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
alarm fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
analogbufio 1. Changed attenuation from ADC_ATTEN_DB_0 to ADC_ATTEN_DB_11 2023-04-19 21:46:08 +05:30
analogio make translate and pre-commit formatting fixes 2022-07-08 16:53:53 -04:00
audiobusio espressif: i2sout: wait a short time to succesfully write data 2023-02-03 14:22:03 -06:00
board Rename esp32s2 port to espressif 2021-09-13 16:44:55 -07:00
busio Move background tasks to slower routine 2023-03-08 16:14:58 -06:00
canio wip; compiles 2022-06-26 21:22:22 -04:00
countio Merge pull request #6463 from adafruit/7.3.x 2022-06-06 11:58:05 -07:00
digitalio cyw43 basic gpio support, hwaddr in boot_out 2022-09-28 10:06:33 -05:00
dualbank improve `dualbank` errors 2022-10-15 13:20:10 +05:30
espcamera translate() messages must be one string 2023-03-14 13:13:58 -04:00
espidf use esp error for espnow 2023-02-03 15:42:44 +05:30
espnow revert `Communicate` class and more 2023-03-09 12:04:50 +05:30
espulp move `ULPArch` to `Architecture` 2023-01-26 13:01:14 +05:30
frequencyio wip; compiles 2022-06-26 21:22:22 -04:00
hashlib WIP websocket to serial 2022-07-01 16:57:10 -07:00
i2ctarget switch back one I2C message 2022-08-10 12:06:43 -04:00
imagecapture message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
mdns Add comments for MDNS code 2023-01-17 14:07:30 -08:00
memorymap Rework the coproc API 2022-12-19 14:08:38 -05:00
microcontroller Standardize CPU temp and voltage. Add autogen warning 2023-04-28 16:19:43 -07:00
neopixel_write test and adjust NeoPixel timings on multiple products 2022-04-25 23:12:24 -04:00
nvm Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
os Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
paralleldisplay Improve type validation errors messages, especially for pins 2023-01-10 15:02:55 -05:00
ps2io Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
pulseio fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
pwmio fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
rgbmatrix Rename esp32s2 port to espressif 2021-09-13 16:44:55 -07:00
rotaryio fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
rtc message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
socketpool Simplify CORS checks and don't restrict host names. 2023-04-18 22:09:48 -04:00
ssl Ensure orderly shutdown of ssl socket 2022-12-01 19:29:20 -06:00
supervisor rename left over esp32s2 to espressif 2021-09-18 19:42:18 +05:30
time Rename esp32s2 port to espressif 2021-09-13 16:44:55 -07:00
touchio Fix ESP32 touch; rework common code a bit 2022-08-16 20:04:27 -04:00
watchdog Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
wifi espressif: check return value from esp_ping_new_session 2023-05-05 17:11:03 -05:00