mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Merge branch 'v1' into v1dev
This commit is contained in:
commit
845aa38bd6
@ -1206,19 +1206,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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user