Merge commit 'b2bcba7' into openknx-merge

This commit is contained in:
Thomas Kunze 2024-08-09 20:32:02 +02:00
commit 2043141301
2 changed files with 10 additions and 4 deletions

View File

@ -87,6 +87,9 @@ int KNX_Decode_Value(uint8_t* payload, size_t payload_length, const Dpt& datatyp
// DPT 26.* - Scene Info
if (datatype.mainGroup == 26 && datatype.subGroup == 1 && datatype.index <= 1)
return busValueToSceneInfo(payload, payload_length, datatype, value);
// DPT 27.001 - 32 Bit field
if (datatype.mainGroup == 27 && datatype.subGroup == 1 && !datatype.index)
return busValueToSigned32(payload, payload_length, datatype, value);
// DPT 28.* - Unicode String
if (datatype.mainGroup == 28 && datatype.subGroup == 1 && !datatype.index)
return busValueToUnicode(payload, payload_length, datatype, value);
@ -206,6 +209,9 @@ int KNX_Encode_Value(const KNXValue& value, uint8_t* payload, size_t payload_len
// DPT 26.* - Scene Info
if (datatype.mainGroup == 26 && datatype.subGroup == 1 && datatype.index <= 1)
return valueToBusValueSceneInfo(value, payload, payload_length, datatype);
// DPT 27.001 - 32 Bit Field
if (datatype.mainGroup == 27 && datatype.subGroup == 1 && !datatype.index)
return valueToBusValueUnsigned32(value, payload, payload_length, datatype);
// DPT 28.* - Unicode String
if (datatype.mainGroup == 28 && datatype.subGroup == 1 && !datatype.index)
return valueToBusValueUnicode(value, payload, payload_length, datatype);

View File

@ -1205,19 +1205,19 @@ void TpUartDataLinkLayer::processRxQueue()
void TpUartDataLinkLayer::pushByteToRxQueue(uint8_t byte)
{
_rxBuffer[_rxBufferFront] = byte;
_rxBufferFront = (_rxBufferFront + 1) % MAX_RX_QUEUE_BYTES;
_rxBufferFront = (_rxBufferFront + 1) % (MAX_RX_QUEUE_BYTES);
}
uint8_t TpUartDataLinkLayer::pullByteFromRxQueue()
{
uint8_t byte = _rxBuffer[_rxBufferRear];
_rxBufferRear = (_rxBufferRear + 1) % MAX_RX_QUEUE_BYTES;
_rxBufferRear = (_rxBufferRear + 1) % (MAX_RX_QUEUE_BYTES);
return byte;
}
uint16_t TpUartDataLinkLayer::availableInRxQueue()
{
return ((_rxBufferFront == _rxBufferRear) ? MAX_RX_QUEUE_BYTES : (((MAX_RX_QUEUE_BYTES - _rxBufferFront) + _rxBufferRear) % MAX_RX_QUEUE_BYTES)) - 1;
return ((_rxBufferFront == _rxBufferRear) ? (MAX_RX_QUEUE_BYTES) : ((((MAX_RX_QUEUE_BYTES) - _rxBufferFront) + _rxBufferRear) % (MAX_RX_QUEUE_BYTES))) - 1;
}
#endif