Add plan: simplified board_config with broker-constructor wiring#58
Merged
Merged
Conversation
Co-authored-by: Brad Barnett <bdbarnett@users.noreply.github.com>
Co-authored-by: Brad Barnett <bdbarnett@users.noreply.github.com>
Co-authored-by: Brad Barnett <bdbarnett@users.noreply.github.com>
…flag Co-authored-by: Brad Barnett <bdbarnett@users.noreply.github.com>
Contributor
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
Summary
Adds
docs/handoff/board-config-simplification-plan.md, a planning/discussion document (no code changes) for simplifyingboard_config.pywhile keeping the refresh timer owned byeventsys.Broker.The doc covers:
ef14624e: display-owned timer viaDisplayDriver(auto_refresh=...)), current (main: broker-owned timer, hand-wired per config), and proposed (Broker(display_drv=..., touch_read=..., pump_read=...)does the wiring internally).board_configs/busdisplay/i80/wt32sc01-plusin all three layouts, plus the runtime-verified 1-tupletouch_readbug indiy_esp32_ili9341_xpt2046as motivation for validated named parameters.needs_refresh; the period is owned by eventsys as a singleDEFAULT_REFRESH_MS = 33, overridable per board viaBroker(refresh_period=...).claim_display_refresh()/release()(plus a context-manager form) replaces the barebroker.display_refreshattribute convention; the broker retaining the refresh spec is what makes release trivial.register_quit_cleanupdisappears from configs, with a singlebefore_quithook kept for LVGL shutdown.poll_quit_discarding_others(written for output-only demos, now spread to ~26 files with drifted semantics: subscribers still receive events through it, andtower_climbdouble-polls around it) is deleted in favor of a stickybroker.quit_requestedproperty set by_handle_quit(); checking a flag consumes nothing, eliminating the misuse class.TIMER_ASYNCretirement — replaced by abroker.timer_asyncread-only property.QUEUE→PUMP(event pump),data=/data2=→ real kwargs,create(type=...)→ per-typeadd_*methods,BrokervsHub, board_config export set, and Broker no longer subclassing Device.autopoll()(events pushed to subscribers without an app loop); useful for REPL liveliness and event-driven apps, with signal-handler/ISR re-entrancy hazards analyzed; recommended as follow-up starting with the AsyncTimer path.Testing
touch_read_funcbug claim (TypeError: 'tuple' object is not callable) and that a callable read works..venv/bin/python -m unittest discover -s tests— 14 errors, identical onmain(pre-existing: staleauto_refreshkwargs in tests,_frame_recorderattribute), unrelated to this docs-only change. The plan now includes fixing these in the eventsys/displaysys test pass.