File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Micro Python libraries
22======================
33
4+ Functionality specific to the Micro Python implementation is available in
5+ the following library.
6+
7+ .. toctree ::
8+ :maxdepth: 1
9+
10+ micropython.rst
11+
412Python standard libraries
513-------------------------
614
Original file line number Diff line number Diff line change 1+ :mod: `micropython ` -- access and control Micro Python internals
2+ ===============================================================
3+
4+ .. module :: micropython
5+ :synopsis: access and control Micro Python internals
6+
7+ Functions
8+ ---------
9+
10+ .. function :: mem_info([verbose])
11+
12+ Print information about currently used memory. If the ``verbose `` argument
13+ is given then extra information is printed.
14+
15+ The information that is printed is implementation dependent, but currently
16+ includes the amount of stack and heap used. In verbose mode it prints out
17+ the entire heap indicating which blocks are used and which are free.
18+
19+ .. function :: qstr_info([verbose])
20+
21+ Print information about currently interned strings. If the ``verbose ``
22+ argument is given then extra information is printed.
23+
24+ The information that is printed is implementation dependent, but currently
25+ includes the number of interned strings and the amount of RAM they use. In
26+ verbose mode it prints out the names of all RAM-interned strings.
27+
28+ .. function :: alloc_emergency_exception_buf(size)
29+
30+ Allocate ``size `` bytes of RAM for the emergency exception buffer (a good
31+ size is around 100 bytes). The buffer is used to create exceptions in cases
32+ when normal RAM allocation would fail (eg within an interrupt handler).
33+
34+ A good way to use this function is to put it at the start of your main script
35+ (eg boot.py or main.py) and then the emergency exception buffer will be active
36+ for all the code following it.
You can’t perform that action at this time.
0 commit comments