feat: Allow screenshot retrieval from device#820
feat: Allow screenshot retrieval from device#820osteotek merged 5 commits intocrosspoint-reader:masterfrom
Conversation
|
May worth mentioning that I'm working on mostly the same feature on #715 , except that it allows much more than only screenshot (for example, also allow using a host directory as fake SD card) In the long term, I also want to allow controlling buttons from host PC, so may you reconsider if this PR is still necessary? |
I wasn't aware of your work - looking great - definitely way more advanced than anything in this simple monitor 🥇 |
|
Sounds ok then, I think the debugging system is quite still in early stage and some duplicated functionalities can be acceptable. Just a small clarification though: my PR doesn't need docker to work, has minimal python dependency because the GUI is just a web page. The docker version is only required on the QEMU branch, which is currently discontinued. |
| Serial.printf("SCREENSHOT_START:%d\n", HalDisplay::BUFFER_SIZE); | ||
| uint8_t* buf = display.getFrameBuffer(); | ||
| Serial.write(buf, HalDisplay::BUFFER_SIZE); | ||
| Serial.printf("SCREENSHOT_END\n"); | ||
| } |
There was a problem hiding this comment.
Just a small note that the scheduler can always interrupt any this task between 2 Serial operations, this can lead to something like:
SCREENSHOT_START:123
(some other tasks printing stuff)
(then, screen data)
SCREENSHOT_END
This is a real problem I mentioned in my other PR, and I resolved it by simply give the current task highest priority. But probably it's not very necessary here, as the screenshot is always be taken on command, not automatically.
In the future, I think it will be cleaner to delegate any host-device communication to a dedicated class. At least on my PR, I added EmulationUtils.cpp for this purpose.
* master: feat: Allow screenshot retrieval from device (crosspoint-reader#820) feat: more power saving on idle (crosspoint-reader#801)
## Summary * Add a small loop in main to be able to receive external commands, currently being sent via the debugging_monitor * Implemented command: cmd:SCREENSHOT sends the currently displayed screen to the monitor, which will then store it to screenshot.bmp ## Additional Context I was getting annoyed with taking tilted/unsharp photos of the device screen, so I added the ability to press Enter during the monitor execution and type SCREENSHOT to send a command. Could be extended in the future [screenshot.bmp](https://github.com/user-attachments/files/25213230/screenshot.bmp) --- ### 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
## Summary * Add a small loop in main to be able to receive external commands, currently being sent via the debugging_monitor * Implemented command: cmd:SCREENSHOT sends the currently displayed screen to the monitor, which will then store it to screenshot.bmp ## Additional Context I was getting annoyed with taking tilted/unsharp photos of the device screen, so I added the ability to press Enter during the monitor execution and type SCREENSHOT to send a command. Could be extended in the future [screenshot.bmp](https://github.com/user-attachments/files/25213230/screenshot.bmp) --- ### 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
Summary
Additional Context
I was getting annoyed with taking tilted/unsharp photos of the device screen, so I added the ability to press Enter during the monitor execution and type SCREENSHOT to send a command. Could be extended in the future
screenshot.bmp
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