Skip to content

Releases: Hector68/crosspoint-reader

Add code block

Choose a tag to compare

@Hector68 Hector68 released this 17 Oct 18:57
3ee1c31
Merge pull request #2 from Hector68/hector/anki-1.6.5

Hector/anki 1.6.5

1.6.5.1 Anki feature

Choose a tag to compare

@Hector68 Hector68 released this 14 Oct 06:30
3ee1c31

1.6.5 Hector Edition

Upstream tag 1.6.5 plus Anki flashcards (spaced repetition for vocabulary).

What is added

  • Card screen: Home → Anki cards (the slot the OPDS browser normally takes) → pick a deck → review.
    • Confirm — flip the card, Right — "I know", Left — "I don't know", Back — leave.
  • Decks are plain files on the SD card: /cards/<topic>/cards.tsv and
    /plugins/anki/cards/<topic>/cards.tsv (the ready-made english-japanese and english-russian
    decks ship in sd-plugins/anki/).
  • Record format (cards.tsv, fields separated by TAB):
    • word<TAB>transcription<TAB>translate[<TAB>context][<TAB>image]
    • or Anki's own export shape: front<TAB>back[<TAB>image]
    • the picture is optional and always last; it is recognised by its .bmp/.png/.jpg
      extension, and the number of text fields picks their meaning (2 — word/translate, 3 — with a
      transcription, 4 — with a context sentence as well).
  • Pictures — pre-rendered 1bpp BMPs (the panel is 1 bit per pixel anyway), converted on the
    computer by scripts/anki_import.py (Pillow, --image-max, 440x480 by default).
  • Optional context field — a sentence the word appears in. On the front side it is drawn at
    the top in italic and set apart from the word by a thin rule. One short sentence (10–15 words).
  • The schedule counts deck visits, not days: the Xteink X4 has no RTC and nothing seeds the
    system clock, so day-based intervals would never work at all (every card would stay due
    forever). One entry into a deck is one session; the counter lives in progress.bin and survives
    reboots and deep sleep.
    • "I know" parks the card for the next N visits (Settings → Reader → Anki: pause "I know"
      cards
      , 1–30, default 4).
    • "I don't know" makes it due immediately and brings it back at the end of the current session.
    • Review all (Confirm on the review-complete screen) deliberately ignores the schedule and
      lists every card.
  • The boot screen names the build 1.6.5 Hector Edition.

Deck list

Every deck row reads Cards: N (M): N is the size of the deck and M how many of those cards
the coming visit will really show — the cards that have come due plus the ones never answered, i.e.
exactly the queue the review screen builds. The preview counts at the stored visit counter + 1
(that is the visit the next beginSession() hands out) and does not touch the schedule, so opening
the list never advances a deck.

The OPDS browser is no longer the last row of this list: it is a row in the File Transfer menu
(Home → File transfer → OPDS Browser). Leaving the deck list with Back returns home with the
cursor on Anki cards instead of the first row.

What has been verified

  • pio run -e gh_release (X3/X4) — SUCCESS, RAM 17.7% (57,904 B), Flash 85.4% (5,594,039 B).
  • Full host test suite: 416/416.
  • Simulator: the deck list shows Cards: 50 (50) and drops to Cards: 50 (49) after one "I know";
    the File Transfer menu lists OPDS Browser; Back puts the cursor back on Anki cards.

Progress file format change

progress.bin moved to version 2: the header gained a session counter (u32), and the record stores
dueAtSession instead of intervalDays/lastReviewed. A version 1 file (day-based schedule) is
replaced on the first entry into the deck, because the record offsets depend on the header size.
In practice this means the progress of earlier reviews is reset once. Nothing is lost — the old
schedule was unusable anyway (every card was permanently due).

Fixed after the first run on the device

The buttons on the review screen did nothing. AnkiReviewActivity::loop() called
mappedInput.update() itself — the only activity in the project that did so. The main loop
(main.cpp) already calls update() once per iteration before dispatching, and
InputManager::applyStateChange() computes its press/release edges against the previous state and
then commits it (currentState = state). A second call in the same iteration recomputed
state & ~state = 0 and wiped those edges, so wasReleased() reported nothing for any button. The
call is gone; the simulator never showed the bug because its event delivery takes another path.

Shipped decks and generating new ones

The repository carries three decks: english-japanese (3 cards), english-russian (42 cards, a
picture on each) and english-context (9 cards in the full five-field form, one of them without a
picture).

To have a model generate a deck there is a ready-made prompt (in English):
docs/anki-cards-prompt.md — it carries the format rules, the 1-bit
BMP requirements, the byte limits and a self-check list.

Installation

  1. Download crosspoint-1.6.5-hector-edition-x3-x4.bin from the release assets.
  2. Flash it like a normal CrossPoint firmware for the X3/X4.
  3. Put decks on the SD card: /cards/<topic>/cards.tsv (or copy sd-plugins/anki/ as a whole to
    /plugins/anki/).

Notes

  • The base is tag 1.6.5, not develop: the card feature was written on develop, which has the
    SD plugin system, so the integration points were adapted to 1.6.5 (the deck list no longer carries
    an OPDS row — that browser lives in the File Transfer menu now — and instead of
    serialization::tryReadPod/tryWritePod from develop, local checked helpers are used).
  • CROSSPOINT_VERSION is left as the plain 1.6.5 so that OTA keeps comparing the version against
    upstream releases; the "Hector Edition" name is added on the boot screen only.
  • Decks with pictures come from open sources, mostly by-nc* licences — fine for personal testing,
    not for redistribution (see sd-plugins/anki/cards/english-russian/SOURCES.md).

Checksum: crosspoint-1.6.5-hector-edition-x3-x4.bin
sha256 12f96fddcb686dded47bfee8549455ed898b57f4f8cbd3487f2f36cfe002cdd2

Do not use earlier builds: 07b45de1… — without the deck-list counters, the OPDS move and the
home-focus fix; d6251460… — without the context field; 89a4889f… — without visit-based
scheduling; ac3d4685… — with non-working buttons on the review screen.