@@ -47,17 +47,6 @@ Functions
4747
4848 The default optimisation level is usually level 0.
4949
50- .. function :: alloc_emergency_exception_buf(size)
51-
52- Allocate *size * bytes of RAM for the emergency exception buffer (a good
53- size is around 100 bytes). The buffer is used to create exceptions in cases
54- when normal RAM allocation would fail (eg within an interrupt handler) and
55- therefore give useful traceback information in these situations.
56-
57- A good way to use this function is to put it at the start of your main script
58- (eg ``boot.py `` or ``main.py ``) and then the emergency exception buffer will be active
59- for all the code following it.
60-
6150.. function :: mem_info([verbose])
6251
6352 Print information about currently used memory. If the *verbose * argument
@@ -102,38 +91,3 @@ Functions
10291 This function can be used to prevent the capturing of Ctrl-C on the
10392 incoming stream of characters that is usually used for the REPL, in case
10493 that stream is used for other purposes.
105-
106- .. function :: schedule(func, arg)
107-
108- Schedule the function *func * to be executed "very soon". The function
109- is passed the value *arg * as its single argument. "Very soon" means that
110- the MicroPython runtime will do its best to execute the function at the
111- earliest possible time, given that it is also trying to be efficient, and
112- that the following conditions hold:
113-
114- - A scheduled function will never preempt another scheduled function.
115- - Scheduled functions are always executed "between opcodes" which means
116- that all fundamental Python operations (such as appending to a list)
117- are guaranteed to be atomic.
118- - A given port may define "critical regions" within which scheduled
119- functions will never be executed. Functions may be scheduled within
120- a critical region but they will not be executed until that region
121- is exited. An example of a critical region is a preempting interrupt
122- handler (an IRQ).
123-
124- A use for this function is to schedule a callback from a preempting IRQ.
125- Such an IRQ puts restrictions on the code that runs in the IRQ (for example
126- the heap may be locked) and scheduling a function to call later will lift
127- those restrictions.
128-
129- Note: If `schedule() ` is called from a preempting IRQ, when memory
130- allocation is not allowed and the callback to be passed to `schedule() ` is
131- a bound method, passing this directly will fail. This is because creating a
132- reference to a bound method causes memory allocation. A solution is to
133- create a reference to the method in the class constructor and to pass that
134- reference to `schedule() `. This is discussed in detail here
135- :ref: `reference documentation <isr_rules >` under "Creation of Python
136- objects".
137-
138- There is a finite stack to hold the scheduled functions and `schedule() `
139- will raise a `RuntimeError ` if the stack is full.
0 commit comments