Skip to content

Commit

Permalink
Switch to bulk transfer mode. (Turns out that the mix-up in the defin…
Browse files Browse the repository at this point in the history
…es (see previous commit) means that I have been testing in bulk mode all along and that isochronous mode caused most of the troubles that I just tried to fix. So, let's test/use bulk...)
  • Loading branch information
Staacks committed Jul 2, 2023
1 parent 2c0291c commit 021c926
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions firmware/jpeg/jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ void inline continueBackbufferToJPEG() {
readyBufferIsNew = true; //Note: At this point the we have written our pixels to the jpegPIO, but they may still be processed and pushed through DMA. However, this should be extremely fast and even if USB would start transferring the frame before DMA has compelte (which I highly doubt even happens), there is no way the transfer reaches the last bytes before DMA completes, so there is no reason to stall here.
}
}
if (encodeIndex < SCREEN_SIZE && (ENCODE_PIO->fstat & ENCODE_IN_EMPTY_MASK) == ENCODE_IN_EMPTY_MASK ) {
ENCODE_PIO->fdebug = 0xffffffff; //Clear encode debug register (no need to be specific - all SMs are working on encoding)
if (encodeIndex < SCREEN_SIZE && (ENCODE_PIO->fstat & ENCODE_IN_EMPTY_MASK) == ENCODE_IN_EMPTY_MASK) {
pushPixelsToJpegPIO(PREPARE_SM_A);
pushPixelsToJpegPIO(PREPARE_SM_A);
pushPixelsToJpegPIO(PREPARE_SM_A);
Expand Down
2 changes: 1 addition & 1 deletion firmware/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
#define CFG_TUD_VIDEO_STREAMING 1

//Bulk transfer mode (in contrast to isochronous mode)
#define CFG_TUD_VIDEO_STREAMING_BULK 0
#define CFG_TUD_VIDEO_STREAMING_BULK 1

// video streaming endpoint size
#if CFG_TUD_VIDEO_STREAMING_BULK == 1
Expand Down

0 comments on commit 021c926

Please sign in to comment.