Skip to content

Commit 0b4bf07

Browse files
committed
docs: document battery tracking
1 parent 7e0788b commit 0b4bf07

4 files changed

Lines changed: 93 additions & 8 deletions

File tree

README.md

Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
# YACP
1+
<p align="center">
2+
<img src="docs/images/yacp/logo.png" alt="YACP continuous reading path logo" width="144">
3+
</p>
24

3-
Yet Another CrossPoint.
5+
<h1 align="center">YACP</h1>
46

5-
YACP is a personal, opinionated firmware for Xteink X3 and X4 readers. It is built for my own use. Its main priorities are battery life and rendering efficiency. Reading statistics are the deliberate exception to an otherwise narrow feature policy.
7+
<p align="center"><em>Yet Another CrossPoint.</em></p>
8+
9+
YACP is a personal, opinionated firmware for Xteink X3 and X4 readers. It is built for my own use. Its main priorities are battery life and rendering efficiency. Reading statistics and a small autonomy view are the deliberate exceptions to an otherwise narrow feature policy.
10+
11+
The expected result is longer time between charges and more consistent performance in the normal reading path. The mechanisms are concrete: lower idle CPU frequency, fewer display synchronization passes, fewer SD-card scans and writes, deferred optional work, smaller caches, and reused allocations. YACP does not yet publish an end-to-end battery-life percentage because comparable hardware measurements are still needed.
12+
13+
This direction has required substantial work across power handling, rendering, storage, memory use, and simulator validation. The hardware and the goal remain deliberately simple: this is firmware for reading books. Major breakthroughs should not be expected every week, and releases do not follow a fixed cadence. A change is released when it provides a relevant, explainable improvement.
14+
15+
In parallel, long-running hardware current analysis remains active. Its purpose is to compare parameters and mechanisms under repeatable use, then keep only changes that measurably reduce battery use without weakening reliability. This is an iterative process, so further power-related changes are expected as the measurements mature.
616

717
This is not a community project. Issues, pull requests, feature requests, support requests, and project contact are not accepted at this time. The source is public so the work can be inspected or forked.
818

