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

This commit is contained in:
Damien George 2016-08-27 18:31:58 +10:00
parent fea7fe45ea
commit 531217a06b
1 changed files with 1 additions and 1 deletions

View File

@ -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;
if (n_args == 3) {
// 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 {
// set
if (mp_obj_get_int(args[3])) {