A custom OS for the xteink x4 ebook reader
at main 15 lines 502 B view raw
hansmrtn
refactor: code review cleanup, bug fixes, and RTC session persistence rtc session persistence: - add rtc_session module for deep sleep state preservation - save/restore nav stack, reader position, files scroll, home state - cache settings in RTC memory to skip SD reads on wake - keep RTC FAST memory powered during sleep (~1-2µA extra) - add collect_session/apply_session to AppLayer trait - add session state accessors to home, files, reader apps bugs: - fix typos in timing.rs (dookmark -> bookmark, dffset -> offset) - add spine bounds check in images.rs scan_chapter_for_image - add chapter validation after spine load in reader - log errors on pulp dir creation failure in main.rs - fix misleading comment in bitmap.rs (fallback is '?' not space) consolidation: - remove redundant extern crate alloc from files.rs, reader/mod.rs, images.rs - extract hint() helper in build.rs - extract is_power_event() helper in scheduler.rs - extract enter_error() helper in reader/mod.rs - add CONTENT_REGION constant in home.rs - trim unused layout constants clarity: - add rotation comment for SCREEN_W/H swap in board/mod.rs - add window bounds comment in strip.rs - rename cryptic vars in paging.rs (lc->line_count, ls->line_start, etc) - add state machine comment in reader/mod.rs simplification: - use if let instead of empty match in storage.rs - use map_or in app.rs render_ready - use .expect() for spawn failures in main.rs style: - convert /// doc comments to // in rtc_session.rs, layout.rs, utf8.rs
2f7b352f
1// shared layout constants for UI rendering 2// 3// only constants used by 2+ apps belong here. 4// single-use layout values should be defined locally. 5 6use super::statusbar::BAR_HEIGHT; 7use crate::board::SCREEN_W; 8 9pub const CONTENT_TOP: u16 = BAR_HEIGHT; 10pub const LARGE_MARGIN: u16 = 16; 11pub const SECTION_GAP: u16 = 8; 12pub const TITLE_Y_OFFSET: u16 = 4; 13pub const TITLE_Y: u16 = CONTENT_TOP + TITLE_Y_OFFSET; 14pub const FULL_CONTENT_W: u16 = SCREEN_W - 2 * LARGE_MARGIN; 15pub const HEADER_W: u16 = 300;