Skip to content

Commit ebe8f10

Browse files
committed
docs: Update docuementation to OpenMV v5.0.0.
1 parent 8d430b8 commit ebe8f10

232 files changed

Lines changed: 22677 additions & 14097 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/conf.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
micropy_all_versions = (os.getenv("MICROPY_ALL_VERSIONS") or "latest").split(",")
2727
url_pattern = "%s/en/%%s" % (os.getenv("MICROPY_URL_PREFIX") or "/",)
2828

29+
# The OpenMV firmware version this documentation describes.
30+
openmv_version = "5.0.0"
31+
2932
# The members of the html_context dict are available inside topindex.html
3033
html_context = {
3134
"cur_version": micropy_version,
@@ -34,6 +37,7 @@
3437
("PDF", url_pattern % micropy_version + "/micropython-docs.pdf"),
3538
],
3639
"is_release": micropy_version != "latest",
40+
"openmv_version": openmv_version,
3741
}
3842

3943
# Authors used in various parts of the documentation.
@@ -80,7 +84,7 @@
8084
#
8185
# We don't follow "The short X.Y version" vs "The full version, including alpha/beta/rc tags"
8286
# breakdown, so use the same version identifier for both to avoid confusion.
83-
version = release = "1.26"
87+
version = release = "1.28"
8488

8589
# The language for content autogenerated by Sphinx. Refer to documentation
8690
# for a list of supported languages.
@@ -105,11 +109,15 @@
105109
"esp8266",
106110
"pyboard",
107111
"wipy",
112+
"library/_thread.rst",
108113
"library/btree.rst",
114+
"library/weakref.rst",
115+
"library/omv.uftpd.rst",
116+
"library/omv.utelnet.rst",
117+
"library/omv.uping.rst",
109118
"library/esp.rst",
110119
"library/espnow.rst",
111120
"library/esp32.rst",
112-
"library/framebuf.rst",
113121
"library/rp2.rst",
114122
"library/rp2.DMA.rst",
115123
"library/rp2.Flash.rst",
@@ -122,17 +130,13 @@
122130
"library/zephyr.zsensor.rst",
123131
"library/lcd160cr.rst",
124132
"library/machine.ADCWiPy.rst",
125-
"library/machine.Counter.rst",
126133
"library/machine.DAC.rst",
127-
"library/machine.Encoder.rst",
128134
"library/machine.SD.rst",
129-
"library/machine.SDCard.rst",
130135
"library/machine.TimerWiPy.rst",
131136
"library/machine.USBDevice.rst",
132137
"library/network.CC3K.rst",
133138
"library/network.WIZNET5K.rst",
134139
"library/network.WLANWiPy.rst",
135-
"library/neopixel.rst",
136140
"library/pyb.Accel.rst",
137141
"library/pyb.LCD.rst",
138142
"library/pyb.Switch.rst",

docs/library/_thread.rst

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,77 @@
44
.. module:: _thread
55
:synopsis: multithreading support
66

7-
|see_cpython_module| :mod:`python:_thread`.
7+
This module provides low-level primitives for working with multiple threads
8+
of execution: spawning new threads, querying the current thread identifier,
9+
and creating mutex locks for synchronisation. It is intended as a foundation
10+
for higher-level threading abstractions.
811

9-
This module implements multithreading support.
12+
A thread, once started, executes independently from the thread that spawned it.
13+
There is no built-in way to join, cancel, or otherwise interact with a running
14+
thread; synchronisation must be performed explicitly using lock objects.
1015

11-
This module is highly experimental and its API is not yet fully settled
12-
and not yet described in this documentation.
16+
Functions
17+
---------
18+
19+
.. function:: start_new_thread(function: Callable[..., Any], args: tuple, kwargs: dict | None = None) -> int
20+
21+
Start a new thread that runs ``function(*args, **kwargs)`` and return its
22+
integer thread identifier. *args* must be a tuple of positional arguments;
23+
*kwargs*, if given, must be a dict of keyword arguments.
24+
25+
If the thread terminates with an unhandled exception (other than
26+
:exc:`SystemExit`), a traceback is printed and the thread exits.
27+
28+
.. function:: exit() -> None
29+
30+
Raise :exc:`SystemExit` in the calling thread, terminating it. This has
31+
the same effect as ``raise SystemExit``.
32+
33+
.. function:: get_ident() -> int
34+
35+
Return the integer "thread identifier" of the current thread. The value
36+
has no direct meaning beyond identifying a particular thread for the
37+
lifetime of that thread.
38+
39+
.. function:: allocate_lock() -> Lock
40+
41+
Return a new lock object (initially unlocked). See the :class:`Lock`
42+
class below for details.
43+
44+
.. function:: stack_size(size: int = 0, /) -> int
45+
46+
Return the thread stack size used when creating new threads. The optional
47+
*size* argument sets the stack size, in bytes, to be used for subsequently
48+
created threads; a value of ``0`` selects the platform default. The
49+
previous value is returned.
50+
51+
Lock objects
52+
------------
53+
54+
.. class:: Lock
55+
56+
A primitive mutex (mutual exclusion) lock. When locked, it belongs to
57+
the thread that locked it; when unlocked, it does not belong to any
58+
thread. Lock objects are created via :func:`allocate_lock` and cannot
59+
be instantiated directly.
60+
61+
Lock objects support the context manager protocol: using a lock with the
62+
``with`` statement acquires it on entry and releases it on exit.
63+
64+
.. method:: acquire(blocking: bool = True, /) -> bool
65+
66+
Acquire the lock. If *blocking* is true (the default), block until
67+
the lock is available, then take it and return ``True``. If
68+
*blocking* is false, return ``True`` immediately if the lock could
69+
be taken, or ``False`` if it could not.
70+
71+
.. method:: release() -> None
72+
73+
Release the lock, allowing another thread that is blocked waiting
74+
for it to proceed. The lock must be held by the calling thread;
75+
calling :meth:`release` on an unlocked lock raises :exc:`RuntimeError`.
76+
77+
.. method:: locked() -> bool
78+
79+
Return ``True`` if the lock is currently held by some thread, and
80+
``False`` otherwise.

0 commit comments

Comments
 (0)