Logo
Explore Help
Register Sign In
fengqi/lv_micropython
1
0
Fork 0
You've already forked lv_micropython
Code Issues Pull Requests 1 Actions Packages Projects Releases Wiki Activity
lv_micropython/tests/extmod/asyncio_threadsafeflag.py.exp

31 lines
247 B
Plaintext
Raw Normal View History

tests/extmod: Add test for ThreadSafeFlag. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-02-15 17:28:39 +11:00
yield
task 1
set event
yield
wait task
task 1 done
----
yield
task 2
set event
yield
wait task
task 2 done
----
set event
yield
task 3
task 3 done
wait task
extmod/uasyncio: Add clear method to ThreadSafeFlag. This is useful in situations where the ThreadSafeFlag is reused and needs to be cleared of any previous, unwanted event. For example, clear the flag at the start of an operation, trigger the operation (eg an I2C write), then (a)wait for an external event to set the flag (eg a pin IRQ). Further events may trigger the flag again but these are unwanted and should be cleared before the next cycle starts.
2021-09-01 10:48:15 -07:00
----
set event
yield
clear event
yield
yield
task 4
set event
yield
wait task
task 4 done
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 91ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API