static er_dir_t er_buttons_to_dir(bool sw1_pressed, bool sw2_pressed)
Decide a page-turn direction from the two user-button states.
static bool er_pageturn_step(uint32_t chapter, uint32_t page, uint32_t pages, uint32_t ch_count, er_dir_t dir, uint32_t *out_chap, uint32_t *out_page, bool *out_crossed)
Advance/retreat the reading location by one page, crossing chapters.
er_pageturn_const_t
Constants for the page-turn decisions (no magic numbers).
@ k_er_page_last
Sentinel: "last page of this chapter".
@ k_er_pt_thirds
Screen split into thirds for edge taps.
static er_dir_t er_tap_to_dir(int32_t x, int32_t width)
Decide a page-turn direction from a touch X coordinate (edge taps).
er_dir_t
Page-turn direction produced by an input decision.