forked from lvgl-micropython/lvgl_micropython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_handler.pyi
More file actions
82 lines (68 loc) · 2.16 KB
/
task_handler.pyi
File metadata and controls
82 lines (68 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
##############################################################################
# Event Loop module: advancing tick count and scheduling lvgl task handler.
# Import after lvgl module.
# This should be imported and used by display driver.
# Display driver should first check if an event loop is already running.
#
# Usage example with SDL:
#
# SDL.init(auto_refresh=False)
# # Register SDL display driver.
# # Register SDL mouse driver
# event_loop = lv_utils.event_loop()
#
#
# uasyncio example with SDL:
#
# SDL.init(auto_refresh=False)
# # Register SDL display driver.
# # Register SDL mouse driver
# event_loop = lv_utils.event_loop(asynchronous=True)
# uasyncio.Loop.run_forever()
#
# uasyncio example with ili9341:
#
# event_loop = lv_utils.event_loop(asynchronous=True) # Optional!
# self.disp = ili9341(asynchronous=True)
# uasyncio.Loop.run_forever()
#
# MIT license; Copyright (c) 2021 Amir Gonnen
#
##############################################################################
from typing import Callable, ClassVar, Optional
from machine import Timer
_default_timer_id: int = ...
def _default_exception_hook(e: Exception):
...
##############################################################################
class TaskHandler(object):
_current_instance: Optional[ClassVar["TaskHandler"]] = ...
duration: int = ...
refresh_cb: Optional[Callable] = ...
_timer: Timer = ...
_task_handler_ref: Callable = ...
exception_hook: Callable[[Exception], None] = ...
max_scheduled: int = ...
_scheduled: int = ...
def __init__(
self,
duration: int = 33,
timer_id: int = _default_timer_id,
max_scheduled: int = 2,
refresh_cb: Optional[Callable] = None,
exception_hook: Callable[[Exception], None] = _default_exception_hook
):
...
def deinit(self) -> None:
...
def disable(self) -> None:
...
def enable(self) -> None:
...
@classmethod
def is_running(cls) -> bool:
...
def _task_handler(self, _) -> None:
...
def _timer_cb(self, _) -> None:
...