Skip to content

Commit

Permalink
Screenshot code spits out JSON array
Browse files Browse the repository at this point in the history
  • Loading branch information
djphazer committed Jan 21, 2024
1 parent e7ca9c9 commit 051c12d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions software/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,16 @@ void FASTRUN loop() {
// check for frame buffer to have capture data ready
const uint8_t *capture_data = display::frame_buffer.captured();
if (capture_data) {
Serial.print("[");
for (size_t i=0; i < display::frame_buffer.kFrameSize; i++) {
// TODO: should transmit at a controlled pace so USB buffers
// don't fill up, causing Serial.print() to have to wait,
// which can stall running the rest of loop()
uint8_t n = *capture_data++;
if (n < 16) Serial.print("0");
Serial.print(n, HEX);
if (i) Serial.print(",");
Serial.print(n);
}
Serial.print("]");
Serial.println();
Serial.flush();
display::frame_buffer.capture_retire();
Expand Down

0 comments on commit 051c12d

Please sign in to comment.