Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Track Session Timer - v4.2.0
# Track Session Timer - v4.3.0
Trackday or race session timer.

# Change log
## Unreleased
## Version 4.3
### v4.3.0 [current]
* Added an interactive post-track review with a high-visibility page for actual duration, overrun, completion reason, total maximum G, and each directional acceleration/braking/left/right peak.
* Added left/right review navigation and prevented cool-down from starting until every result page has been reached and the final page is advanced.
* Kept summary data in bounded RAM only; no session history is written to flash in this increment.
* Retained captured peaks as explicitly partial data if the IMU fails during a session, while normal timing continues.
* Added a live maximum-G value above the running track-session countdown.
* Added a persistent Auto-Dim setting that reduces the Ready screen to 25% brightness after 10 seconds without motion and restores the saved brightness immediately when motion resumes or Ready is left.
* Kept Auto-Dim disabled by default and preserved normal brightness if motion sensing is disabled or unavailable.
* Moved the Ready-screen dim level into `params.json` as the validated `AUTO_DIM_PERCENT` system setting, defaulting to 25%.
* Expanded hardware-independent regression coverage to 185 tests.
* Added a hardware Bill of Materials identifying the cased Waveshare RP2040-Touch-LCD-1.28-B reference variant.
* Expanded hardware-independent regression coverage to 186 tests.

## Version 4.2
### v4.2.0
Expand Down Expand Up @@ -207,7 +210,7 @@ When upgrading an existing device, omit that command so all of its saved user se

### 4. Verify first boot

The display should show the Caterham v4.2.0 splash, the hardware-information splash, and then the green **Ready** screen. The serial console should report the loaded user parameters, `Success:Detected CST816T.`, and the touchscreen revision without a traceback.
The display should show the Caterham v4.3.0 splash, the hardware-information splash with **Firmware v4.3.0**, and then the green **Ready** screen. The serial console should report the loaded user parameters, `Success:Detected CST816T.`, and the touchscreen revision without a traceback.

If first boot fails:

Expand All @@ -226,7 +229,7 @@ The QMI8658 IMU is optional unless a non-zero Launch Mode sensitivity, G Mode, A

## Configuration files

Version 4.2.0 uses two separate configuration scopes:
Version 4.3.0 uses two separate configuration scopes:

* `params.json` contains system-owned choices and display behavior: `DURATION_VALUES`, `LAUNCH_SENSE_VALUES`, `VERSION`, `DISPLAY_DELAY_REST`, `DISPLAY_DELAY_REST_COLOUR`, `STARTUP_SPLASH_DURATION_SEC`, `HARDWARE_SPLASH_DURATION_SEC`, `MODE_MENU_HOLD_SEC`, and `AUTO_DIM_PERCENT` (an integer from 1 to 100, default 25).
* `user.json` contains the current user selections: `RACE_LENGTH` (track-session minutes), `REST_LENGTH` (pit-rest minutes), `SENSITIVITY` (launch threshold; `0` disables Launch Mode), `OPERATING_MODE` (`timer` or `g`), `BRIGHTNESS_PERCENT`, `DISPLAY_ROTATION_DEG` (`auto` or the fixed clockwise device mounting angle `0`, `90`, `180`, or `270`), and `AUTO_DIM_ENABLED` (`true` or `false`).
Expand Down
2 changes: 1 addition & 1 deletion User Guide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# User Guide - v4.2.0
# User Guide - v4.3.0

## General / Sessions Use
The following describes general operation of both the ``Track Session`` and ``Rest in Pits Session`` timer.
Expand Down
2 changes: 1 addition & 1 deletion params.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"DURATION_VALUES": [1, 5, 10, 15, 20, 25, 30, 40, 50, 60],
"DISPLAY_DELAY_REST": 5,
"LAUNCH_SENSE_VALUES": [0, 0.5, 1, 1.25, 1.5, 1.75, 2, 2.5, 3.5, 4],
"VERSION": "4.2.0",
"VERSION": "4.3.0",
"DISPLAY_DELAY_REST_COLOUR": "blue",
"STARTUP_SPLASH_DURATION_SEC": 2,
"HARDWARE_SPLASH_DURATION_SEC": 2,
Expand Down
2 changes: 1 addition & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"DURATION_VALUES": [1, 5, 10, 15, 20, 25, 30, 40, 50, 60],
"DISPLAY_DELAY_REST": 5,
"LAUNCH_SENSE_VALUES": [0, 0.5, 1, 1.25, 1.5, 1.75, 2, 2.5, 3.5, 4],
"VERSION": "4.2.0",
"VERSION": "4.3.0",
"DISPLAY_DELAY_REST_COLOUR": "blue",
"STARTUP_SPLASH_DURATION_SEC": 2,
"HARDWARE_SPLASH_DURATION_SEC": 2,
Expand Down
58 changes: 58 additions & 0 deletions tests/test_release_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import json
import unittest
from pathlib import Path

from hardware_splash import run_startup_screens
from settings import DEFAULT_SYSTEM_PARAMS


RELEASE_VERSION = "4.3.0"
REPOSITORY_ROOT = Path(__file__).resolve().parents[1]


class FakeTouch:
def __init__(self):
self.boot_version = None
self.hardware_lines = None

def BootScreen(self, _lcd, version_number):
self.boot_version = version_number

def ControlScreen(self, _lcd, text_array, back_colour):
self.hardware_lines = text_array
self.hardware_background = back_colour


class ReleaseVersionTests(unittest.TestCase):
def test_build_defaults_docs_and_both_startup_screens_report_release(self):
with (REPOSITORY_ROOT / "params.json").open(encoding="utf-8") as source:
params = json.load(source)
readme = (REPOSITORY_ROOT / "README.md").read_text(encoding="utf-8")
user_guide = (REPOSITORY_ROOT / "User Guide.md").read_text(
encoding="utf-8"
)

self.assertEqual(RELEASE_VERSION, params["VERSION"])
self.assertEqual(RELEASE_VERSION, DEFAULT_SYSTEM_PARAMS["VERSION"])
self.assertTrue(readme.startswith("# Track Session Timer - v" + RELEASE_VERSION))
self.assertTrue(user_guide.startswith("# User Guide - v" + RELEASE_VERSION))

touch = FakeTouch()
run_startup_screens(
touch,
object(),
firmware_version=params["VERSION"],
startup_duration_sec=0,
hardware_duration_sec=0,
wait=lambda _lcd, _duration: None,
)

self.assertEqual(RELEASE_VERSION, touch.boot_version)
self.assertIn(
"Firmware v" + RELEASE_VERSION,
[line[0] for line in touch.hardware_lines],
)


if __name__ == "__main__":
unittest.main()
Loading