task_share module¶
Interrupt-safe inter-task data sharing for MicroPython.
Provides Share and Queue classes that allow tasks to
exchange data without risk of corruption from interrupts. Shares hold a
single value; queues provide a FIFO buffer. Both use MicroPython’s
micropython.schedule / IRQ primitives to guarantee atomic access.
- author:
JR Ridgely
- date:
2017-Jan-01 — original creation; 2021-Dec-18 — docstrings updated
- copyright:
Copyright (c) 2017-2023 by JR Ridgely, released under the GNU Public License v3.0. Provided for educational use without warranty.
- class task_share.Queue(type_code, size, thread_protect=False, overwrite=False, name=None)[source]¶
Bases:
BaseShare- any()¶
- empty()¶
- full()¶
- get(in_ISR=False)¶
- num_in()¶
- put(item, in_ISR=False)¶
- ser_num = 0¶