Skip to content

Commit 88b7abe

Browse files
committed
SnapProcessorRP2040 blocking read
1 parent 975a715 commit 88b7abe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/api/SnapProcessorRP2040.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ class SnapProcessorRP2040 : public SnapProcessor {
3232
ESP_LOGW(TAG, "begin: %d", buffer_count * 1024);
3333
// regular begin logic
3434
bool result = SnapProcessor::begin();
35-
// allocate buffer, so that we could use psram
36-
size_queue.resize(RTOS_MAX_QUEUE_ENTRY_COUNT);
35+
36+
// allocate buffer
37+
buffer.setBlockingRead(true);
38+
buffer.setBlockingWrite(true);
3739
buffer.resize(buffer_count * 1024);
40+
41+
// we need to read back the buffer with the written sizes
42+
size_queue.resize(RTOS_MAX_QUEUE_ENTRY_COUNT);
43+
3844
is_active = false;
3945
return result;
4046
}

0 commit comments

Comments
 (0)