int sr5ReadDataTimeout(ts_channel_s *tsChannel, uint8_t * buffer, int size, int timeout) { #if TS_UART_DMA_MODE || defined(__DOXYGEN__) UNUSED(tsChannel); return (int)iqReadTimeout(&tsUartDma.fifoRxQueue, (uint8_t * )buffer, (size_t)size, timeout); #else /* TS_UART_DMA_MODE */ if (tsChannel->channel == NULL) return 0; return chnReadTimeout(tsChannel->channel, (uint8_t * )buffer, size, timeout); #endif /* TS_UART_DMA_MODE */ }
static size_t _readt(void *ip, uint8_t *bp, size_t n, systime_t timeout) { return iqReadTimeout(&((SerialDriver *)ip)->iqueue, bp, n, timeout); }
static size_t _read(void *ip, uint8_t *bp, size_t n) { return iqReadTimeout(&((SerialDriver *)ip)->iqueue, bp, n, TIME_INFINITE); }