File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,23 @@ void settimeofday_cb (const TrivialCB& cb);
42
42
43
43
using IsBlockedCB = std::function<bool ()>;
44
44
45
+ // This overload of esp_suspend() performs the blocked callback whenever it is resumed,
46
+ // and if that returns true, it immediately suspends again.
45
47
inline void esp_suspend (const IsBlockedCB& blocked) {
46
48
do {
47
49
esp_suspend ();
48
50
} while (blocked ());
49
51
}
50
52
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.
51
57
void esp_delay (const uint32_t timeout_ms, const IsBlockedCB& blocked, const uint32_t intvl_ms);
52
58
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.
53
62
inline void esp_delay (const uint32_t timeout_ms, const IsBlockedCB& blocked) {
54
63
esp_delay (timeout_ms, blocked, timeout_ms);
55
64
}
You can’t perform that action at this time.
0 commit comments