2015-06-04 23:53:26 +01:00
|
|
|
:mod:`micropython` -- access and control MicroPython internals
|
|
|
|
==============================================================
|
2015-03-30 00:32:29 +01:00
|
|
|
|
|
|
|
.. module:: micropython
|
2015-06-04 23:53:26 +01:00
|
|
|
:synopsis: access and control MicroPython internals
|
2015-03-30 00:32:29 +01:00
|
|
|
|
|
|
|
Functions
|
|
|
|
---------
|
|
|
|
|
2015-06-10 22:29:56 +01:00
|
|
|
.. only:: port_pyboard or port_unix
|
|
|
|
|
|
|
|
.. function:: mem_info([verbose])
|
|
|
|
|
|
|
|
Print information about currently used memory. If the ``verbose`` argument
|
|
|
|
is given then extra information is printed.
|
|
|
|
|
|
|
|
The information that is printed is implementation dependent, but currently
|
|
|
|
includes the amount of stack and heap used. In verbose mode it prints out
|
|
|
|
the entire heap indicating which blocks are used and which are free.
|
|
|
|
|
|
|
|
.. function:: qstr_info([verbose])
|
|
|
|
|
|
|
|
Print information about currently interned strings. If the ``verbose``
|
|
|
|
argument is given then extra information is printed.
|
|
|
|
|
|
|
|
The information that is printed is implementation dependent, but currently
|
|
|
|
includes the number of interned strings and the amount of RAM they use. In
|
|
|
|
verbose mode it prints out the names of all RAM-interned strings.
|
2015-03-30 00:32:29 +01:00
|
|
|
|
|
|
|
.. function:: alloc_emergency_exception_buf(size)
|
|
|
|
|
|
|
|
Allocate ``size`` bytes of RAM for the emergency exception buffer (a good
|
|
|
|
size is around 100 bytes). The buffer is used to create exceptions in cases
|
2015-02-09 00:42:08 +00:00
|
|
|
when normal RAM allocation would fail (eg within an interrupt handler) and
|
|
|
|
therefore give useful traceback information in these situations.
|
2015-03-30 00:32:29 +01:00
|
|
|
|
|
|
|
A good way to use this function is to put it at the start of your main script
|
|
|
|
(eg boot.py or main.py) and then the emergency exception buffer will be active
|
|
|
|
for all the code following it.
|