mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
PiOS/USART: Use the buffer size defined in the board file
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2421 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
7c9b3b3d69
commit
f0c36b13a4
@ -135,8 +135,8 @@ TIM8 | Servo 5 | Servo 6 | Servo 7 | Servo 8
|
||||
//
|
||||
// See also pios_board.c
|
||||
//-------------------------
|
||||
#define PIOS_USART_RX_BUFFER_SIZE 1024
|
||||
#define PIOS_USART_TX_BUFFER_SIZE 256
|
||||
#define PIOS_USART_RX_BUFFER_SIZE 512
|
||||
#define PIOS_USART_TX_BUFFER_SIZE 512
|
||||
|
||||
#define PIOS_COM_TELEM_BAUDRATE 57600
|
||||
#define PIOS_COM_GPS_BAUDRATE 57600
|
||||
|
@ -70,8 +70,8 @@ void PIOS_USART_Init(void)
|
||||
PIOS_DEBUG_Assert(usart_dev);
|
||||
|
||||
/* Clear buffer counters */
|
||||
fifoBuf_init(&usart_dev->rx, usart_dev->rx_buffer, UART_BUFFER_SIZE);
|
||||
fifoBuf_init(&usart_dev->tx, usart_dev->tx_buffer, UART_BUFFER_SIZE);
|
||||
fifoBuf_init(&usart_dev->rx, usart_dev->rx_buffer, sizeof(usart_dev->rx_buffer));
|
||||
fifoBuf_init(&usart_dev->tx, usart_dev->tx_buffer, sizeof(usart_dev->tx_buffer));
|
||||
|
||||
/* Enable the USART Pins Software Remapping */
|
||||
if (usart_dev->cfg->remap) {
|
||||
|
@ -36,8 +36,6 @@
|
||||
#include <pios_stm32.h>
|
||||
#include <fifo_buffer.h>
|
||||
|
||||
#define UART_BUFFER_SIZE 1024
|
||||
|
||||
struct pios_usart_cfg {
|
||||
USART_TypeDef *regs;
|
||||
uint32_t remap; /* GPIO_Remap_* */
|
||||
@ -50,10 +48,10 @@ struct pios_usart_cfg {
|
||||
struct pios_usart_dev {
|
||||
const struct pios_usart_cfg *const cfg;
|
||||
|
||||
uint8_t rx_buffer[UART_BUFFER_SIZE] __attribute__ ((aligned(4))); // align to 32-bit to try and provide speed improvement;
|
||||
uint8_t rx_buffer[PIOS_USART_RX_BUFFER_SIZE] __attribute__ ((aligned(4))); // align to 32-bit to try and provide speed improvement;
|
||||
t_fifo_buffer rx;
|
||||
|
||||
uint8_t tx_buffer[UART_BUFFER_SIZE] __attribute__ ((aligned(4))); // align to 32-bit to try and provide speed improvement;
|
||||
uint8_t tx_buffer[PIOS_USART_TX_BUFFER_SIZE] __attribute__ ((aligned(4))); // align to 32-bit to try and provide speed improvement;
|
||||
t_fifo_buffer tx;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user