Skip to content

esp32: LNK-028 shared clock_ticker engine (LNK-027 adapts it) - #47

Merged
Skeyelab merged 3 commits into
masterfrom
feat/lnk-028-clock-ticker
Jul 4, 2026
Merged

Skeyelab merged 3 commits into
masterfrom
feat/lnk-028-clock-ticker

Conversation

@Skeyelab

@Skeyelab Skeyelab commented Jul 4, 2026

Copy link
Copy Markdown
Member

First slice of LNK-028 — the decision-independent, host-tested core. The hardware output (GPIO/RMT, level-shift, jacks, config UI, scope verification) stays gated on the board decision (open Q6).

  • clock_ticker.{h,c} (pure): configurable-PPQN phase-locked tick scheduler + a BarReset tracker for the analog reset pulse. 11 host tests.
  • midi_clock_out refactored to a thin 24-PPQN adapter over it — one tick engine, not two (per the ticket). Behavior-preserving; LNK-027's 8 tests unchanged and green.
  • Full host suite green (18 suites); firmware 86% flash; AGENTS.md updated.

Satisfies LNK-028 AC #1. build_opt.h excluded.

https://claude.ai/code/session_01WSeSToFVSvAFBDvHewrMHo

… adapts it

Extract the configurable-PPQN tick scheduler both the USB-MIDI clock (LNK-027,
24 PPQN) and the future analog Eurorack sync (LNK-028, selectable PPQN) want, so
there's one tick engine, not two:

- clock_ticker.{h,c} (pure, host-tested): clock_ticker_ticks_due(state, beats,
  ppqn, max_burst) — phase-locked pulses at N PPQN, re-primes on a big jump
  (re-origin/stall) instead of flooding — plus a BarReset tracker that fires once
  per bar boundary for the analog reset pulse. 11 host tests.
- midi_clock_out.{h,c} becomes a thin 24-PPQN adapter over clock_ticker;
  behavior-preserving, its 8 existing tests unchanged and green.

Satisfies LNK-028 AC #1 (shared scheduler). The hardware-coupled parts (GPIO/RMT
emission, level-shift + jacks, config UI, on-scope verification) stay gated on the
board decision. Firmware compiles 86% flash; AGENTS.md updated.

Claude-Session: https://claude.ai/code/session_01WSeSToFVSvAFBDvHewrMHo
…DIN deferred)

Triage input from the owner: Moog DFAM (step-advance clock, no reset, pulse
accuracy critical) and Arturia BeatStep Pro (configurable clock-in hub, 1/2/24
PPQN, redistributes to the rest → one clock jack may suffice). Vintage Roland /
DIN-sync is an attractive reach feature but owner owns none → deferred follow-on
(BSP takes 24 PPQN on 3.5 mm anyway). Priorities: MVP = one accurate
configurable-PPQN 3.5 mm pulse @ ~5 V; reset secondary; DIN deferred. Points Q6
toward 1-2 jacks, Q5 toward deferral.

Claude-Session: https://claude.ai/code/session_01WSeSToFVSvAFBDvHewrMHo
@Skeyelab
Skeyelab merged commit 8fb1dbf into master Jul 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants