Skip to content

Commit 070eb48

Browse files
committed
Add clarifying comments to esp_suspend and esp_delay overloads.
1 parent cd8d2d3 commit 070eb48

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cores/esp8266/coredecls.h

+9
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,23 @@ void settimeofday_cb (const TrivialCB& cb);
4242

4343
using IsBlockedCB = std::function<bool()>;
4444

45+
// This overload of esp_suspend() performs the blocked callback whenever it is resumed,
46+
// and if that returns true, it immediately suspends again.
4547
inline void esp_suspend(const IsBlockedCB& blocked) {
4648
do {
4749
esp_suspend();
4850
} while (blocked());
4951
}
5052

53+
// This overload of esp_delay() delays for a duration of at most timeout_ms milliseconds.
54+
// Whenever it is resumed, as well as every intvl_ms millisconds, it performs
55+
// the blocked callback, and if that returns true, it keeps delaying for the remainder
56+
// of the original timeout_ms period.
5157
void esp_delay(const uint32_t timeout_ms, const IsBlockedCB& blocked, const uint32_t intvl_ms);
5258

59+
// This overload of esp_delay() delays for a duration of at most timeout_ms milliseconds.
60+
// Whenever it is resumed, it performs the blocked callback, and if that returns true,
61+
// it keeps delaying for the remainder of the original timeout_ms period.
5362
inline void esp_delay(const uint32_t timeout_ms, const IsBlockedCB& blocked) {
5463
esp_delay(timeout_ms, blocked, timeout_ms);
5564
}

0 commit comments

Comments
 (0)