Skip to content

feat: wakeup target detection#731

Merged
daveallie merged 2 commits intocrosspoint-reader:masterfrom
osteotek:feat-wakeup-target
Feb 8, 2026
Merged

feat: wakeup target detection#731
daveallie merged 2 commits intocrosspoint-reader:masterfrom
osteotek:feat-wakeup-target

Conversation

@osteotek
Copy link
Member

@osteotek osteotek commented Feb 6, 2026

Summary

  • If going to sleep was from the Reader view, wake up to the same book. Otherwise, wakeup to the Home view

Copilot AI review requested due to automatic review settings February 6, 2026 12:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements wakeup target detection to improve the user experience when waking from sleep. The device now tracks whether it went to sleep from the reader view and uses this information to determine the appropriate wakeup destination.

Changes:

  • Added lastSleepFromReader boolean flag to track sleep origin
  • Introduced isReaderActivity() virtual method to identify reader activities
  • Modified wakeup logic to consider both the presence of an open book and the sleep origin

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/CrossPointState.h Added lastSleepFromReader boolean field to state
src/CrossPointState.cpp Bumped state file version to 4, added serialization for lastSleepFromReader with backward compatibility
src/activities/Activity.h Added virtual isReaderActivity() method returning false by default
src/activities/reader/ReaderActivity.h Overrode isReaderActivity() to return true for reader activities
src/main.cpp Set lastSleepFromReader on sleep, added it to wakeup condition check

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iandchasse
Copy link
Contributor

Could this be extended to effectively implement deep sleep during reading? As in a flow of:

  1. Open book
  2. Deep sleep
  3. Turn page
  4. Wake up (detect ADC input in ULP?)
  5. Turn page (or exit/power depending on action)
  6. Repeat from step 2

It would effectively save a lot of battery life for the use case of reading

@osteotek
Copy link
Member Author

osteotek commented Feb 6, 2026

Could this be extended to effectively implement deep sleep during reading? As in a flow of:

Yeah, I thought of something similar. But the only way to wake up from deepsleep is the power button, that's how the device is wired. And waking up can take up to a second, not really suitable for reading

@osteotek osteotek requested a review from a team February 6, 2026 17:44
Copy link
Contributor

@lukestein lukestein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No code review conducted, but tested on device, and seems to work exactly as expected.

Thank you! 🎉 A nice little bit of UX polish.

@lukestein lukestein requested a review from a team February 7, 2026 15:15
Copy link
Contributor

@jdk2pq jdk2pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I left one minor, non-blocking comment for consideration, but I'm totally fine with resolving it as is too. Great job!

