From cf864225fedfe6c82cd0133f6bc27aeec8e6acda Mon Sep 17 00:00:00 2001 From: pip Date: Wed, 15 Sep 2010 17:07:37 +0000 Subject: [PATCH] Added easier to find USART baudrate setting PIOS_USART_BAUDRATE. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1640 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/AHRS/inc/pios_board.h | 1 + flight/AHRS/pios_board.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/flight/AHRS/inc/pios_board.h b/flight/AHRS/inc/pios_board.h index 1e23ff323..da08e1674 100644 --- a/flight/AHRS/inc/pios_board.h +++ b/flight/AHRS/inc/pios_board.h @@ -115,6 +115,7 @@ TIM8 | | | | //------------------------- #define PIOS_USART_RX_BUFFER_SIZE 256 #define PIOS_USART_TX_BUFFER_SIZE 256 +#define PIOS_USART_BAUDRATE 230400 #define PIOS_COM_AUX 0 #define PIOS_COM_DEBUG PIOS_COM_AUX diff --git a/flight/AHRS/pios_board.c b/flight/AHRS/pios_board.c index faf805d77..7ea8d14b3 100644 --- a/flight/AHRS/pios_board.c +++ b/flight/AHRS/pios_board.c @@ -157,7 +157,11 @@ void USART3_IRQHandler() __attribute__ ((alias ("PIOS_USART_aux_irq_handler"))); const struct pios_usart_cfg pios_usart_aux_cfg = { .regs = USART3, .init = { - .USART_BaudRate = 230400, + #if defined (PIOS_USART_BAUDRATE) + .USART_BaudRate = PIOS_USART_BAUDRATE, + #else + .USART_BaudRate = 57600, + #endif .USART_WordLength = USART_WordLength_8b, .USART_Parity = USART_Parity_No, .USART_StopBits = USART_StopBits_1,