Repository navigation
run_cast_example: end a board run from the top level - #199
Merged
Merged
Conversation
On a board the runner ended a timed run by calling machine.soft_reset() from inside the display's show(). show() runs from a callback there (the app's refresh timer, or an LVGL flush), and anything raised in a callback is printed and dropped. Now that display_driver's flush always ends (#158), the SystemExit no longer freezes the board but no longer ends the run either: the example kept running after its CAST line. The runner now holds the main thread once the example's script body returns, reports when SECONDS are up, and soft-resets from its own top level. An example that loops in its own body is unwound by an exception raised from show() back to the runner, which then soft-resets the same way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a board,
tools/run_cast_example.pyended a timed run by callingmachine.soft_reset()from inside the display'sshow(). Thereshow()runs from a callback (the app's refresh timer, or an LVGL flush), and an exception raised in a callback is printed and dropped. Since #158 the flush always ends, so the board no longer freezes, but theSystemExitno longer ends the run either: after the CAST line the example just keeps going.Now the runner holds the main thread once the example's script body returns, reports when
SECONDSare up, and soft-resets from its own top level, outside any callback. An example that loops in its own body is unwound by an exception raised fromshow()back to the runner, which soft-resets the same way. Desktop runs are unchanged.Run on an ESP32-P4 through the Roku Companion channel (
roku), 30 s, with display_driver from pydevices main:lv_test_timer(LVGL)MPY: soft reboot0.4 s later, app goneSystemExitprinted from_flush_cb_direct, app still reporting at 116 stestris(appdev)SystemExitprinted from multimer's timer, app still loaded"App gone" was checked on both consoles (UART and USB CDC) without resetting the board:
board_configwas no longer insys.modules, and the REPL answered.