1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-02 20:48:30 +00:00
Commit Graph

55 Commits

Author SHA1 Message Date
Jan Pochyla
3483c149a5 loop: fix unschedule 2017-10-10 11:49:14 +02:00
Jan Pochyla
c254758c83 Revert "trezor/loop: optimization"
This reverts commit cfa1705a88.

In MicroPython, list.clear() does not memset the backing buffer, preventing the
paused tasks from being garbage collected.
2017-10-02 16:18:27 +02:00
Jan Pochyla
cfa1705a88 trezor/loop: optimization
Re-cycle queue of paused tasks by clear()ing it rather than pop()ing it out of the dict.
2017-10-02 11:59:30 +02:00
Jan Pochyla
49cc4651c2 bunch of api cleanups 2017-09-19 23:47:35 +02:00
Jan Pochyla
a8e51ceda3 loop: whitespace 2017-09-06 15:43:57 +02:00
Jan Pochyla
a235a6b38b all: docs, logging 2017-08-21 13:22:35 +02:00
Jan Pochyla
3db1bf89fa remove trezor.main, simplify trezor.workflow 2017-08-16 15:02:03 +02:00
Jan Pochyla
d2781d030d msg: rename to io 2017-08-15 18:14:14 +02:00
Jan Pochyla
1f90e781d5 wire: simplify, use async codecs 2017-08-15 18:14:14 +02:00
Jan Pochyla
915cf849e9 trezor.msg: remove select, add poll
TODO: decide if we want to continue polling on interface numbers, or rather on usb/touch file objects
2017-06-26 16:03:20 +02:00
Jan Pochyla
98e82e3cd5 code style 2017-06-12 18:16:06 +02:00
Jan Pochyla
d9170740a5 trezor.loop: export syscalls also in lowercase
TODO: use only lowercase
2017-05-23 12:42:22 +02:00
Jan Pochyla
fb398d07cb touch: change iface num to 255 2017-05-09 16:13:40 +02:00
Pavol Rusnak
f13c122561
rebase micropython, min_time -> peektime 2017-03-31 11:30:31 +02:00
Jan Pochyla
bf878ff15e trezor.loop: support re-using Sleep and Wait objects 2017-02-20 11:36:28 +01:00
Jan Pochyla
5173a87f3e trezor.loop: rewrite for utimeq, document
- faster, consumes less memory
- untangle loop and ui.refresh

TODO: msg.select could fill a pre-allocated list/bytearray just like utimeq.pop does
TOOD: we could move to a readyness-based async model and let the consumers readinto() the messages right into the target buffers, to avoid allocating tuples inside msg.select()
2017-01-02 15:45:56 +01:00
Jan Pochyla
a4f103755b minor api changes 2016-12-08 16:19:09 +01:00
Jan Pochyla
0b7874ad43 loop: rename Future to Signal
Future semantics were changed to allow multiple deliveries to avoid allocating more future objects than neccessary, and Signal describes this behaviour more accurately.
2016-12-08 16:19:09 +01:00
Jan Pochyla
5d7c2ac4e2 loop: make it possible to re-use Future instances 2016-11-15 13:47:36 +01:00
Jan Pochyla
5889d0c932 loop: use ticks_add, ticks_diff 2016-11-15 11:59:27 +01:00
Pavol Rusnak
3f44dfedb5
modtrezormsg: use usage_page to identify interfaces 2016-10-11 12:14:17 +02:00
Jan Pochyla
c3ee7dd709 loop: refresh display after every step 2016-10-06 15:05:14 +02:00
Pavol Rusnak
2e2534585b
call ui.display.refresh in loop.py 2016-10-04 16:33:38 +02:00
Jan Pochyla
407169af01 import qualified const() 2016-09-29 12:29:43 +02:00
Jan Pochyla
70110187cc
overload __iter__ in loop.Wait
This will automatically exit child tasks in case of close() or throw() on the waiting task, but only if run through `await` or `yield from`
2016-09-27 17:26:11 +02:00
Jan Pochyla
c8c34c875b
simplify loop.py, add loop.Future, supoort await 2016-09-27 17:26:02 +02:00
Jan Pochyla
ae4540c59b
introduce generic swipe container to reset_device
Now its possible to block multiple generators on one interface.
2016-09-27 17:26:00 +02:00
Jan Pochyla
71b89c748a
adapt rest of code to touch changes, example works 2016-09-27 17:25:45 +02:00
Jan Pochyla
421f17bfee
rework events around interfaces, split msg.py to wire.py
Touch events are sent on special interface now.
2016-09-27 17:25:44 +02:00
Jan Pochyla
3677b8142b
add touch event rotation, msg dispatcher, wallet app 2016-09-27 17:25:44 +02:00
Jan Pochyla
3a5d29848b
Wait supports syscall instead of gens now 2016-09-27 17:24:18 +02:00
Jan Pochyla
412ac2daa7
support multiple event handlers 2016-09-27 17:24:17 +02:00
Jan Pochyla
97ac6c52f0
syscalls are objects now, make schedule public 2016-09-27 17:24:16 +02:00
Jan Pochyla
ef44e9ded8
add counter to time_queue, kill gens with close() 2016-09-27 17:24:16 +02:00
Jan Pochyla
e382737fda
use friendlier event enums 2016-09-27 17:24:09 +02:00
Jan Pochyla
af482d3da1
experiment with touch event multiplexing
Now we can have 2 buttons!
2016-09-27 17:24:09 +02:00
Jan Pochyla
e8122cc975
__call_at -> __schedule 2016-09-27 17:24:09 +02:00
Jan Pochyla
d612037eda
proof of concept for waiting for events 2016-09-27 17:24:08 +02:00
Jan Pochyla
20dad5a300
style, fix possible exception in run_forever 2016-09-27 17:24:06 +02:00
Jan Pochyla
36dad0137b
fix _Wait 2016-09-27 17:24:06 +02:00
slush0
06515321cf
Reworked wait into class 2016-09-27 17:24:06 +02:00
Jan Pochyla
c97db79d14
WIP wait fix 2016-09-27 17:24:05 +02:00
slush0
2d75289bf3
__wait_for_event integrated into main loop 2016-09-27 17:24:04 +02:00
slush0
3a7e343a43
Implemented log.exception, improved logging
Removed unused code
2016-09-27 17:24:04 +02:00
slush0
b0d9a4b884
Implemented basic loop.wait() 2016-09-27 17:24:03 +02:00
Pavol Rusnak
6a5f16207c
move log to trezor 2016-09-27 17:24:03 +02:00
Jan Pochyla
29e20e302a
fix log 2016-09-27 17:24:03 +02:00
Jan Pochyla
ac28a41d96
hide loop.call_at, use yield or run_forever 2016-09-27 17:24:03 +02:00
Jan Pochyla
e7bfb64502
rework the event loop 2016-09-27 17:24:02 +02:00
Pavol Rusnak
71496913ba
rework logging 2016-09-27 17:24:02 +02:00