mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 00:23:34 +08:00
[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>
This commit is contained in:
@@ -73,6 +73,7 @@ __BEGIN_DECLS
|
|||||||
/* GPS */
|
/* GPS */
|
||||||
#define GPIO_GPS_NRESET (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN5)
|
#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 GPIO_GPS_TIMEPULSE (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTC|GPIO_PIN4)
|
||||||
|
#define GPS_DEFAULT_UART_PORT "/dev/ttyS0"
|
||||||
|
|
||||||
/* SPI3--Sensors */
|
/* SPI3--Sensors */
|
||||||
#define PX4_SPI_BUS_SENSORS 3
|
#define PX4_SPI_BUS_SENSORS 3
|
||||||
|
|||||||
@@ -43,12 +43,12 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
#include "board_config.h"
|
||||||
|
|
||||||
#include "drv_sensor.h"
|
#include "drv_sensor.h"
|
||||||
#include "drv_orb_dev.h"
|
#include "drv_orb_dev.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_BOARD_AEROCORE
|
#ifndef GPS_DEFAULT_UART_PORT
|
||||||
#define GPS_DEFAULT_UART_PORT "/dev/ttyS0"
|
|
||||||
#else
|
|
||||||
#define GPS_DEFAULT_UART_PORT "/dev/ttyS3"
|
#define GPS_DEFAULT_UART_PORT "/dev/ttyS3"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user