1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Added PIOS_COM_TELEM_BAUDRATE, PIOS_COM_GPS_BAUDRATE, PIOS_COM_AUX_BAUDRATE & PIOS_COM_SPEKTRUM_BAUDRATE defines in pios_board.h with '#if defines' in pios_board.c for easier baudrate changing.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1644 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2010-09-15 17:18:38 +00:00 committed by pip
parent 3e89e388fa
commit 73c8194acc
2 changed files with 33 additions and 11 deletions

View File

@ -103,20 +103,25 @@ 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 1024
#define PIOS_USART_TX_BUFFER_SIZE 256
#define PIOS_COM_TELEM_RF 0
#define PIOS_COM_GPS 1
#define PIOS_COM_TELEM_USB 2
#define PIOS_COM_TELEM_BAUDRATE 57600
#define PIOS_COM_GPS_BAUDRATE 57600
#define PIOS_COM_TELEM_RF 0
#define PIOS_COM_GPS 1
#define PIOS_COM_TELEM_USB 2
#ifdef PIOS_ENABLE_AUX_UART
#define PIOS_COM_AUX 3
#define PIOS_COM_DEBUG PIOS_COM_AUX
#define PIOS_COM_AUX_BAUDRATE 57600
#define PIOS_COM_AUX 3
#define PIOS_COM_DEBUG PIOS_COM_AUX
#endif
#ifdef PIOS_INCLUDE_SPEKTRUM
#define PIOS_COM_SPEKTRUM 3
#define PIOS_COM_SPEKTRUM_BAUDRATE 115200
#define PIOS_COM_SPEKTRUM 3
#endif
//-------------------------

View File

@ -313,7 +313,11 @@ void USART2_IRQHandler() __attribute__ ((alias ("PIOS_USART_telem_irq_handler"))
const struct pios_usart_cfg pios_usart_telem_cfg = {
.regs = USART2,
.init = {
.USART_BaudRate = 57600,
#if defined (PIOS_COM_TELEM_BAUDRATE)
.USART_BaudRate = PIOS_COM_TELEM_BAUDRATE,
#else
.USART_BaudRate = 57600,
#endif
.USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No,
.USART_StopBits = USART_StopBits_1,
@ -356,7 +360,11 @@ const struct pios_usart_cfg pios_usart_gps_cfg = {
.regs = USART3,
.remap = GPIO_PartialRemap_USART3,
.init = {
.USART_BaudRate = 57600,
#if defined (PIOS_COM_GPS_BAUDRATE)
.USART_BaudRate = PIOS_COM_GPS_BAUDRATE,
#else
.USART_BaudRate = 57600,
#endif
.USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No,
.USART_StopBits = USART_StopBits_1,
@ -399,6 +407,11 @@ void USART1_IRQHandler() __attribute__ ((alias ("PIOS_USART_aux_irq_handler")));
const struct pios_usart_cfg pios_usart_aux_cfg = {
.regs = USART1,
.init = {
#if defined (PIOS_COM_AUX_BAUDRATE)
.USART_BaudRate = PIOS_COM_AUX_BAUDRATE,
#else
.USART_BaudRate = 57600,
#endif
.USART_BaudRate = 57600,
.USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No,
@ -444,7 +457,11 @@ void USART1_IRQHandler() __attribute__ ((alias ("PIOS_USART_spektrum_irq_handler
const struct pios_usart_cfg pios_usart_spektrum_cfg = {
.regs = USART1,
.init = {
.USART_BaudRate = 115200,
#if defined (PIOS_COM_SPEKTRUM_BAUDRATE)
.USART_BaudRate = PIOS_COM_SPEKTRUM_BAUDRATE,
#else
.USART_BaudRate = 115200,
#endif
.USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No,
.USART_StopBits = USART_StopBits_1,