summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/nrf/common-hal/audiobusio/I2SOut.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c
index ac369277f..04c415196 100644
--- a/ports/nrf/common-hal/audiobusio/I2SOut.c
+++ b/ports/nrf/common-hal/audiobusio/I2SOut.c
@@ -139,14 +139,14 @@ static void i2s_buffer_fill(audiobusio_i2sout_obj_t* self) {
uint16_t *bp = (uint16_t*)buffer;
uint16_t *be = (uint16_t*)(buffer + bytecount);
uint16_t *sp = (uint16_t*)self->sample_data;
- for (; bp != be; bp++) {
+ for (; bp < be;) {
*bp++ = *sp++ + 0x8000;
}
} else {
uint8_t *bp = (uint8_t*)buffer;
uint8_t *be = (uint8_t*)(buffer + bytecount);
uint8_t *sp = (uint8_t*)self->sample_data;
- for (; bp != be; bp++) {
+ for (; bp < be;) {
*bp++ = *sp++ + 0x80;
}
}