Skip to content

fix: don't wake up after USB connect#644

Merged
daveallie merged 8 commits intocrosspoint-reader:masterfrom
osteotek:fix-usb-wakeup
Feb 1, 2026
Merged

fix: don't wake up after USB connect#644
daveallie merged 8 commits intocrosspoint-reader:masterfrom
osteotek:fix-usb-wakeup

Conversation

@osteotek
Copy link
Member

@osteotek osteotek commented Feb 1, 2026

Summary

  • fixes problem that if short power button press is enabled, connecting device to usb leads to waking up

Copilot AI review requested due to automatic review settings February 1, 2026 11:03
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

Fixes unintended wake-ups when USB power is connected while short power-button press mode is enabled, by distinguishing USB-power cold boots from intentional power-button wakes.

Changes:

  • Replaces the boolean “wakeup by power button” check with a WakeupReason enum and getWakeupReason() implementation.
  • In setup(), sends the device back to deep sleep when the wake reason is “USB power” (cold boot).
  • Adjusts deep-sleep entry to arm GPIO wakeup after the power button is released.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main.cpp Uses getWakeupReason() to avoid treating USB-power cold boots as a normal wake and immediately returns to deep sleep.
lib/hal/HalGPIO.h Introduces WakeupReason enum and getWakeupReason() API.
lib/hal/HalGPIO.cpp Implements wake-reason classification and reorders deep-sleep wakeup arming after button release.

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

@daveallie daveallie merged commit 0d82b03 into crosspoint-reader:master Feb 1, 2026
8 checks passed
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 1, 2026
## Summary

* fixes problem that if short power button press is enabled, connecting
device to usb leads to waking up
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 2, 2026
## Summary

* fixes problem that if short power button press is enabled, connecting
device to usb leads to waking up
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 2, 2026
## Summary

* fixes problem that if short power button press is enabled, connecting
device to usb leads to waking up
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Feb 3, 2026
* master:
  feat: Debugging monitor script (crosspoint-reader#555)
  fix: truncating chapter titles using UTF-8 safe function (crosspoint-reader#599)
  fix: don't wake up after USB connect (crosspoint-reader#644)
  Revert "fix: don't wake up after USB connect" (crosspoint-reader#643)
  fix: custom sleep not showing image at index 0 (crosspoint-reader#639)
  docs: Update USER_GUIDE.md (crosspoint-reader#625)
  fix: Hide button hints in landscape CW mode (crosspoint-reader#637)
  fix: WiFi error screen text clarifications (crosspoint-reader#612)
  fix: don't wake up after USB connect (crosspoint-reader#576)
  feat(ui): change popup logic (crosspoint-reader#442)
  feat: Add reading menu and delete cache function (crosspoint-reader#433)
lukestein pushed a commit that referenced this pull request Feb 3, 2026
## Summary

* fixes problem that if short power button press is enabled, connecting
device to usb leads to waking up
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 3, 2026
## Summary

* fixes problem that if short power button press is enabled, connecting
device to usb leads to waking up
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 3, 2026
## Summary

* fixes problem that if short power button press is enabled, connecting
device to usb leads to waking up
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## Summary

* fixes problem that if short power button press is enabled, connecting
device to usb leads to waking up
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.

3 participants