mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Changed color byte order from WRGB to RGBW (R MSB). (#168)
This commit is contained in:
parent
36e0a00e80
commit
6720f86e5c
@ -813,8 +813,7 @@ int busValueToRGBW(const uint8_t* payload, size_t payload_length, const Dpt& dat
|
|||||||
switch (datatype.index) {
|
switch (datatype.index) {
|
||||||
case 0: // The RGBW value
|
case 0: // The RGBW value
|
||||||
{
|
{
|
||||||
uint32_t rgbw = (unsigned32FromPayload(payload, 0) >> 8)
|
uint32_t rgbw = unsigned32FromPayload(payload, 0);
|
||||||
+ (unsigned8FromPayload(payload, 3) << 24);
|
|
||||||
value = rgbw;
|
value = rgbw;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1548,13 +1547,11 @@ int valueToBusValueRGBW(const KNXValue& value, uint8_t* payload, size_t payload_
|
|||||||
case 0: // RGBW
|
case 0: // RGBW
|
||||||
{
|
{
|
||||||
uint32_t rgbw = (uint32_t)value;
|
uint32_t rgbw = (uint32_t)value;
|
||||||
unsigned16ToPayload(payload, payload_length, 0, rgbw >> 8, 0xffff); // RG
|
unsigned32ToPayload(payload, payload_length, 0, rgbw, 0xffffffff); // RGBW
|
||||||
unsigned8ToPayload(payload, payload_length, 2, rgbw, 0xff); // B
|
|
||||||
unsigned8ToPayload(payload, payload_length, 3, rgbw >> 24, 0xff); // W
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: // Mask bits
|
case 1: // Mask bits
|
||||||
unsigned8ToPayload(payload, payload_length, 5, (uint8_t)value, 0xff);
|
unsigned8ToPayload(payload, payload_length, 5, (uint8_t)value, 0x0f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user