Compare commits

...

7 Commits

Author SHA1 Message Date
GenesiaW
e99176dae0
Merge abc9921959 into 78d6e5931c 2026-02-04 09:18:12 +11:00
Jake Kenneally
78d6e5931c
fix: Correct debugging_monitor.py script instructions (#676)
Some checks are pending
CI / build (push) Waiting to run
## Summary

**What is the goal of this PR?**
- Minor correction to the `debugging_monitor.py` script instructions

**What changes are included?**
- `pyserial` should be installed, NOT `serial`, which is a [different
lib](https://pypi.org/project/serial/)
- Added macOS serial port

## Additional Context

- Just a minor docs update. I can confirm the debugging script is
working great on macOS

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< NO >**_
2026-02-04 00:33:20 +03:00
Luke Stein
dac11c3fdd
fix: Correct instruction text to match actual button text (#672)
## Summary

* Instruction text says "Press OK to scan again" but button label is
actually "Connect" (not OK)
* Corrects instruction text

---

### AI Usage

Did you use AI tools to help write this code? **No**
2026-02-04 00:32:52 +03:00
GenesiaW
abc9921959
Merge branch 'master' into feat/bootloop-reset-button 2026-02-03 22:01:12 +08:00
GenesiaW
cf04ae4a35
Update src/main.cpp
Co-authored-by: Arthur Tazhitdinov <lisnake@gmail.com>
2026-02-03 21:51:05 +08:00
GenesiaW
7f9b5787c1 feat: add automatic bootloop recovery 2026-01-28 19:57:19 +08:00
GenesiaW
74f2552c29 feat: holding back button while booting, boots to home screen as a mean of escaping boot loop 2026-01-28 17:39:08 +08:00
9 changed files with 38 additions and 5 deletions

View File

@ -102,13 +102,18 @@ After flashing the new features, its recommended to capture detailed logs fro
First, make sure all required Python packages are installed: First, make sure all required Python packages are installed:
```python ```python
python3 -m pip install serial colorama matplotlib python3 -m pip install pyserial colorama matplotlib
``` ```
after that run the script: after that run the script:
```sh ```sh
# For Linux
# This was tested on Debian and should work on most Linux systems.
python3 scripts/debugging_monitor.py python3 scripts/debugging_monitor.py
# For macOS
python3 scripts/debugging_monitor.py /dev/cu.usbmodem2101
``` ```
This was tested on Debian and should work on most Linux systems. Minor adjustments may be required for Windows or macOS. Minor adjustments may be required for Windows.
## Internals ## Internals

View File

@ -21,6 +21,7 @@ Welcome to the **CrossPoint** firmware. This guide outlines the hardware control
- [System Navigation](#system-navigation) - [System Navigation](#system-navigation)
- [5. Chapter Selection Screen](#5-chapter-selection-screen) - [5. Chapter Selection Screen](#5-chapter-selection-screen)
- [6. Current Limitations \& Roadmap](#6-current-limitations--roadmap) - [6. Current Limitations \& Roadmap](#6-current-limitations--roadmap)
- [7. Troubleshooting Issues \& Escaping Bootloop](#7-troubleshooting-issues--escaping-bootloop)
## 1. Hardware Overview ## 1. Hardware Overview
@ -220,3 +221,15 @@ Accessible by pressing **Confirm** while inside a book.
Please note that this firmware is currently in active development. The following features are **not yet supported** but are planned for future updates: Please note that this firmware is currently in active development. The following features are **not yet supported** but are planned for future updates:
* **Images:** Embedded images in e-books will not render. * **Images:** Embedded images in e-books will not render.
---
## 7. Troubleshooting Issues & Escaping Bootloop
If an issue or crash is encountered while using Crosspoint, feel free to raise an issue ticket and attach the serial monitor logs. The logs can be obtained by connecting the device to a computer and starting a serial monitor. Either [Serial Monitor](https://www.serialmonitor.org/) or the following command can be used:
```
pio device monitor
```
If the device is stuck in a bootloop, press and release the Reset button. Then, press and hold on to the configured Back button and the Power Button to boot to the Home Screen.

View File

@ -5,7 +5,7 @@
#include <Serialization.h> #include <Serialization.h>
namespace { namespace {
constexpr uint8_t STATE_FILE_VERSION = 2; constexpr uint8_t STATE_FILE_VERSION = 3;
constexpr char STATE_FILE[] = "/.crosspoint/state.bin"; constexpr char STATE_FILE[] = "/.crosspoint/state.bin";
} // namespace } // namespace
@ -20,6 +20,7 @@ bool CrossPointState::saveToFile() const {
serialization::writePod(outputFile, STATE_FILE_VERSION); serialization::writePod(outputFile, STATE_FILE_VERSION);
serialization::writeString(outputFile, openEpubPath); serialization::writeString(outputFile, openEpubPath);
serialization::writePod(outputFile, lastSleepImage); serialization::writePod(outputFile, lastSleepImage);
serialization::writePod(outputFile, readerActivityLoadCount);
outputFile.close(); outputFile.close();
return true; return true;
} }
@ -45,6 +46,10 @@ bool CrossPointState::loadFromFile() {
lastSleepImage = 0; lastSleepImage = 0;
} }
if (version >= 3) {
serialization::readPod(inputFile, readerActivityLoadCount);
}
inputFile.close(); inputFile.close();
return true; return true;
} }

View File

@ -9,6 +9,7 @@ class CrossPointState {
public: public:
std::string openEpubPath; std::string openEpubPath;
uint8_t lastSleepImage; uint8_t lastSleepImage;
uint8_t readerActivityLoadCount = 0;
~CrossPointState() = default; ~CrossPointState() = default;
// Get singleton instance // Get singleton instance

View File

@ -520,7 +520,7 @@ void WifiSelectionActivity::renderNetworkList() const {
const auto height = renderer.getLineHeight(UI_10_FONT_ID); const auto height = renderer.getLineHeight(UI_10_FONT_ID);
const auto top = (pageHeight - height) / 2; const auto top = (pageHeight - height) / 2;
renderer.drawCenteredText(UI_10_FONT_ID, top, "No networks found"); renderer.drawCenteredText(UI_10_FONT_ID, top, "No networks found");
renderer.drawCenteredText(SMALL_FONT_ID, top + height + 10, "Press OK to scan again"); renderer.drawCenteredText(SMALL_FONT_ID, top + height + 10, "Press Connect to scan again");
} else { } else {
// Calculate how many networks we can display // Calculate how many networks we can display
constexpr int startY = 60; constexpr int startY = 60;

View File

@ -112,6 +112,8 @@ void EpubReaderActivity::onExit() {
} }
vSemaphoreDelete(renderingMutex); vSemaphoreDelete(renderingMutex);
renderingMutex = nullptr; renderingMutex = nullptr;
APP_STATE.readerActivityLoadCount = 0;
APP_STATE.saveToFile();
section.reset(); section.reset();
epub.reset(); epub.reset();
} }

View File

@ -89,6 +89,8 @@ void TxtReaderActivity::onExit() {
renderingMutex = nullptr; renderingMutex = nullptr;
pageOffsets.clear(); pageOffsets.clear();
currentPageLines.clear(); currentPageLines.clear();
APP_STATE.readerActivityLoadCount = 0;
APP_STATE.saveToFile();
txt.reset(); txt.reset();
} }

View File

@ -69,6 +69,8 @@ void XtcReaderActivity::onExit() {
} }
vSemaphoreDelete(renderingMutex); vSemaphoreDelete(renderingMutex);
renderingMutex = nullptr; renderingMutex = nullptr;
APP_STATE.readerActivityLoadCount = 0;
APP_STATE.saveToFile();
xtc.reset(); xtc.reset();
} }

View File

@ -323,12 +323,15 @@ void setup() {
APP_STATE.loadFromFile(); APP_STATE.loadFromFile();
RECENT_BOOKS.loadFromFile(); RECENT_BOOKS.loadFromFile();
if (APP_STATE.openEpubPath.empty()) { // Boot to home screen directly when back button is held or when reader activity crashes 3 times
if (APP_STATE.openEpubPath.empty() || mappedInputManager.isPressed(MappedInputManager::Button::Back) ||
APP_STATE.readerActivityLoadCount > 0) {
onGoHome(); onGoHome();
} else { } else {
// Clear app state to avoid getting into a boot loop if the epub doesn't load // Clear app state to avoid getting into a boot loop if the epub doesn't load
const auto path = APP_STATE.openEpubPath; const auto path = APP_STATE.openEpubPath;
APP_STATE.openEpubPath = ""; APP_STATE.openEpubPath = "";
APP_STATE.readerActivityLoadCount++;
APP_STATE.saveToFile(); APP_STATE.saveToFile();
onGoToReader(path, MyLibraryActivity::Tab::Recent); onGoToReader(path, MyLibraryActivity::Tab::Recent);
} }