Skip to content

Gh4 cleanup#155

Merged
mbreiser merged 2 commits into
reiserlab:mainfrom
floesche:gh4-cleanup
Jul 8, 2026
Merged

Gh4 cleanup#155
mbreiser merged 2 commits into
reiserlab:mainfrom
floesche:gh4-cleanup

Conversation

@floesche

@floesche floesche commented Jul 8, 2026

Copy link
Copy Markdown
Member

This accompanies reiserlab/LED-Display_G6_Firmware_Arena#39

This does not expose duty cycle in the Arena Studio yet.

floesche added 2 commits July 7, 2026 23:12
…ration (arena-fw reiserlab#4)

Match the firmware's canonical trial-params re-layout: gain moves after
init_pos and widens to int16, and a new duration field (seconds at the JS
API boundary, encoded as 10ms ticks) lets the controller auto-stop a trial
on its own.

- encodeTrialParams: reordered params, gain now i16le, duration converts
  seconds -> ticks; dropped the now-dead int8Byte helper
- buildTrialParams: carries duration through from the trialParams command
  (same seconds convention as conditionDuration's wait/trialParams math)
- hostSideTrialEnd/SWAP POINT comment untouched — host-side timing stays
  authoritative for now; wire-side duration just unblocks the future swap
- tests: rewrote trial-params golden vectors + runner fixtures for the new
  offsets and widened gain range
@floesche floesche requested a review from mbreiser July 8, 2026 04:05
mbreiser added a commit that referenced this pull request Jul 8, 2026
…L_PARAMS wire (v0.40)

Rides the fw #4 re-layout merged from PR #155 (gain int16 after init_pos,
controller-run duration in 10 ms ticks, optional duty 12th param byte, fw #33).

Console Arena Trial panel:
- duration (s) now rides the wire — the CONTROLLER times the stop; the host
  arms a backup STOP 2 s later and the log says which one fired
- new optional duty field (0-255, blank = pattern's stored duty -> byte
  omitted); encoder rejections surface in the bench log instead of an
  unhandled rejection
- gain input widened to the int16 bounds (+/-32767)
- TRIAL_PARAMS log line records full provenance: mode/pat/rate/init/gain/dur/duty
- help-mode entry + tooltips for the new fields

Requires the fw #4/#39 firmware build — older firmware MISREADS the re-laid-out
params (not just the duty byte), so flash before pointing v0.40 at an arena.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mbreiser mbreiser merged commit c8048f3 into reiserlab:main Jul 8, 2026
2 checks passed
mbreiser added a commit that referenced this pull request Jul 8, 2026
… (compat)

Bench prep for the fw #39 rollout: with the runner sending real durations,
the controller blanks the display at exactly `duration` seconds, where
protocols authored against host timing expect the pattern to keep playing
until the next command (often through the ITI) — observed as "timing off"
vs. previous runs. buildTrialParams now pins the WIRE duration to 0 (no
controller auto-stop); host-side timing (hostSideTrialEnd) remains the
authoritative trial clock, and durationSec / conditionDuration / the scope's
trial shading still read cmd.duration directly, so every existing protocol
runs identically to pre-#155 behavior with NO YAML changes.

The Console bench form still sends a real duration on purpose — that's
where fw #4 controller timing gets exercised. Re-enable in the runner
together with the await-run-complete timing swap (both flip points are
cross-referenced in the code).

Tests: wire-duration-pinned check + goldens back to 00 00 duration bytes;
durationSec-carried assertion unchanged proves host timing intact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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