Infin­ity

Firmware for the Xteink X4 and X3 e-ink readers. Most firmwares let you read. Infinity won't let you stop.

ESP32-C3 RISC-V 160 MHz 380 KB RAM No PSRAM 16 MB flash 800 × 480 e-ink MIT license
Hook

Reading, treated like a habit

Habits are built through reinforcement, so Infinity adds a gamification layer designed to keep you coming back. All of it is optional and can be switched off — but it's hard to give up once you start.

Daily goal

You set the minutes; Infinity nudges you to hit them, every day.

Streak + freeze tokens

A reading-day streak you'll hate to break — with tokens that forgive an off day.

Surprise rewards

Sometimes hitting your goal gifts you a token, sometimes not. Variable-ratio reinforcement: exactly what hooks you.

Daily quests

Rotating challenges that change every day.

Achievements

Badges unlocked by reading milestones.

Records & history

Personal records and a weekly log, to see how far you've come.

Read

Everything a reader should do, polished

EPUB 2 / 3

Images, CSS styles, and multilingual hyphenation.

XTC · TXT · Markdown

Pre-rendered XTC supports books larger than 2 GB.

Fonts

Bookerly, Lexend and Bokerlam built in, plus custom fonts from the SD card. Dual-font model for mixed scripts.

Instant page turns

Font cache plus silent pre-indexing of the next chapter. Four sizes with smoothed grayscale rendering.

KOReader sync

Continue your progress across devices.

Focus mode

Hides every extra: just you and your books.

Your layout

Dark mode, five themes, a fully configurable status bar, four orientations with remappable buttons.

Bookmarks & stats

Long-press to bookmark; reading stats feed the streaks. Nine power-button actions via single, double or triple press.

Play

Six games, zero touchscreen

Not a junk drawer: each game was chosen because it controls well with a D-pad and a handful of buttons. Each keeps its own high score.

2048
Slide and merge equal tiles until you reach 2048.
Sliding puzzle
Push numbered tiles through the empty gap until they're in order.
Lights Out
Pressing a cell flips it and its neighbours. Turn everything off in the fewest moves.
Peg solitaire
Jump pegs to remove them. A perfect game leaves exactly one on the board.
Maze
Find the exit through generated mazes, counting your steps.
Rush Hour
Slide the blockers out of the way to free the stuck car.
Sync

A clock with no clock

The Xteink X4 has no battery-backed RTC. This is the kind of problem Infinity sweats over — and a fair sample of how the firmware is built under the hood.

The problem

On wake from deep sleep, time is restored from an imprecise internal oscillator that keeps accumulating drift. The device could show 23:55 when it was really 09:00.

Worse: bringing WiFi up from a low-priority task with little free memory froze the whole device.

The fix

Infinity resyncs opportunistically. When the clock is approximate, it connects in the background to a saved WiFi network, sets the time via NTP, and switches the radio off. A discreet ~ in the status bar marks the time as approximate until sync completes — you saw it at the top of this page.

The radio now always starts from the main task, through a state machine that advances one small step per cycle, so the interface never blocks. Timezones with DST rules are built in.

Flash

Install in one minute

  1. Connect your X3 / X4 via USB-C and turn it on.
  2. Open xteink.dve.al and flash straight from the browser.

Or build it yourself:

git clone --recursive https://github.com/alexfdez1010/Infinity.git
cd Infinity
pio run --target upload

Custom fonts: convert any .ttf / .otf at xteink.lakafior.com, drop the .bin into /fonts/ on the SD card, restart.

Build

380 KB of RAM, every byte counts

PlatformIO, Arduino framework, C++17. The architecture follows an Android-style activity model: each screen is an Activity pushed onto a manager that owns the lifecycle and a single render thread. TLS buffers are trimmed to 4 KB so WiFi and encryption fit in the free heap.

pio run -e default   # standard build, serial log
pio run -e slim      # release build, smaller
pio run -e ble       # bluetooth build (beta)
pio run -t upload    # flash via USB

Contributing is the usual dance: fork → branch → pull request. Every visible string is translated (English and Castilian Spanish). Infinity stands on CrossPoint Reader, which provides the EPUB engine and system foundation, and CrossPet, the adaptation it takes over from.