Skip to content

Use usleep() instead of nanosleep() for OS::sleep() on ESP-IDF - #97

Open
jamiecounsell wants to merge 1 commit into
attermann:masterfrom
zerokelvin-dev:os-sleep-usleep
Open

jamiecounsell wants to merge 1 commit into
attermann:masterfrom
zerokelvin-dev:os-sleep-usleep

Conversation

@jamiecounsell

Copy link
Copy Markdown

OS::sleep() used nanosleep() on non-Arduino builds, which ESP-IDF doesn't provide, so ESP-IDF builds failed to link. This switches to usleep(), which is POSIX and works on ESP-IDF, Linux and macOS.

Testing: running in SolarOS on a ThinkNode M9 (ESP32-S3, ESP-IDF) against Python RNS nodes over LoRa, exchanging LXMF messages. Native tests pass, and the series builds for ttgo-lora32-v21 and wiscore_rak4631.

OS::sleep() used nanosleep() on non-Arduino builds, which ESP-IDF doesn't
provide, so ESP-IDF builds failed to link. usleep() is POSIX and works on
ESP-IDF, Linux and macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019rUgoKJdB4U8fNS9HybY8S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant