P9813: Minor bit mask fix

Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
Abhishek Malik 2017-07-11 17:38:28 -07:00
parent 1647d8bc08
commit bac9e3bbc0
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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);