1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

core/debug: avoid running a handler when waiting for layout change

otherwise a running handler would prevent the default task from
starting, which would deadlock a test waiting for the default task
This commit is contained in:
matejcik 2019-10-16 17:38:00 +02:00
parent 49931007e7
commit 97525654bb

View File

@ -61,9 +61,13 @@ if __debug__:
loop.schedule(debuglink_decision_dispatcher())
async def return_layout_change(ctx: wire.Context):
content = await layout_change_chan.take()
await ctx.write(DebugLinkLayout(lines=content))
async def dispatch_DebugLinkDecision(
ctx: wire.Context, msg: DebugLinkDecision
) -> Optional[DebugLinkLayout]:
) -> None:
if debuglink_decision_chan.putters:
log.warning(__name__, "DebugLinkDecision queue is not empty")
@ -76,8 +80,7 @@ if __debug__:
debuglink_decision_chan.publish(msg)
if msg.wait:
content = await layout_change_chan.take()
return DebugLinkLayout(lines=content)
loop.schedule(return_layout_change(ctx))
async def dispatch_DebugLinkGetState(
ctx: wire.Context, msg: DebugLinkGetState