You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/ai-coding-guide.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,10 @@
48
48
-**If the change touches ANY firmware file**: You **MUST READ**`.github/code-summary.md` before writing code. Also check `.github/code-issues.md` for known issues in the affected area.
49
49
-**If the change touches ONLY non-firmware files** (workflows, docs, build scripts, config generators, Home Assistant, images, etc.): `code-summary.md` review is **NOT** required. Still check `code-issues.md` if relevant.
50
50
-**One-line/trivial fixes** (typos, formatting) are exempt regardless of file type.
51
+
-**What `.github/code-issues.md` is for**: it tracks **open** issues that still need investigation, or that are blocked — for example, waiting on hardware the maintainer does not own. It is **not** a changelog.
52
+
- Do **not** add entries for problems found and fixed in the same change set.
53
+
- Do **not** add general rules or subsystem documentation there; that belongs in `code-summary.md` (Rule #4).
54
+
- Do read it before editing an affected area, and **update or close an existing entry** if your change fixes it or alters the code that entry describes.
51
55
52
56
**Enforcement and AI Behavior**
53
57
- Always validate proposed changes against these rules **before every action**.
Copy file name to clipboardExpand all lines: .github/code-summary.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -754,6 +754,35 @@ Important rendering invariants:
754
754
- Never call `startWrite()`/`endWrite()` in `write()` or `writePixel`/`writeFillRect` overrides — SPI nesting causes hangs on Adafruit TFT drivers.
755
755
- The `gfxFont == NULL` case (YO_MONO / display font) runs through `_writeGlyph` using DisplayFont, NOT the built-in glcdfont. This means glyph metrics (yAdvance, yOffset, xAdvance) come from DisplayFont.
756
756
757
+
## Display Widget Memory Ownership
758
+
759
+
The widget classes mix two allocation conventions; release must match allocation:
760
+
761
+
| Member | Owner | Allocated with | Released with |
762
+
|---|---|---|---|
763
+
|`_text`, `_oldtext`|`TextWidget` (and `NumWidget`, which duplicates it) |`malloc`|`free`|
- Never `free()` a `new`-allocated object: `free()` skips the destructor and leaks the internal buffer.
770
+
-`init()` is re-called on every layout/theme change, so it must release its previous buffers first.
771
+
- Resize an existing `psFrameBuffer` with `freeBuffer()` then `begin()`, never by allocating a second one.
772
+
773
+
### Optional widget guard fields
774
+
775
+
Each config type has its own field that makes a widget meaningful, and that is what the creation guard in `display.cpp` must test — never a coordinate, since `{0,0}` is a legitimate position:
`_fullbitrate` and `_bitrate` are alternatives: an empty `.fullbitrateConf` falls back to `.bitrateConf`, and `_reinitWidgets` must tear down whichever one is no longer wanted even when the replacement config is itself empty.
@@ -775,6 +804,13 @@ Important rendering invariants:
775
804
776
805
---
777
806
807
+
## Screen Rendering Fixes (Session: VU Rotated Layout)
808
+
809
+
-**New layout flag**`LayoutData::rotateVU` (exposed via `rotateVU_ptr`), treated exactly like `boomboxStyle` — absent means false. `VuWidget::_rotate` is read from `rotateVU_ptr` in `init()`.
810
+
-**Layout ordering** in `displayTFT480x320conf.h`: `_layoutNames` is now `Default`, `Default (VU Rotated)`, `VaraiTamas (BoomBox)`. The rotated layout is layout #2 (`bandsConf = { 32, 130, 4, 2, 10, 3 }`, `.rotateVU = true`); BoomBox moved to #3.
811
+
-**Blit choice**: `VuWidget::_draw()` uses the manual `startWrite()` / `setAddrWindow()` / `writePixels()` / `endWrite()` sequence for all three modes. `drawRGBBitmap()` was deliberately removed from the widget layer — the manual path depends only on `setAddrWindow` and `writePixels`, which every TFT driver is guaranteed to implement, and it issues a single bulk transfer rather than one `writePixels` call per scanline. Do not switch this back.
812
+
-**Direction**: the rotated VU fills left-to-right with `_vumaxcolor` at the right end.
813
+
778
814
## CPU Core Assignments & Stack Sizes
779
815
780
816
The ESP32 has two hardware cores: **Core 0** (PRO_CPU) and **Core 1** (APP_CPU). The ESP32 Arduino framework runs `setup()` and `loop()` on Core 1. Audio decoding is isolated on Core 0; all other application tasks run on Core 1.
0 commit comments