Skip to content

Commit ccf08aa

Browse files
committed
nrf: I2SOut: deal more gracefully with errors from the sample
1 parent b613a50 commit ccf08aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ports/nrf/common-hal/audiobusio/I2SOut.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ stopping: ;
140140
goto stopping;
141141
}
142142
}
143+
if (get_buffer_result == GET_BUFFER_ERROR || sample_buffer_length == 0) {
144+
self->stopping = true;
145+
goto stopping;
146+
}
143147
}
144148
uint16_t bytecount = MIN(bytesleft, (size_t)(self->sample_end - self->sample_data));
145149
if (self->samples_signed) {

0 commit comments

Comments
 (0)