mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 06:01:37 +08:00
Enable BMI055 for FMUv5 and improve console handling
This commit is contained in:
@@ -13,6 +13,7 @@ set(config_module_list
|
|||||||
drivers/airspeed
|
drivers/airspeed
|
||||||
drivers/blinkm
|
drivers/blinkm
|
||||||
drivers/bma180
|
drivers/bma180
|
||||||
|
drivers/bmi055
|
||||||
drivers/bmi160
|
drivers/bmi160
|
||||||
drivers/bmp280
|
drivers/bmp280
|
||||||
drivers/boards/px4fmu-v5
|
drivers/boards/px4fmu-v5
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ px4_add_module(
|
|||||||
MAIN bmi055
|
MAIN bmi055
|
||||||
STACK_MAIN 1200
|
STACK_MAIN 1200
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
-Weffc++
|
|
||||||
SRCS
|
SRCS
|
||||||
bmi055_accel.cpp
|
bmi055_accel.cpp
|
||||||
bmi055_gyro.cpp
|
bmi055_gyro.cpp
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#include <px4_config.h>
|
||||||
|
#include <platforms/px4_getopt.h>
|
||||||
#include "bmi055.hpp"
|
#include "bmi055.hpp"
|
||||||
|
|
||||||
/** driver 'main' command */
|
/** driver 'main' command */
|
||||||
@@ -526,9 +528,11 @@ bmi055_main(int argc, char *argv[])
|
|||||||
int ch;
|
int ch;
|
||||||
enum Rotation rotation = ROTATION_NONE;
|
enum Rotation rotation = ROTATION_NONE;
|
||||||
enum sensor_type sensor = BMI055_NONE;
|
enum sensor_type sensor = BMI055_NONE;
|
||||||
|
int myoptind = 1;
|
||||||
|
const char *myoptarg = NULL;
|
||||||
|
|
||||||
/* jump over start/off/etc and look at options first */
|
/* jump over start/off/etc and look at options first */
|
||||||
while ((ch = getopt(argc, argv, "XR:AG")) != EOF) {
|
while ((ch = px4_getopt(argc, argv, "XR:AG", &myoptind, &myoptarg)) != EOF) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'X':
|
case 'X':
|
||||||
external_bus = true;
|
external_bus = true;
|
||||||
@@ -552,7 +556,7 @@ bmi055_main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *verb = argv[optind];
|
const char *verb = argv[myoptind];
|
||||||
|
|
||||||
if (sensor == BMI055_NONE) {
|
if (sensor == BMI055_NONE) {
|
||||||
bmi055::usage();
|
bmi055::usage();
|
||||||
|
|||||||
@@ -133,12 +133,12 @@ __BEGIN_DECLS
|
|||||||
|
|
||||||
#define PX4_SPIDEV_ICM_20689 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS,0)
|
#define PX4_SPIDEV_ICM_20689 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS,0)
|
||||||
#define PX4_SPIDEV_ICM_20602 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS,1)
|
#define PX4_SPIDEV_ICM_20602 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS,1)
|
||||||
#define PX4_SPIDEV_BMI055_GYRO PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS,2)
|
#define PX4_SPIDEV_BMI055_GYR PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS,2)
|
||||||
#define PX4_SPIDEV_BMI055_ACCEL PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS,3)
|
#define PX4_SPIDEV_BMI055_ACC PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS,3)
|
||||||
|
|
||||||
#define PX4_SENSOR_BUS_CS_GPIO {GPIO_SPI_CS_ICM20689, GPIO_SPI_CS_ICM20602, GPIO_SPI_CS_BMI055_GYR, GPIO_SPI_CS_BMI055_ACC}
|
#define PX4_SENSOR_BUS_CS_GPIO {GPIO_SPI_CS_ICM20689, GPIO_SPI_CS_ICM20602, GPIO_SPI_CS_BMI055_GYR, GPIO_SPI_CS_BMI055_ACC}
|
||||||
#define PX4_SENSORS_BUS_FIRST_CS PX4_SPIDEV_ICM_20689
|
#define PX4_SENSORS_BUS_FIRST_CS PX4_SPIDEV_ICM_20689
|
||||||
#define PX4_SENSORS_BUS_LAST_CS PX4_SPIDEV_BMI055_ACCEL
|
#define PX4_SENSORS_BUS_LAST_CS PX4_SPIDEV_BMI055_ACC
|
||||||
|
|
||||||
#define PX4_SPIDEV_MEMORY PX4_MK_SPI_SEL(PX4_SPI_BUS_MEMORY,0)
|
#define PX4_SPIDEV_MEMORY PX4_MK_SPI_SEL(PX4_SPI_BUS_MEMORY,0)
|
||||||
#define PX4_MEMORY_BUS_CS_GPIO {GPIO_SPI_CS_MEMORY}
|
#define PX4_MEMORY_BUS_CS_GPIO {GPIO_SPI_CS_MEMORY}
|
||||||
|
|||||||
Reference in New Issue
Block a user