BCM module diagnostics replace timestamp probes: bringup forces EEE off and runs ECD (re-run on every reset, re-baselining past its blip), 1 Hz SNR margin + corrected counters on panel and console; X520 bench divergences bypassed and tracked in open-questions

This commit is contained in:
flamingcow
2026-08-13 07:10:39 -07:00
parent a00f2216b7
commit 979dc7a772
18 changed files with 1240 additions and 416 deletions
+32 -3
View File
@@ -3,8 +3,8 @@ package main
import "testing"
func TestGridCellFullRow(t *testing.T) {
x0, w0 := gridCell(0, 2, 0, 100)
x1, w1 := gridCell(1, 2, 0, 100)
x0, w0 := gridCell(0, 2, gridCols, 0, 100)
x1, w1 := gridCell(1, 2, gridCols, 0, 100)
if w0 != w1 {
t.Errorf("cells differ in width: %d vs %d", w0, w1)
}
@@ -21,8 +21,37 @@ func TestGridCellFullRow(t *testing.T) {
// A last row that does not fill the grid is centred.
func TestGridCellShortLastRow(t *testing.T) {
cx, cw := gridCell(2, 3, 0, 100)
cx, cw := gridCell(2, 3, gridCols, 0, 100)
if left, right := cx, 100-(cx+cw); left != right {
t.Errorf("lone cell has %d left and %d right, want centred", left, right)
}
}
// The panel is a fixed 600x1024, so whether everything fits is decidable here
// rather than on the hardware, with enough spare that the gaps stay readable.
func TestPanelFitsScreen(t *testing.T) {
d := &display{}
for _, spec := range []struct {
dst **textFace
bold bool
size float64
}{
{&d.big, true, 40},
{&d.grid, false, 34},
{&d.gridB, true, 34},
} {
face, err := loadFace(spec.bold, spec.size)
if err != nil {
t.Fatal(err)
}
*spec.dst = face
}
if err := d.layout(600, 1024); err != nil {
t.Fatal(err)
}
gap := d.nowYs[0] - (d.nowPanel.y + uiBorder)
t.Logf("panel gap %dpx, since panel ends at %dpx", gap, d.sincePanel.y+d.sincePanel.h)
if gap < spaceTight {
t.Errorf("panel gap is %dpx, want at least %d", gap, spaceTight)
}
}