Skip to content

Show maximum G on the running track-session screen #69

Description

@PurpleSentinel

Parent: #48

Summary

Show the maximum acceleration recorded during the current track session on the running-session screen, so the driver can see the session peak without leaving Timer Mode.

User experience

  • Add a centred MAX <value>g readout above the countdown timer while a track session is running.
  • Render it at native font size 2 in the upper safe area, with a clear visual gap above the countdown.
  • Use the same dynamically selected high-contrast text colour as the countdown and elapsed timer.
  • Reset the maximum at the start of every track session and retain the peak while the session is overrunning.
  • Do not show the readout during rest sessions.
  • If acceleration data is unavailable, show MAX -- and keep the timer and stop gesture fully operational.

Functional behavior

  • Reuse G Mode's baseline-corrected, filtered planar acceleration magnitude so the displayed value has the same meaning in both modes.
  • Calibrate the stationary baseline before launch detection/the session timer starts.
  • Sample the shared IMU at a bounded interval without coupling input polling to display refreshes.
  • Keep only the current session peak in memory; raw traces, persistence, summaries, and export remain in the scope of Capture IMU performance metrics and peak acceleration #48.
  • Treat an IMU initialization, calibration, or read failure as a degraded display state rather than aborting a session that does not require launch detection.

Hardware, safety, and compatibility

  • Reuse the existing QMI8658 instance; do not initialize competing drivers for the same device.
  • Preserve launch detection, Auto rotation, Timer Mode stop handling, and the existing round-screen safe area.
  • Avoid unbounded allocations in the live loop and preserve the current bounded input-polling cadence.

Acceptance criteria

  • A running track session shows a centred maximum-G readout above the countdown.
  • The readout uses font size 2 and is positioned higher, leaving a clear visual gap above the countdown.
  • The peak starts from the calibrated session baseline, only increases during a session, and resets for the next track session.
  • The peak remains visible during overrun and uses readable contrast throughout the green-to-red gradient and purple overrun background.
  • Rest sessions do not show maximum G.
  • Missing or failed IMU data shows MAX -- without blocking timing or the stop gesture when launch detection is disabled.
  • Sampling remains bounded and does not make touch handling visibly less responsive.
  • Host tests cover peak calculation, reset/degraded behavior, layout arguments, and track/rest frame behavior.
  • The firmware build completes successfully.

Documentation

Update the README running-session description and screen layout to explain the new maximum-G readout and unavailable-data placeholder.

Relationship

This is a focused sub-issue of #48. That parent retains the broader work for stored metrics, session summaries, memory measurement, and exports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NewFeatureCandidate product capability for future development

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions