File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,6 +130,10 @@ Functions
130130 a critical region but they will not be executed until that region
131131 is exited. An example of a critical region is a preempting interrupt
132132 handler (an IRQ).
133+ - Inside native code functions, scheduled functions are not called unless
134+ the native code calls a function that specifically does so.
135+ - ``time.sleep `` and ``time.sleep_ms ``, including zero-duration sleeps,
136+ will call scheduled functions.
133137
134138 A use for this function is to schedule a callback from a preempting IRQ.
135139 Such an IRQ puts restrictions on the code that runs in the IRQ (for example
Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ Functions
7171 other boards may not accept a floating-point argument, for compatibility with
7272 them use `sleep_ms() ` and `sleep_us() ` functions.
7373
74+ Calling ``sleep ``, including ``sleep(0) `` is guaranteed to call pending callback
75+ functions.
76+
7477.. function :: sleep_ms(ms)
7578
7679 Delay for given number of milliseconds, should be positive or 0.
@@ -80,6 +83,9 @@ Functions
8083 interrupt handlers or other threads. Passing in 0 for *ms * will still allow
8184 this other processing to occur. Use `sleep_us() ` for more precise delays.
8285
86+ Calling ``sleep_ms ``, including ``sleep_ms(0) `` is guaranteed to call
87+ pending callback functions.
88+
8389.. function :: sleep_us(us)
8490
8591 Delay for given number of microseconds, should be positive or 0.
You can’t perform that action at this time.
0 commit comments