Skip to content

Commit cc96c39

Browse files
author
Melissa LeBlanc-Williams
committed
Fixed wrong operator
1 parent c3329e2 commit cc96c39

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

shared-module/displayio/Display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void displayio_display_set_region_to_update(displayio_display_obj_t* self, uint1
222222
uint16_t data[2];
223223
self->send(self->bus, true, &self->set_column_command, 1);
224224
if (self->single_byte_bounds) {
225-
data[0] = __builtin_bswap16((x0 + self->colstart) << 8 | (x1 - 1 + self->colstart) && 0xFF);
225+
data[0] = __builtin_bswap16(((x0 + self->colstart) << 8) | ((x1 - 1 + self->colstart) & 0xFF));
226226
self->send(self->bus, false, (uint8_t*) data, 2);
227227
} else {
228228
data[0] = __builtin_bswap16(x0 + self->colstart);
@@ -231,7 +231,7 @@ void displayio_display_set_region_to_update(displayio_display_obj_t* self, uint1
231231
}
232232
self->send(self->bus, true, &self->set_row_command, 1);
233233
if (self->single_byte_bounds) {
234-
data[0] = __builtin_bswap16((y0 + self->rowstart) << 8 | (y1 - 1 + self->rowstart) && 0xFF);
234+
data[0] = __builtin_bswap16(((y0 + self->rowstart) << 8) | ((y1 - 1 + self->rowstart) & 0xFF));
235235
self->send(self->bus, false, (uint8_t*) data, 2);
236236
} else {
237237
data[0] = __builtin_bswap16(y0 + self->rowstart);

0 commit comments

Comments
 (0)