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:
parent
49931007e7
commit
97525654bb
@ -61,9 +61,13 @@ if __debug__:
|
|||||||
|
|
||||||
loop.schedule(debuglink_decision_dispatcher())
|
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(
|
async def dispatch_DebugLinkDecision(
|
||||||
ctx: wire.Context, msg: DebugLinkDecision
|
ctx: wire.Context, msg: DebugLinkDecision
|
||||||
) -> Optional[DebugLinkLayout]:
|
) -> None:
|
||||||
if debuglink_decision_chan.putters:
|
if debuglink_decision_chan.putters:
|
||||||
log.warning(__name__, "DebugLinkDecision queue is not empty")
|
log.warning(__name__, "DebugLinkDecision queue is not empty")
|
||||||
|
|
||||||
@ -76,8 +80,7 @@ if __debug__:
|
|||||||
debuglink_decision_chan.publish(msg)
|
debuglink_decision_chan.publish(msg)
|
||||||
|
|
||||||
if msg.wait:
|
if msg.wait:
|
||||||
content = await layout_change_chan.take()
|
loop.schedule(return_layout_change(ctx))
|
||||||
return DebugLinkLayout(lines=content)
|
|
||||||
|
|
||||||
async def dispatch_DebugLinkGetState(
|
async def dispatch_DebugLinkGetState(
|
||||||
ctx: wire.Context, msg: DebugLinkGetState
|
ctx: wire.Context, msg: DebugLinkGetState
|
||||||
|
Loading…
Reference in New Issue
Block a user