github marcoand75/cpr-vcodex-steroids 1.5.0.23-dev1-cpr-vcodex-steroids

6 hours ago

πŸš€ CPR-vCodex Steroids β€” Update & Improvement Report

πŸ“‹ Summary

This update brings CPR-vCodex Steroids fully in line with upstream 1.5.0.23, while keeping all Steroids-specific enhancements intact. The firmware is more stable, faster, and easier to maintain β€” without changing the reading experience you already know.


🎯 Upstream Alignment β€” CPR-vCodex 1.5.0.23

What changed upstream

The original CPR-vCodex project introduced several fixes and improvements in version 1.5.0.23. We reviewed every change and safely integrated the ones that make sense for Steroids, while preserving our custom features like reading statistics, CrossInk EPUB engine, and X3/X4 device support.

What we brought over

  • βœ… Better hardware detection β€” More reliable startup on both X3 and X4 devices
  • βœ… Safer file handling β€” JSON settings and reading stats are now saved atomically, reducing corruption risk
  • βœ… Faster storage access β€” SD card operations are leaner and less fragmented
  • βœ… Cleaner reader startup β€” Removed redundant file existence checks for smoother book opening
  • βœ… Upstream test coverage β€” Added image-safety tests to catch regressions early

What we kept separate

  • πŸ”’ EPUB engine stays on the Steroids/CrossInk version (v60) for best compatibility
  • πŸ”’ Reading stats keep all Steroids fields (pace, summary JSON, etc.)
  • πŸ”’ Memory budget and JPEG handling remain tuned for the ESP32-C3 constraints

✨ Improvements & Refactoring (in plain English)

All of this is behind-the-scenes work. The UI and reading experience stay the same, but the code is cleaner, faster, and safer to change in the future.

🧹 Code cleanup & organization

  • Removed duplicate logic β€” Consolidated repeated boot and restart guards so the firmware does one thing, not six
  • Unified helper functions β€” WiFi, popups, toasts, and string copies now use shared utilities instead of being rewritten in each screen
  • Deleted dead code β€” Removed unused restart paths and old variables that were cluttering the main loop

⚑ Performance & memory

  • Smaller memory footprint β€” Better heap usage during boot, especially when loading fonts and settings
  • Leaner SD card access β€” Fewer directory scans mean faster library loading and less wear on the card
  • Safer JSON saves β€” Reading stats and settings are written to a temp file first, then renamed, so a power loss mid-save won’t corrupt data

πŸ“± User-facing polish

  • More consistent menus β€” List screens (settings, favorites, reading stats) now use a unified input system, so scrolling and confirmation behave the same everywhere
  • Cleaner empty states β€” When a list is empty (no favorites, no flashcards, etc.), the message is rendered consistently across all activities
  • Better long-press handling β€” Long press now has a single, clear implementation used by the library, home, and keyboard screens

πŸ› οΈ Developer-quality improvements

  • Shared utilities β€” Common operations like text overlay, battery shutdown screen, and WiFi power management are now in one place
  • Easier maintenance β€” Centralized hint rendering and list helpers mean bug fixes apply everywhere at once
  • Better documentation β€” Added internal guides for boot, loop, and silent-restart patterns so future changes are safer

πŸ—‘οΈ What we intentionally removed

  • CoverGenerator utility β€” Removed the experimental non-blocking cover generation introduced in earlier refactor commits. The old cover handling is restored for maximum stability.

πŸ“Š Impact at a Glance

Area Before After
Upstream version 1.5.0.22 1.5.0.23
Boot memory fragmentation Higher Lower
SD card file scans More Fewer
JSON save safety Basic Atomic with recovery
Code duplication Multiple patterns Unified helpers
Cover generation stability Experimental Stable classic flow

πŸ™ Why this matters

  • Stability first β€” Every change was evaluated against the ESP32-C3’s tight memory limits
  • No surprises β€” Your books, settings, reading stats, and WiFi credentials are preserved
  • Future-proof β€” Cleaner code means faster fixes and easier upstream syncs going forward

Built with care for the Xteink X4 and X3 community. If you spot anything unusual, open an issue on GitHub.

Don't miss a new cpr-vcodex-steroids release

NewReleases is sending notifications on new releases.