Commit 531217a0 authored by Damien George's avatar Damien George
Browse files

extmod/modframebuf: Fix pixel accessor to return a 1-bit result.

parent fea7fe45
...@@ -83,7 +83,7 @@ STATIC mp_obj_t framebuf1_pixel(size_t n_args, const mp_obj_t *args) { ...@@ -83,7 +83,7 @@ STATIC mp_obj_t framebuf1_pixel(size_t n_args, const mp_obj_t *args) {
int index = (y / 8) * self->stride + x; int index = (y / 8) * self->stride + x;
if (n_args == 3) { if (n_args == 3) {
// get // get
return MP_OBJ_NEW_SMALL_INT(self->buf[index] >> (y & 7)); return MP_OBJ_NEW_SMALL_INT((self->buf[index] >> (y & 7)) & 1);
} else { } else {
// set // set
if (mp_obj_get_int(args[3])) { if (mp_obj_get_int(args[3])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment