Skip to content

Commit

Permalink
Fixes issue with new uart class and midi (#539)
Browse files Browse the repository at this point in the history
The FIFO based mode had the double buffering happening in two different places.
Now, it still happens in both places, but it depends on one function,
and it wont actually do the operation twice.
  • Loading branch information
beserge authored Aug 4, 2022
1 parent 5b7d7f3 commit 899b01a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/per/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,16 +636,8 @@ void UartHandler::Impl::DmaReceiveFifoEndCallback(void* context,
if(res == UartHandler::Result::OK || res == UartHandler::Result::ERR)
{
UartHandler::Impl* handle = (UartHandler::Impl*)context;

// copy rx buffer to queue buffer
handle->dma_fifo_rx_->Advance(UART_RX_BUFF_SIZE - 1);
handle->rx_last_pos_ = UART_RX_BUFF_SIZE - 1;
uint8_t processbuf[256];
handle->dma_fifo_rx_->ImmediateRead(processbuf, UART_RX_BUFF_SIZE - 1);
handle->queue_rx_.Overwrite(processbuf, UART_RX_BUFF_SIZE - 1);

handle->HandleFifo();
HAL_UART_Init(&handle->huart_);

handle->DmaReceiveFifo();
}
}
Expand Down

0 comments on commit 899b01a

Please sign in to comment.