amyboard: add Display.hline/vline and document the display drawing API#1062
Conversation
The sketch generator AI naturally reaches for display.hline(), which the Display class did not expose, raising AttributeError at runtime. Add hline and vline as thin forwards to the underlying framebuf (which supports them natively), matching the existing line/rect primitives. Also enumerate the full set of Display drawing methods in the generator system prompt so the model only uses methods that exist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🔌 AMYboard PR previewEditor + flasher: https://amyboard-pr-1062.vercel.app/editor/ This preview bundles this PR's firmware — its flasher only flashes this build (not the release). Rebuilt on every push; removed when the PR closes. The hardware CI has been kicked off and should return within a few minutes, stand by! |
🌷 Tulip Web PR previewTulip Web: https://tulip-pr-1062.vercel.app/run/ Flash a Tulip to this build: on-device run Rebuilt on every push; removed when the PR closes. |
🎛️ HW CI (physical bench)AMYboard (USB-MIDI + AMY Tulip (TULIP4_R11; serial-REPL audio + WiFi screenshot): ✅ PASS — flashed this PR’s firmware; all checks matched the references. ⬇️ Artifacts: recordings · screenshot · serial logs · run logs Self-hosted bench. Audio spectral-compared to |
What
hline(x, y, w, col)andvline(x, y, h, col)to theDisplayclass inamyboard.py, as thin forwards to the underlyingframebuf(which supports them natively) — matching the existingline/rect/fill_rectprimitives.Displaydrawing methods in the sketch-generator system prompt (amyboardworld_db_api.py) so the model only uses methods that actually exist.Why
The sketch generator AI naturally reaches for
display.hline(...), which theDisplayclass did not expose, producing a runtime crash:hline/vlineare trivial framebuf forwards, so implementing them is more robust than telling the model to avoid them. The expanded prompt guidance lists the exact drawing API surface (fill,fill_rect,rect,line,hline,vline,pixel,text,scroll) and notes there is nocircle/ellipse/print, so the model stops inventing methods.Rollout notes
amyboard.pychange ships in firmware — it takes effect once an AMYboard is reflashed/upgraded.main) and immediately stops the generator from emitting unsupported calls, covering older firmware too.🤖 Generated with Claude Code