mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
P9813: Minor bit mask fix
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
parent
1647d8bc08
commit
bac9e3bbc0
@ -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
|
// The first byte is 11 followed by inverted bits 7 and 6 of blue, green, and red
|
||||||
byte0 = 0xFF;
|
byte0 = 0xFF;
|
||||||
byte0 ^= (blue >> 2) & 0x30; // XOR bits 4-5
|
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
|
byte0 ^= (red >> 6) & 0x03; // XOR bits 0-1
|
||||||
p9813_send_byte(dev, byte0);
|
p9813_send_byte(dev, byte0);
|
||||||
p9813_send_byte(dev, blue);
|
p9813_send_byte(dev, blue);
|
||||||
|
@ -107,7 +107,7 @@ P9813::pushState(void)
|
|||||||
// The first byte is 11 followed by inverted bits 7 and 6 of blue, green, and red
|
// The first byte is 11 followed by inverted bits 7 and 6 of blue, green, and red
|
||||||
uint8_t byte0 = 0xFF;
|
uint8_t byte0 = 0xFF;
|
||||||
byte0 ^= (blue >> 2) & 0x30; // XOR bits 4-5
|
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
|
byte0 ^= (red >> 6) & 0x03; // XOR bits 0-1
|
||||||
sendByte(byte0);
|
sendByte(byte0);
|
||||||
sendByte(blue);
|
sendByte(blue);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user