Skip to content

Commit f0dd673

Browse files
committed
Fixes PDM read return value in 1 channel mode
1 parent 56cc627 commit f0dd673

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/PDM/src/stm32/PDM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ int PDMClass::read(void* buffer, size_t size)
104104
for (int i = 0; i < size; i++) {
105105
((uint16_t*)buffer)[i] = temp[i*2];
106106
}
107-
return read;
107+
return read/2;
108108
}
109109
int read = _doubleBuffer.read(buffer, size);
110110
return read;
@@ -172,4 +172,4 @@ extern "C" {
172172

173173
PDMClass PDM(0, 0, 0);
174174

175-
#endif
175+
#endif

0 commit comments

Comments
 (0)