diff options
author | Ash Charles <ashcharles@gmail.com> | 2014-05-13 13:47:40 -0700 |
---|---|---|
committer | Ash Charles <ashcharles@gmail.com> | 2014-05-13 13:47:40 -0700 |
commit | 9db966e05876f35d56cecdfc2c74f2df914bd8bb (patch) | |
tree | 4a7e99e76aa122574772a9de302425260e8795b4 /src | |
parent | 3b72e31e83d1075096a7ee99896885998bd3d6fd (diff) | |
download | px4-firmware-9db966e05876f35d56cecdfc2c74f2df914bd8bb.tar.gz px4-firmware-9db966e05876f35d56cecdfc2c74f2df914bd8bb.tar.bz2 px4-firmware-9db966e05876f35d56cecdfc2c74f2df914bd8bb.zip |
[gps] Conditionally set default GPS port
AeroCore uses ttyS0 not ttyS3 as the serial port connected to the GPS.
Now, a board can set GPS_DEFAULT_UART_PORT to override the default setting
in a board-specific fashion.
Signed-off-by: Ash Charles <ashcharles@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/boards/aerocore/board_config.h | 1 | ||||
-rw-r--r-- | src/drivers/drv_gps.h | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/boards/aerocore/board_config.h b/src/drivers/boards/aerocore/board_config.h index a3257f339..dd98cf480 100644 --- a/src/drivers/boards/aerocore/board_config.h +++ b/src/drivers/boards/aerocore/board_config.h @@ -73,6 +73,7 @@ __BEGIN_DECLS /* GPS */ #define GPIO_GPS_NRESET (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN5) #define GPIO_GPS_TIMEPULSE (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTC|GPIO_PIN4) +#define GPS_DEFAULT_UART_PORT "/dev/ttyS0" /* SPI3--Sensors */ #define PX4_SPI_BUS_SENSORS 3 diff --git a/src/drivers/drv_gps.h b/src/drivers/drv_gps.h index 96669a021..e14f4e00d 100644 --- a/src/drivers/drv_gps.h +++ b/src/drivers/drv_gps.h @@ -43,12 +43,12 @@ #include <stdint.h> #include <sys/ioctl.h> +#include "board_config.h" + #include "drv_sensor.h" #include "drv_orb_dev.h" -#ifdef CONFIG_ARCH_BOARD_AEROCORE -#define GPS_DEFAULT_UART_PORT "/dev/ttyS0" -#else +#ifndef GPS_DEFAULT_UART_PORT #define GPS_DEFAULT_UART_PORT "/dev/ttyS3" #endif |