// Enter deep sleep mode
void enterDeepSleep() {
APP_STATE.lastSleepFromReader = currentActivity && currentActivity->isReaderActivity();
APP_STATE.saveToFile();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, non-blocking: saveToFile() returns a bool that could be checked and have some kind of Serial debug statement about not being able to save the APP_STATE. But that's not currently a pattern we follow anywhere else saveToFile or loadFromFile gets called, so I'm completely fine with leaving this as is too.

@daveallie daveallie merged commit 1caad57 into crosspoint-reader:master Feb 8, 2026
5 checks passed
daveallie pushed a commit that referenced this pull request Feb 8, 2026
## Summary

* If going to sleep was from the Reader view, wake up to the same book.
Otherwise, wakeup to the Home view
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 8, 2026
## Summary

* If going to sleep was from the Reader view, wake up to the same book.
Otherwise, wakeup to the Home view
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 8, 2026
## Summary

* If going to sleep was from the Reader view, wake up to the same book.
Otherwise, wakeup to the Home view
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 8, 2026
## Summary

* If going to sleep was from the Reader view, wake up to the same book.
Otherwise, wakeup to the Home view
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Feb 9, 2026
…king-space

* master:
  feat: Add percentage support to CSS properties (crosspoint-reader#738)
  Use GITHUB_REF_NAME over GITHUB_HEAD_REF in release candidate workflow
  Add release candidate workflow
  fix: Allow OTA update from RC build to full release (crosspoint-reader#778)
  fix(ui): Add Back label in KOReader Sync screen (crosspoint-reader#770)
  fix: Add EPUB 3 cover image detection (crosspoint-reader#760)
  feat: A web editor for settings (crosspoint-reader#667)
  feat: add HalStorage (crosspoint-reader#656)
  perf: optimize drawPixel() (crosspoint-reader#748)
  feat: wakeup target detection (crosspoint-reader#731)
  fix: Scrolling page items calculation (crosspoint-reader#716)
  refactor: Rename "Embedded Style" to "Book's Embedded Style" (crosspoint-reader#746)
  feat: optimize fillRectDither (crosspoint-reader#737)
Marma92 pushed a commit to Marma92/crosspoint-reader that referenced this pull request Feb 10, 2026
## Summary

* If going to sleep was from the Reader view, wake up to the same book.
Otherwise, wakeup to the Home view
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Feb 11, 2026
…king-space

* master:
  feat: use natural sort in file browser (crosspoint-reader#722)
  fix: issue if book href are absolute url and not relative to server (crosspoint-reader#741)
  feat: unify navigation handling with system-wide continuous navigation (crosspoint-reader#600)
  feat: Add Italian hyphenation support (crosspoint-reader#584)
  feat: Add percentage support to CSS properties (crosspoint-reader#738)
  Use GITHUB_REF_NAME over GITHUB_HEAD_REF in release candidate workflow
  Move release candidate workflow to manual dispatch
  fix: Allow OTA update from RC build to full release (crosspoint-reader#778)
  refactor: Rename "Embedded Style" to "Book's Embedded Style" (crosspoint-reader#746)
  perf: optimize drawPixel() (crosspoint-reader#748)
  feat: wakeup target detection (crosspoint-reader#731)
  fix: Scrolling page items calculation (crosspoint-reader#716)
  feat: optimize fillRectDither (crosspoint-reader#737)
  fix: increase lyra sideButtonHintsWidth to 30 (crosspoint-reader#727)
  fix: Remove separations after style changes (crosspoint-reader#720)
  fix: Lag before displaying covers on home screen (crosspoint-reader#721)
  feat: Add Settings for toggling CSS on or off (crosspoint-reader#717)
  Use GITHUB_HEAD_REF
  release: 1.0.0
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Feb 13, 2026
* master: (25 commits)
  fix: Reduce MIN_SIZE_FOR_POPUP to 10KB (crosspoint-reader#809)
  docs: Update USER_GUIDE.md (crosspoint-reader#817)
  fix: Prevent sleeping when in OPDS browser / downloading books (crosspoint-reader#818)
  feat: Extend python debugging monitor functionality (keyword filter / suppress) (crosspoint-reader#810)
  docs: Update USER_GUIDE.md (crosspoint-reader#808)
  feat: Connect to last wifi by default (crosspoint-reader#752)
  feat: use natural sort in file browser (crosspoint-reader#722)
  fix: issue if book href are absolute url and not relative to server (crosspoint-reader#741)
  feat: unify navigation handling with system-wide continuous navigation (crosspoint-reader#600)
  feat: Add Italian hyphenation support (crosspoint-reader#584)
  feat: Add percentage support to CSS properties (crosspoint-reader#738)
  Use GITHUB_REF_NAME over GITHUB_HEAD_REF in release candidate workflow
  Move release candidate workflow to manual dispatch
  fix: Allow OTA update from RC build to full release (crosspoint-reader#778)
  refactor: Rename "Embedded Style" to "Book's Embedded Style" (crosspoint-reader#746)
  perf: optimize drawPixel() (crosspoint-reader#748)
  feat: wakeup target detection (crosspoint-reader#731)
  fix: Scrolling page items calculation (crosspoint-reader#716)
  feat: optimize fillRectDither (crosspoint-reader#737)
  fix: increase lyra sideButtonHintsWidth to 30 (crosspoint-reader#727)
  ...
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## Summary

* If going to sleep was from the Reader view, wake up to the same book.
Otherwise, wakeup to the Home view
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## Summary

* If going to sleep was from the Reader view, wake up to the same book.
Otherwise, wakeup to the Home view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants