diff --git a/src/p9813/p9813.c b/src/p9813/p9813.c index caaeda3a..4e109829 100644 --- a/src/p9813/p9813.c +++ b/src/p9813/p9813.c @@ -132,7 +132,7 @@ upm_result_t p9813_refresh(p9813_context dev) { // The first byte is 11 followed by inverted bits 7 and 6 of blue, green, and red byte0 = 0xFF; byte0 ^= (blue >> 2) & 0x30; // XOR bits 4-5 - byte0 ^= (green >> 4) & 0xC0; // XOR bits 2-3 + byte0 ^= (green >> 4) & 0x0C; // XOR bits 2-3 byte0 ^= (red >> 6) & 0x03; // XOR bits 0-1 p9813_send_byte(dev, byte0); p9813_send_byte(dev, blue); diff --git a/src/p9813/p9813.cxx b/src/p9813/p9813.cxx index 3ba281a9..82b8c59e 100644 --- a/src/p9813/p9813.cxx +++ b/src/p9813/p9813.cxx @@ -107,7 +107,7 @@ P9813::pushState(void) // The first byte is 11 followed by inverted bits 7 and 6 of blue, green, and red uint8_t byte0 = 0xFF; byte0 ^= (blue >> 2) & 0x30; // XOR bits 4-5 - byte0 ^= (green >> 4) & 0xC0; // XOR bits 2-3 + byte0 ^= (green >> 4) & 0x0C; // XOR bits 2-3 byte0 ^= (red >> 6) & 0x03; // XOR bits 0-1 sendByte(byte0); sendByte(blue);