@@ -14,7 +24,7 @@ YACP currently starts from [CrossInk 1.4.0](https://github.com/uxjulia/CrossInk)
1424

1525
CrossPoint provides the core open source reader firmware and hardware support. CrossInk adds a broad reader feature set, typography work, statistics, synchronization, and many EPUB reliability fixes. YACP keeps that compatible architecture and narrows its direction around a smaller set of priorities.
1626

17-
YACP does not follow either upstream automatically. Changes from CrossPoint or CrossInk are considered when they reduce energy use, reduce work, or make an operation complete faster. General feature growth is not a reason by itself.
27+
YACP does not follow either upstream automatically. CrossPoint, CrossInk, and other Xteink firmware projects are reviewed regularly. A change is considered when it reduces energy use, reduces work, improves rendering or reliability, or makes an operation complete faster. General feature growth is not a reason by itself.
1828

1929
The existing `.crosspoint` SD-card layout and cache formats are intentionally retained where possible.
2030

@@ -30,6 +40,26 @@ In order:
3040

3141
There is no target feature count and no goal of serving every reading workflow.
3242

43+
## Opinionated default path
44+
45+
YACP assumes one current book is normally read in sequence until completion. A clean profile therefore uses the
46+
YACP theme: a rounded, typographic Home centered on that one book, its progress, reading time, and estimated time
47+
left. It deliberately omits the cover, thumbnail generation, and a Home cover cache. Confirm resumes directly;
48+
the other mapped buttons open Menu or move to the previous/next book in most-recent-first opening order without a
49+
Home-screen cursor. A direction with no book is left blank and does nothing. Recent Books and Reading Stats remain
50+
available from Menu. OPDS and saved-item probes happen only when the menu is requested; global statistics load only
51+
for that menu or the Reading Stats screen.
52+
Automatic sleep uses Quick Resume by default, while a deliberate manual sleep keeps its independently selected sleep
53+
screen.
54+
55+
Text antialiasing is disabled by default to avoid the grayscale text pass; image rendering remains enabled. Lexend
56+
Deca and Bitter are the normal reader fonts. SD-card fonts remain available as a comfort option, but their directories
57+
and catalogue are loaded only after an SD family is selected or font management is explicitly opened.
58+
59+
The next EPUB chapter is prepared near the end of the current chapter because sequential continuation is the expected
60+
path. Settings are assumed to be stable and rarely changed; YACP does not add write batching solely to optimize
61+
settings experimentation.
62+
3363
## Current YACP work
3464

3565
### Idle power and writes
@@ -39,19 +69,54 @@ There is no target feature count and no goal of serving every reading workflow.
3969
- X3 USB state checks are rate limited while idle instead of being repeated on every loop.
4070
- EPUB, TXT, and XTC progress writes are debounced. A position is persisted after 10 changes or 5 minutes, with the latest pending position flushed on normal reader exit.
4171

42-
These mechanisms are implemented, but YACP does not currently publish a battery-life percentage claim. Hardware current and runtime measurements remain part of the validation work.
72+
The lower quiet frequency and reduced polling work should lower awake idle consumption. Debounced progress writes reduce SD-card activity and repeated serialization. These mechanisms are implemented, but hardware current and runtime measurements remain part of the validation work.
73+
74+
### Autonomy history
75+
76+
- The Autonomy screen shows battery level against active use, active reading time since the current charge cycle, and elapsed days when a valid clock is available.
77+
- Awake time is accumulated only while external power is disconnected.
78+
- One coarse battery point is recorded for each 5 percentage-point drop, with a maximum of 21 points in a fixed state of at most 96 bytes.
79+
- Sampling happens during the existing transition to sleep and reuses a cached battery value when one is available. The state is written with the existing application-state save.
80+
- The feature adds no timer and no periodic wake-up. Reading the clock for elapsed days happens only when the Autonomy screen is opened.
81+
82+
This view is an observability feature, not a claimed power saving. Its implementation is deliberately small so measuring autonomy does not materially interfere with it. The simulator provides a deterministic 10-day demonstration:
83+
84+
![Battery tracking rendered by the X3 simulator with generated demo data](docs/images/yacp/autonomy.png)
85+
86+
The graph relates battery level to active use rather than calendar time. The capture uses generated demonstration
87+
data, not personal battery history. Recreate the demo with:
88+
89+
```sh
90+
CROSSINK_SIM_POWER_DEMO=1 pio run -e simulator_x3 -t run_simulator
91+
```
4392

4493
### Rendering and resume
4594

4695
- X3 Quick Resume avoids the full-screen black synchronization pass when entering sleep and when restoring a cached reader page.
47-
- EPUB reading starts indexing the next chapter silently while the penultimate page is visible. Normal chapter entry can then use the completed cache.
96+
- EPUB reading starts indexing the next chapter silently near the end of the current chapter. This also covers one-page chapters and direct jumps to the last page. A prepared marker avoids repeating the same SD-card probes, and indexing is skipped when the optional-work memory budget is not available.
4897
- EPUB grayscale rendering allocates one bounded strip buffer per loaded section, reuses it for each page, and releases it before chapter indexing.
49-
- The Home carousel keeps one rendered frame in RAM and pages other snapshots from SD. Cover caching stores the relevant tile instead of another full 48 KB framebuffer.
98+
- The Home carousel keeps one rendered frame in RAM and pages other snapshots from SD.
99+
- The YACP Home does not load or cache a cover. Minimal still caches only its rendered cover region instead of the
100+
full Home tile.
101+
- Each YACP Home load performs one full e-ink refresh to clean ghosting from the gray book surface; later book
102+
selections and returns from secondary screens use fast refreshes. The centered YACP mark is the existing embedded
103+
1-bit asset, so it adds no SD access or runtime allocation.
50104
- Low-memory EPUB fallbacks inherited from CrossInk remain enabled for difficult books, large publisher styles, custom SD-card fonts, and image-heavy sections.
51105

52106
X3 before / after recording of the full-screen Quick Resume flashes removed by this path:
53107
<video src="https://github.com/user-attachments/assets/a3de8027-e6e2-45ea-9f48-99801f550def" controls></video>
54108

109+
### Deferred optional work
110+
111+
- Clean profiles default to YACP, text antialiasing off, and Quick Resume after automatic sleep. Existing valid user choices are preserved.
112+
- Disabling text antialiasing avoids the grayscale text pass. Image rendering remains enabled.
113+
- Built-in Lexend Deca and Bitter fonts do not trigger an SD-card font-directory scan, catalogue allocation, or font-file access.
114+
- SD-card font discovery and loading begin only when an SD family is selected or a font picker, manager, or web selector is explicitly opened. The catalogue is released when it is no longer needed.
115+
- The YACP Home has no cover-generation path. Themes that still generate Home covers use built-in fonts so optional
116+
SD font work is not activated there.
117+
118+
These choices remove filesystem and allocation work from the common built-in-font reading path while retaining SD-card fonts as an explicit comfort option.
119+
55120
### Reading statistics
56121

57122
- Book and all-book totals share a compact summary page.
@@ -125,7 +190,7 @@ This repository is a working firmware project, not a supported distribution chan
125190

126191
## Contribution status
127192

128-
External contributions are closed. GitHub Issues are disabled and external pull requests are closed automatically. There is no support or contact channel for YACP.
193+
External contributions are closed. GitHub Issues and Discussions are disabled, and external pull requests are closed automatically. There is no support or contact channel for YACP.
129194

130195
If the code is useful, fork it and maintain the result for your own device. See [CONTRIBUTING.md](CONTRIBUTING.md) for the short policy.
131196

docs/images/yacp/autonomy.png

4.12 KB
Loading

docs/images/yacp/logo.png

14.8 KB
Loading

docs/simulator.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ fs_/.crosspoint/daily_reading.bin
5656

5757
It refuses to replace those files unless `--force` is present.
5858

59+
## Autonomy demo
60+
61+
The autonomy screen has deterministic in-memory demo data. It does not create or
62+
replace `state.json`:
63+
64+
```sh
65+
CROSSINK_SIM_POWER_DEMO=1 pio run -e simulator_x3 -t run_simulator
66+
```
67+
68+
Open **Autonomy** from the Home menu. The demo shows a 10-day battery cycle,
69+
29 hours and 47 minutes of active use, 35 percent remaining, and the coarse samples that the
70+
production firmware would retain at sleep transitions.
71+
5972
## Run
6073

6174
```sh
@@ -84,6 +97,13 @@ CROSSPOINT_SIM_SCREENSHOTS='5600:./qa-artifacts/reading-rhythm.bmp' \
8497
.pio/build/simulator_x3/program
8598
```
8699

100+
When `CROSSPOINT_SIM_SCREENSHOTS` or
101+
`CROSSPOINT_SIM_SCREENSHOTS_AFTER_WAKE` is set, YACP renders the UI in English
102+
regardless of the language saved in `fs_`. This keeps all automated screenshots
103+
intended for GitHub consistent without changing the saved simulator preference.
104+
All screenshots published on GitHub, including manually triggered captures, must
105+
show the English UI.
106+
87107
The committed Reading Rhythm image was produced from this path and converted to PNG.
88108

89109
## Cache note

0 commit comments

Comments
 (0)