|
|
|
@ -518,12 +518,12 @@ void UARTDriver::_timer_tick(void)
@@ -518,12 +518,12 @@ void UARTDriver::_timer_tick(void)
|
|
|
|
|
|
|
|
|
|
A return value of zero means the HAL does not support this API |
|
|
|
|
*/ |
|
|
|
|
uint64_t UARTDriver::receive_time_constraint_us(uint16_t nbytes) const |
|
|
|
|
uint64_t UARTDriver::receive_time_constraint_us(uint16_t nbytes) |
|
|
|
|
{ |
|
|
|
|
uint64_t last_receive_us = _receive_timestamp; |
|
|
|
|
if (_uart_baudrate > 0) { |
|
|
|
|
// assume 10 bits per byte.
|
|
|
|
|
uint32_t transport_time_us = (1000000UL * 10UL / _uart_baudrate) * nbytes; |
|
|
|
|
uint32_t transport_time_us = (1000000UL * 10UL / _uart_baudrate) * (nbytes+available()); |
|
|
|
|
last_receive_us -= transport_time_us; |
|
|
|
|
} |
|
|
|
|
return last_receive_us; |
|
|
|
|