Skip to content

Commit c9946df

Browse files
committed
nrf: i2sout: Use <, not !=, for loop condition
This is good C style, h/t @danh
1 parent 19d122e commit c9946df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ static void i2s_buffer_fill(audiobusio_i2sout_obj_t* self) {
139139
uint16_t *bp = (uint16_t*)buffer;
140140
uint16_t *be = (uint16_t*)(buffer + bytecount);
141141
uint16_t *sp = (uint16_t*)self->sample_data;
142-
for (; bp != be;) {
142+
for (; bp < be;) {
143143
*bp++ = *sp++ + 0x8000;
144144
}
145145
} else {
146146
uint8_t *bp = (uint8_t*)buffer;
147147
uint8_t *be = (uint8_t*)(buffer + bytecount);
148148
uint8_t *sp = (uint8_t*)self->sample_data;
149-
for (; bp != be;) {
149+
for (; bp < be;) {
150150
*bp++ = *sp++ + 0x80;
151151
}
152152
}

0 commit comments

Comments
 (0)