chip/stm32/usart_rx_dma.c: Format with clang-format
BRANCH=none
TEST=none
@@ -27,8 +27,7 @@ void usart_rx_dma_init(struct usart_config const *config)
.channel = dma_config->channel,
.periph = (void *)&STM32_USART_RDR(base),
.flags = (STM32_DMA_CCR_MSIZE_8_BIT |
- STM32_DMA_CCR_PSIZE_8_BIT |
- STM32_DMA_CCR_CIRC),
+ STM32_DMA_CCR_PSIZE_8_BIT | STM32_DMA_CCR_CIRC),
};
if (IS_ENABLED(CHIP_FAMILY_STM32F4))
@@ -44,8 +43,7 @@ void usart_rx_dma_init(struct usart_config const *config)
dma_start_rx(&options, dma_config->fifo_size, dma_config->fifo_buffer);
}
-static void usart_rx_dma_interrupt_common(
- struct usart_config const *config,
+static void usart_rx_dma_interrupt_common(struct usart_config const *config,
add_data_t add_data)
{
struct usart_rx_dma const *dma_config =
@@ -60,8 +58,7 @@ static void usart_rx_dma_interrupt_common(
if (new_index > old_index) {
new_bytes = new_index - old_index;
- added = add_data(config,
- dma_config->fifo_buffer + old_index,
+ added = add_data(config, dma_config->fifo_buffer + old_index,
new_bytes);
} else if (new_index < old_index) {
/*
@@ -71,12 +68,9 @@ static void usart_rx_dma_interrupt_common(
*/
new_bytes = dma_config->fifo_size - (old_index - new_index);
- added = add_data(config,
- dma_config->fifo_buffer + old_index,
+ added = add_data(config, dma_config->fifo_buffer + old_index,
dma_config->fifo_size - old_index) +
- add_data(config,
- dma_config->fifo_buffer,
- new_index);
+ add_data(config, dma_config->fifo_buffer, new_index);
} else {
/* (new_index == old_index): nothing to add to the queue. */
}
@@ -89,8 +83,8 @@ static void usart_rx_dma_interrupt_common(
dma_config->state->index = new_index;
}
-static size_t queue_add(struct usart_config const *config,
- const uint8_t *src, size_t count)
+static size_t queue_add(struct usart_config const *config, const uint8_t *src,
+ size_t count)
{
return queue_add_units(config->producer.queue, (void *)src, count);
}
@@ -100,7 +94,6 @@ void usart_rx_dma_interrupt(struct usart_config const *config)
usart_rx_dma_interrupt_common(config, &queue_add);
}
-
#if defined(CONFIG_USART_HOST_COMMAND)
void usart_host_command_rx_dma_interrupt(struct usart_config const *config)
{
